gnu: dpkg: Use G-expressions.

* gnu/packages/debian.scm (dpkg)[arguments]:
Rewrite as G-expressions.
This commit is contained in:
Tobias Geerinckx-Rice 2023-07-02 02:00:01 +02:00
parent 1122217f27
commit ec96833aab
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -349,58 +349,57 @@ distributions such as Debian and Trisquel.")
(base32 "0b5czgif5g6pdjzcw60hzzj0i1llxvajf3nlx115axmpa3y4iynd")))) (base32 "0b5czgif5g6pdjzcw60hzzj0i1llxvajf3nlx115axmpa3y4iynd"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:modules (list #:modules
((srfi srfi-71) `((srfi srfi-71)
,@%gnu-build-system-modules) ,@%gnu-build-system-modules)
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-before 'bootstrap 'patch-version (add-before 'bootstrap 'patch-version
(lambda _ (lambda _
(patch-shebang "build-aux/get-version") (patch-shebang "build-aux/get-version")
(with-output-to-file ".dist-version" (with-output-to-file ".dist-version"
(lambda () (display ,version))))) (lambda () (display #$version)))))
(add-after 'unpack 'set-perl-libdir (add-after 'unpack 'set-perl-libdir
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (let* ((perl #$(this-package-input "perl"))
(perl (assoc-ref inputs "perl")) (_ perl-version (package-name->name+version perl)))
(_ perl-version (package-name->name+version perl))) (setenv "PERL_LIBDIR"
(setenv "PERL_LIBDIR" (string-append #$output
(string-append out "/lib/perl5/site_perl/"
"/lib/perl5/site_perl/" perl-version)))))
perl-version))))) (add-after 'install 'wrap-scripts
(add-after 'install 'wrap-scripts (lambda _
(lambda* (#:key outputs #:allow-other-keys) (with-directory-excursion (string-append #$output "/bin")
(let ((out (assoc-ref outputs "out"))) (for-each
(with-directory-excursion (string-append out "/bin") (lambda (file)
(for-each (wrap-script file
(lambda (file) ;; Make sure all perl scripts in "bin" find the
(wrap-script file ;; required Perl modules at runtime.
;; Make sure all perl scripts in "bin" find the `("PERL5LIB" ":" prefix
;; required Perl modules at runtime. (,(string-append #$output
`("PERL5LIB" ":" prefix "/lib/perl5/site_perl")
(,(string-append out ,(getenv "PERL5LIB")))
"/lib/perl5/site_perl") ;; DPKG perl modules expect dpkg to be installed.
,(getenv "PERL5LIB"))) ;; Work around it by adding dpkg to the script's path.
;; DPKG perl modules always expect dpkg to be installed. `("PATH" ":" prefix (,(string-append #$output
;; Work around this by adding dpkg to the path of the scripts. "/bin")))))
`("PATH" ":" prefix (,(string-append out "/bin"))))) (list "dpkg-architecture"
(list "dpkg-architecture" "dpkg-buildflags"
"dpkg-buildflags" "dpkg-buildpackage"
"dpkg-buildpackage" "dpkg-checkbuilddeps"
"dpkg-checkbuilddeps" "dpkg-distaddfile"
"dpkg-distaddfile" "dpkg-genbuildinfo"
"dpkg-genbuildinfo" "dpkg-genchanges"
"dpkg-genchanges" "dpkg-gencontrol"
"dpkg-gencontrol" "dpkg-gensymbols"
"dpkg-gensymbols" "dpkg-mergechangelogs"
"dpkg-mergechangelogs" "dpkg-name"
"dpkg-name" "dpkg-parsechangelog"
"dpkg-parsechangelog" "dpkg-scanpackages"
"dpkg-scanpackages" "dpkg-scansources"
"dpkg-scansources" "dpkg-shlibdeps"
"dpkg-shlibdeps" "dpkg-source"
"dpkg-source" "dpkg-vendor"))))))))
"dpkg-vendor")))))))))
(native-inputs (native-inputs
(list autoconf (list autoconf
automake automake