GNU bug report logs -
#39102
[PATCH 1/2] gnu: xdg-utils: Don't use propagated inputs.
Previous Next
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
View this message in rfc822 format
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.
---
gnu/packages/freedesktop.scm | 40 ++++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 7066685dee..9e1bf730d2 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -16,6 +16,7 @@
;;; Copyright © 2018 Stefan Stefanović <stefanx2ovic <at> gmail.com>
;;; Copyright © 2019 Reza Alizadeh Majd <r.majd <at> pantherx.org>
;;; Copyright © 2019 Guillaume Le Vaillant <glv <at> posteo.net>
+;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -47,6 +48,7 @@
#:use-module (gnu packages acl)
#:use-module (gnu packages admin)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
@@ -55,6 +57,7 @@
#:use-module (gnu packages disk)
#:use-module (gnu packages docbook)
#:use-module (gnu packages documentation)
+ #:use-module (gnu packages gawk)
#:use-module (gnu packages gettext)
#:use-module (gnu packages ghostscript)
#:use-module (gnu packages gl)
@@ -107,20 +110,41 @@
("libxslt" ,libxslt)
("w3m" ,w3m)
("xmlto" ,xmlto)))
- (propagated-inputs
- `(("perl-file-mimeinfo" ,perl-file-mimeinfo) ; for mimeopen fallback
+ (inputs
+ `(("awk" ,gawk)
+ ("coreutils" ,coreutils)
+ ("grep" ,grep)
+ ("inetutils" ,inetutils) ; xdg-screensaver uses `hostname'
+ ("perl-file-mimeinfo" ,perl-file-mimeinfo) ; for mimeopen fallback
+ ("sed" ,sed)
("xprop" ,xprop) ; for Xfce detecting
("xset" ,xset))) ; for xdg-screensaver
(arguments
`(#:tests? #f ; no check target
+ #:modules ((srfi srfi-26)
+ (guix build utils)
+ (guix build gnu-build-system))
#:phases
(modify-phases %standard-phases
- (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")))
+ (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 "."))))
#t))
(add-before 'build 'locate-catalog-files
(lambda* (#:key inputs #:allow-other-keys)
--
2.24.1
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.