me
/
guix
Archived
1
0
Fork 0

gnu: xdg-utils: Use G-expression.

* gnu/packages/freedesktop.scm (xdg-utils)[arguments]: Use gexp.
master
Marius Bakke 2022-11-18 09:58:06 +01:00 committed by Maxim Cournoyer
parent 644a019367
commit 47234c3960
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 52 additions and 50 deletions

View File

@ -497,57 +497,59 @@ display servers. It supports many different languages and emoji.")
xprop ;for Xfce detecting xprop ;for Xfce detecting
xset)) ;for xdg-screensaver xset)) ;for xdg-screensaver
(arguments (arguments
`(#:tests? #f ;no check target (list
#:modules ((srfi srfi-26) #:tests? #f ;no check target
#:modules `((srfi srfi-26)
,@%gnu-build-system-modules) ,@%gnu-build-system-modules)
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'patch-hardcoded-paths (add-after 'unpack 'patch-hardcoded-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(substitute* "scripts/xdg-mime.in" (substitute* "scripts/xdg-mime.in"
(("/usr/bin/file") (("/usr/bin/file")
(search-input-file inputs "bin/file"))) (search-input-file inputs "bin/file")))
(substitute* "scripts/xdg-open.in" (substitute* "scripts/xdg-open.in"
(("/usr/bin/printf") (("/usr/bin/printf")
(search-input-file inputs "bin/printf"))))) (search-input-file inputs "bin/printf")))))
(add-before 'build 'locate-catalog-files (add-before 'build 'locate-catalog-files
(lambda* (#:key native-inputs inputs #:allow-other-keys) (lambda* (#:key native-inputs inputs #:allow-other-keys)
(let* ((native (or native-inputs inputs)) (let* ((native (or native-inputs inputs))
(xmldoc (search-input-directory native (xmldoc (search-input-directory native
"xml/dtd/docbook")) "xml/dtd/docbook"))
(xsldoc (search-input-directory (xsldoc (search-input-directory
native native
(string-append "xml/xsl/docbook-xsl-" (string-append "xml/xsl/docbook-xsl-"
,(package-version docbook-xsl))))) #$(package-version
(for-each (lambda (file) (this-package-native-input
(substitute* file "docbook-xsl"))))))
(("http://.*/docbookx\\.dtd") (for-each (lambda (file)
(string-append xmldoc "/docbookx.dtd")))) (substitute* file
(find-files "scripts/desc" "\\.xml$")) (("http://.*/docbookx\\.dtd")
(substitute* "scripts/Makefile" (string-append xmldoc "/docbookx.dtd"))))
;; Apparently `xmlto' does not bother to looks up the stylesheets (find-files "scripts/desc" "\\.xml$"))
;; specified in the XML, unlike the above substitition. Instead it (substitute* "scripts/Makefile"
;; uses a hard-coded URL. Work around it here, but if this is ;; Apparently `xmlto' does not bother to looks up the stylesheets
;; common perhaps we should hardcode this path in xmlto itself. ;; specified in the XML, unlike the above substitition. Instead it
(("\\$\\(XMLTO\\) man") ;; uses a hard-coded URL. Work around it here, but if this is
(string-append "$(XMLTO) -x " xsldoc ;; common perhaps we should hardcode this path in xmlto itself.
"/manpages/docbook.xsl man"))) (("\\$\\(XMLTO\\) man")
(setenv "STYLESHEET" (string-append "$(XMLTO) -x " xsldoc
(string-append xsldoc "/html/docbook.xsl"))))) "/manpages/docbook.xsl man")))
(add-after 'install 'wrap-executables (setenv "STYLESHEET"
(lambda* (#:key inputs outputs #:allow-other-keys) (string-append xsldoc "/html/docbook.xsl")))))
(let* ((out (assoc-ref outputs "out")) (add-after 'install 'wrap-executables
(dependencies '("awk" "grep" "hostname" "ls" "mimeopen" (lambda* (#:key inputs outputs #:allow-other-keys)
"sed" "xprop" "xset")) (let* ((dependencies '("awk" "grep" "hostname" "ls" "mimeopen"
(pkgs (map (lambda (cmd) "sed" "xprop" "xset"))
(search-input-file inputs (pkgs (map (lambda (cmd)
(string-append "bin/" cmd))) (search-input-file inputs
dependencies)) (string-append "bin/" cmd)))
(bindirs (map dirname pkgs))) dependencies))
(with-directory-excursion (string-append out "/bin") (bindirs (map dirname pkgs)))
(for-each (cute wrap-program <> (with-directory-excursion (string-append #$output "/bin")
`("PATH" ":" prefix ,bindirs)) (for-each (cute wrap-program <>
(find-files "."))))))))) `("PATH" ":" prefix ,bindirs))
(find-files ".")))))))))
(home-page "https://www.freedesktop.org/wiki/Software/xdg-utils/") (home-page "https://www.freedesktop.org/wiki/Software/xdg-utils/")
(synopsis "Freedesktop.org scripts for desktop integration") (synopsis "Freedesktop.org scripts for desktop integration")
(description "The xdg-utils package is a set of simple scripts that (description "The xdg-utils package is a set of simple scripts that