GNU bug report logs - #39102
[PATCH 1/2] gnu: xdg-utils: Don't use propagated inputs.

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Sun, 12 Jan 2020 15:45:02 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 39102 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Jakub Kądziołka <kuba <at> kadziolka.net>,
 39102 <at> debbugs.gnu.org
Subject: Re: [bug#39102] [PATCH v2 1/2] gnu: xdg-utils: Don't use propagated
 inputs.
Date: Sun, 12 Jan 2020 20:29:59 +0100
[Message part 1 (text/plain, inline)]
Jakub Kądziołka <kuba <at> kadziolka.net> writes:

> Sending a revision to the first patch after feedback on IRC. Changes:
>  - Remove the `string-prefix? "PATH:"' hack, list the packages
>    explicitly.
>  - Use cute to make the code easier to read.
>
> ---
> * gnu/packages/freedesktop.scm (xdg-utils)
>   [propagated-inputs, inputs]: Add awk, coreutils, grep and sed, make
>   the dependencies not propagated.
>   [arguments](patch-hardcoded-paths): Move to after 'install to make
>   wrap-program function correctly. Wrap the installed programs.

FYI: The stray '---' here made git disregard the actual commit message,
and instead only added the four lines above.  The other way around would
be perfect.  :-)

I've applied this patch, with the changes below (leaving the original
patch-hardcoded-paths phase intact, renaming the new phase accordingly;
and added a let binding for "out").

I'll address the Qt patch in a separate message.

[diff (text/x-patch, inline)]
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 9e1bf730d2..ed221439b4 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -122,29 +122,15 @@
     (arguments
      `(#:tests? #f   ; no check target
        #:modules ((srfi srfi-26)
-                  (guix build utils)
-                  (guix build gnu-build-system))
+                  ,@%gnu-build-system-modules)
        #:phases
        (modify-phases %standard-phases
-         (add-after 'install 'patch-hardcoded-paths
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (with-directory-excursion (string-append (assoc-ref outputs "out")
-                                                      "/bin")
-               (substitute* "xdg-mime"
-                 (("/usr/bin/file") (which "file")))
-               (substitute* "xdg-open"
-                 (("/usr/bin/printf") (which "printf")))
-               (let ((path-ext
-                       (map (cute string-append <> "/bin")
-                            (cons (assoc-ref outputs "out")
-                                  (map (cute assoc-ref inputs <>)
-                                       '("awk" "coreutils" "grep" "inetutils"
-                                         "perl-file-mimeinfo" "sed" "xprop"
-                                         "xset"))))))
-                 (for-each
-                   (cute wrap-program <>
-                        `("PATH" ":" prefix ,path-ext))
-                   (find-files "."))))
+         (add-after 'unpack 'patch-hardcoded-paths
+           (lambda _
+             (substitute* "scripts/xdg-mime.in"
+               (("/usr/bin/file") (which "file")))
+             (substitute* "scripts/xdg-open.in"
+               (("/usr/bin/printf") (which "printf")))
              #t))
          (add-before 'build 'locate-catalog-files
            (lambda* (#:key inputs #:allow-other-keys)
@@ -168,6 +154,21 @@
                                  "/manpages/docbook.xsl man")))
                (setenv "STYLESHEET"
                        (string-append xsldoc "/html/docbook.xsl"))
+               #t)))
+         (add-after 'install 'wrap-executables
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (with-directory-excursion (string-append out "/bin")
+                 (let ((path-ext
+                        (map (cute string-append <> "/bin")
+                             (cons out
+                                   (map (cute assoc-ref inputs <>)
+                                        '("awk" "coreutils" "grep" "inetutils"
+                                          "perl-file-mimeinfo" "sed" "xprop"
+                                          "xset"))))))
+                   (for-each (cute wrap-program <>
+                                   `("PATH" ":" prefix ,path-ext))
+                             (find-files "."))))
                #t))))))
     (home-page "https://www.freedesktop.org/wiki/Software/xdg-utils/")
     (synopsis "Freedesktop.org scripts for desktop integration")
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 5 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.