summaryrefslogtreecommitdiff
path: root/gnu/packages/debian.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-05-19 15:24:45 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-05-23 21:59:48 +0300
commit2bd17f8a15f414471b63412d0a2d4c2253e760c0 (patch)
tree9f3b1ea92bb2383fc788a910b0b91284f6f93a7a /gnu/packages/debian.scm
parentf38ff1d7fb82dacf8b09b61bcf48aec8c6bc77e9 (diff)
downloadguix-patches-2bd17f8a15f414471b63412d0a2d4c2253e760c0.tar
guix-patches-2bd17f8a15f414471b63412d0a2d4c2253e760c0.tar.gz
gnu: dpkg: Fix calling dpkg from perl modules.
* gnu/packages/debian.scm (dpkg)[arguments]: Add phase to wrap perl scripts with PERL5LIB and the path to dpkg itself. [inputs]: Add guile-3.0.
Diffstat (limited to 'gnu/packages/debian.scm')
-rw-r--r--gnu/packages/debian.scm37
1 files changed, 36 insertions, 1 deletions
diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm
index aec65e3386..65132d9259 100644
--- a/gnu/packages/debian.scm
+++ b/gnu/packages/debian.scm
@@ -33,6 +33,7 @@
#:use-module (gnu packages dbm)
#:use-module (gnu packages gettext)
#:use-module (gnu packages gnupg)
+ #:use-module (gnu packages guile)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
@@ -361,7 +362,40 @@ other apt sources typically provided by open source developers.")
(setenv "PERL_LIBDIR"
(string-append out
"/lib/perl5/site_perl/"
- ,(package-version perl)))))))))
+ ,(package-version perl))))))
+ (add-after 'install 'wrap-scripts
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (with-directory-excursion (string-append out "/bin")
+ (for-each
+ (lambda (file)
+ (wrap-script file
+ ;; Make sure all perl scripts in "bin" find the
+ ;; required Perl modules at runtime.
+ `("PERL5LIB" ":" prefix
+ (,(string-append out
+ "/lib/perl5/site_perl")
+ ,(getenv "PERL5LIB")))
+ ;; DPKG perl modules always expect dpkg to be installed.
+ ;; Work around this by adding dpkg to the path of the scripts.
+ `("PATH" ":" prefix (,(string-append out "/bin")))))
+ (list "dpkg-architecture"
+ "dpkg-buildflags"
+ "dpkg-buildpackage"
+ "dpkg-checkbuilddeps"
+ "dpkg-distaddfile"
+ "dpkg-genbuildinfo"
+ "dpkg-genchanges"
+ "dpkg-gencontrol"
+ "dpkg-gensymbols"
+ "dpkg-mergechangelogs"
+ "dpkg-name"
+ "dpkg-parsechangelog"
+ "dpkg-scanpackages"
+ "dpkg-scansources"
+ "dpkg-shlibdeps"
+ "dpkg-source"
+ "dpkg-vendor")))))))))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
@@ -371,6 +405,7 @@ other apt sources typically provided by open source developers.")
("perl-io-string" ,perl-io-string)))
(inputs
(list bzip2
+ guile-3.0 ; For wrap-script
libmd
ncurses
perl