aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/debian.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/debian.scm')
-rw-r--r--gnu/packages/debian.scm313
1 files changed, 249 insertions, 64 deletions
diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm
index aec65e3386..5ff09393b9 100644
--- a/gnu/packages/debian.scm
+++ b/gnu/packages/debian.scm
@@ -22,21 +22,27 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:use-module (gnu packages autotools)
#:use-module (gnu packages backup)
#:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:use-module (gnu packages crypto)
#:use-module (gnu packages dbm)
#:use-module (gnu packages gettext)
#:use-module (gnu packages gnupg)
+ #:use-module (gnu packages guile)
+ #:use-module (gnu packages linux)
+ #:use-module (gnu packages man)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
- #:use-module (gnu packages wget))
+ #:use-module (gnu packages wget)
+ #:use-module (srfi srfi-26))
(define-public debian-archive-keyring
(package
@@ -200,62 +206,60 @@ contains the archive keys used for that.")
(base32 "0hfx6k86kby4xf0xqskpllq00g159j4khh66hfi6dhcdb91dgyd7"))))
(build-system gnu-build-system)
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (add-after 'unpack 'patch-source
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (tzdata (assoc-ref inputs "tzdata"))
- (debian (assoc-ref inputs "debian-keyring"))
- (ubuntu (assoc-ref inputs "ubuntu-keyring")))
- (substitute* "Makefile"
- (("/usr") "")
- (("-o root -g root") "")
- (("chown root.*") "\n"))
- (substitute* '("scripts/etch"
- "scripts/potato"
- "scripts/sarge"
- "scripts/sid"
- "scripts/woody"
- "scripts/woody.buildd")
- (("/usr") debian))
- (substitute* "scripts/gutsy"
- (("/usr") ubuntu))
- (substitute* "debootstrap"
- (("=/usr") (string-append "=" out)))
- ;; Ensure PATH works both in guix and within the debian chroot
- ;; workaround for: https://bugs.debian.org/929889
- (substitute* "functions"
- (("PATH=/sbin:/usr/sbin:/bin:/usr/bin")
- "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin"))
- (substitute* (find-files "scripts" ".")
- (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo")))
- #t)))
- (add-after 'install 'install-man-file
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'patch-source
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((debian #$(this-package-input "debian-archive-keyring"))
+ (ubuntu #$(this-package-input "ubuntu-keyring")))
+ (substitute* "Makefile"
+ (("/usr") "")
+ (("-o root -g root") "")
+ (("chown root.*") "\n"))
+ (substitute* '("scripts/etch"
+ "scripts/potato"
+ "scripts/sarge"
+ "scripts/sid"
+ "scripts/woody"
+ "scripts/woody.buildd")
+ (("/usr") debian))
+ (substitute* "scripts/gutsy"
+ (("/usr") ubuntu))
+ (substitute* "debootstrap"
+ (("=/usr") (string-append "=" #$output))
+ (("/usr/bin/dpkg") (search-input-file inputs "/bin/dpkg")))
+ ;; Ensure PATH works both in guix and within the debian chroot
+ ;; workaround for: https://bugs.debian.org/929889
+ (substitute* "functions"
+ (("PATH=/sbin:/usr/sbin:/bin:/usr/bin")
+ "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin"))
+ (substitute* (find-files "scripts")
+ (("/usr/share/zoneinfo")
+ (search-input-directory inputs "/share/zoneinfo"))))))
+ (add-after 'install 'install-man-file
+ (lambda* (#:key outputs #:allow-other-keys)
(install-file "debootstrap.8"
- (string-append out "/share/man/man8"))
- #t)))
- (add-after 'install 'wrap-executable
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((debootstrap (string-append (assoc-ref outputs "out")
- "/sbin/debootstrap"))
- (path (getenv "PATH")))
- (wrap-program debootstrap
- `("PATH" ":" prefix (,path)))
- #t))))
- #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
- #:tests? #f)) ; no tests
+ (string-append #$output "/share/man/man8"))))
+ (add-after 'install 'wrap-executable
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((debootstrap (string-append #$output "/sbin/debootstrap"))
+ (path (getenv "PATH")))
+ (wrap-program debootstrap
+ `("PATH" ":" prefix (,path)))))))
+ #:make-flags #~(list (string-append "DESTDIR=" #$output))
+ #:tests? #f)) ; no tests
(inputs
- `(("debian-keyring" ,debian-archive-keyring)
- ("ubuntu-keyring" ,ubuntu-keyring)
- ("tzdata" ,tzdata)
+ (list debian-archive-keyring
+ ubuntu-keyring
+ bash-minimal
+ dpkg
+ tzdata
- ;; Called at run-time from various places, needs to be in PATH.
- ("gnupg" ,gnupg)
- ("wget" ,wget)))
+ ;; Called at run-time from various places, needs to be in PATH.
+ gnupg
+ wget))
(native-inputs
(list perl))
(home-page "https://tracker.debian.org/pkg/debootstrap")
@@ -335,7 +339,7 @@ other apt sources typically provided by open source developers.")
(define-public dpkg
(package
(name "dpkg")
- (version "1.21.0")
+ (version "1.21.8")
(source
(origin
(method git-fetch)
@@ -344,14 +348,14 @@ other apt sources typically provided by open source developers.")
(commit version)))
(file-name (git-file-name name version))
(sha256
- (base32 "0g33cyd0qbyfdrphcw8m8ikj2hxqpjbyxbhvnp751515c8hgc4rx"))))
+ (base32 "1whb78pywdlm4v1ablgvvplqjn15b6qrwqkj0pihw5j77aakyz2s"))))
(build-system gnu-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-before 'bootstrap 'patch-version
(lambda _
- (patch-shebang "get-version")
+ (patch-shebang "build-aux/get-version")
(with-output-to-file ".dist-version"
(lambda () (display ,version)))))
(add-after 'unpack 'set-perl-libdir
@@ -361,16 +365,51 @@ 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)
- ("gettext" ,gettext-minimal)
- ("libtool" ,libtool)
- ("pkg-config" ,pkg-config)
- ("perl-io-string" ,perl-io-string)))
+ (list autoconf
+ automake
+ gettext-minimal
+ gnupg ; to run t/Dpkg_OpenPGP.t
+ libtool
+ pkg-config
+ perl-io-string))
(inputs
(list bzip2
+ guile-3.0 ; for wrap-script
libmd
ncurses
perl
@@ -382,6 +421,152 @@ other apt sources typically provided by open source developers.")
handling the installation and removal of Debian software packages.")
(license license:gpl2+)))
+(define-public pbuilder
+ (package
+ (name "pbuilder")
+ (version "0.231")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://salsa.debian.org/pbuilder-team/pbuilder.git/")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0z6f1fgcrkfql9ayc3d0nxra2y6cn91xd5lvr0hd8gdlp9xdvxbc"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:modules `((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-26))
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (add-after 'unpack 'patch-source
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+
+ ;; Documentation requires tldp-one-page.xsl
+ (substitute* "Makefile"
+ ((".*-C Documentation.*") ""))
+
+ ;; Don't create #$output/var/cache/pbuilder/...
+ (substitute* '("Makefile"
+ "pbuildd/Makefile")
+ ((".*/var/cache/pbuilder.*") ""))
+
+ ;; Find the correct fallback location.
+ (substitute* '("pbuilder-checkparams"
+ "pbuilder-loadconfig"
+ "pbuilder-satisfydepends-apt"
+ "pbuilder-satisfydepends-aptitude"
+ "pbuilder-satisfydepends-classic"
+ "t/test_pbuilder-satisfydepends-classic")
+ (("\\$PBUILDER_ROOT(/usr)?") #$output))
+
+ ;; Some hardcoded paths
+ (substitute* '("debuild-pbuilder"
+ "pbuilder"
+ "pbuilder-buildpackage"
+ "pbuilderrc"
+ "pdebuild"
+ "pdebuild-checkparams"
+ "pdebuild-internal")
+ (("/usr/lib/pbuilder")
+ (string-append #$output "/lib/pbuilder")))
+ (substitute* "pbuildd/buildd-config.sh"
+ (("/usr/share/doc/pbuilder")
+ (string-append #$output "/share/doc/pbuilder")))
+ (substitute* "pbuilder-unshare-wrapper"
+ (("/(s)?bin/ifconfig") "ifconfig")
+ (("/(s)?bin/ip") (search-input-file inputs "/sbin/ip")))
+ (substitute* "Documentation/Makefile"
+ (("/usr") ""))
+
+ ;; Ensure PATH works both in Guix and within the Debian chroot.
+ (substitute* "pbuilderrc"
+ (("PATH=\"/usr/sbin:/usr/bin:/sbin:/bin")
+ "PATH=\"$PATH:/usr/sbin:/usr/bin:/sbin:/bin"))))
+ (add-after 'install 'create-etc-pbuilderrc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (with-output-to-file (string-append #$output "/etc/pbuilderrc")
+ (lambda ()
+ (format #t "# A couple of presets to make this work more smoothly.~@
+ MIRRORSITE=\"http://deb.debian.org/debian\"~@
+ if [ -r /run/setuid-programs/sudo ]; then~@
+ PBUILDERROOTCMD=\"/run/setuid-programs/sudo -E\"~@
+ fi~@
+ PBUILDERSATISFYDEPENDSCMD=\"~a/lib/pbuilder/pbuilder-satisfydepends-apt\"~%"
+ #$output)))))
+ (add-after 'install 'install-manpages
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((man (string-append #$output "/share/man/")))
+ (install-file "debuild-pbuilder.1" (string-append man "man1"))
+ (install-file "pdebuild.1" (string-append man "man1"))
+ (install-file "pbuilder.8" (string-append man "man8"))
+ (install-file "pbuilderrc.5" (string-append man "man5")))))
+ (add-after 'install 'wrap-programs
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (for-each
+ (lambda (file)
+ (wrap-script file
+ `("PATH" ":" prefix
+ ,(map (compose dirname (cut search-input-file inputs <>))
+ (list "/bin/cut"
+ "/bin/dpkg"
+ "/bin/grep"
+ "/bin/perl"
+ "/bin/sed"
+ "/bin/which"
+ "/sbin/debootstrap")))))
+ (cons*
+ (string-append #$output "/bin/pdebuild")
+ (string-append #$output "/sbin/pbuilder")
+ (find-files (string-append #$output "/lib/pbuilder"))))))
+ ;; Move the 'check phase to after 'install.
+ (delete 'check)
+ (add-after 'validate-runpath 'check
+ (assoc-ref %standard-phases 'check)))
+ #:make-flags
+ ;; No PREFIX, use DESTDIR instead.
+ #~(list (string-append "DESTDIR=" #$output)
+ (string-append "SYSCONFDIR=" #$output "/etc")
+ (string-append "BINDIR=" #$output "/bin")
+ (string-append "PKGLIBDIR=" #$output "/lib/pbuilder")
+ (string-append "SBINDIR=" #$output "/sbin")
+ (string-append "PKGDATADIR=" #$output "/share/pbuilder")
+ (string-append "EXAMPLEDIR=" #$output "/share/doc/pbuilder/examples")
+ "PBUILDDDIR=/share/doc/pbuilder/examples/pbuildd/")))
+ (inputs
+ (list dpkg
+ debootstrap
+ grep
+ guile-3.0 ; for wrap-script
+ iproute
+ perl
+ which))
+ (native-inputs
+ (list man-db
+ util-linux))
+ (home-page "https://pbuilder-team.pages.debian.net/pbuilder/")
+ (synopsis "Personal package builder for Debian packages")
+ (description
+ "@code{pbuilder} is a personal package builder for Debian packages.
+@itemize
+@item@code{pbuilder} constructs a chroot system, and builds a package inside the
+chroot. It is an ideal system to use to check that a package has correct
+build-dependencies. It uses @code{apt} extensively, and a local mirror, or a
+fast connection to a Debian mirror is ideal, but not necessary.
+@item@code{pbuilder create} uses debootstrap to create a chroot image.
+@item@code{pbuilder update} updates the image to the current state of
+testing/unstable/whatever.
+@item@code{pbuilder build} takes a @code{*.dsc} file and builds a binary in the
+chroot image.
+@item@code{pdebuild} is a wrapper for Debian Developers, to allow running
+@code{pbuilder} just like @code{debuild}, as a normal user.
+@end itemize")
+ (license license:gpl2+)))
+
(define-public reprepro
(package
(name "reprepro")