From unknown Fri Aug 15 02:01:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#55608 <55608@debbugs.gnu.org> To: bug#55608 <55608@debbugs.gnu.org> Subject: Status: [PATCH] gnu: Add pbuilder. Reply-To: bug#55608 <55608@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:01:31 +0000 retitle 55608 [PATCH] gnu: Add pbuilder. reassign 55608 guix-patches submitter 55608 Efraim Flashner severity 55608 normal tag 55608 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 04:09:49 2022 Received: (at submit) by debbugs.gnu.org; 24 May 2022 08:09:49 +0000 Received: from localhost ([127.0.0.1]:50910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntPbt-0005yH-Vi for submit@debbugs.gnu.org; Tue, 24 May 2022 04:09:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:56076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntPbe-0005xv-5U for submit@debbugs.gnu.org; Tue, 24 May 2022 04:09:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntPbb-0007rQ-W5 for guix-patches@gnu.org; Tue, 24 May 2022 04:09:29 -0400 Received: from flashner.co.il ([178.62.234.194]:56392) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntPbZ-0000ZC-EF for guix-patches@gnu.org; Tue, 24 May 2022 04:09:27 -0400 Received: from localhost (unknown [141.226.14.232]) by flashner.co.il (Postfix) with ESMTPSA id 800E640107; Tue, 24 May 2022 08:02:02 +0000 (UTC) From: Efraim Flashner To: guix-patches@gnu.org Subject: [PATCH] gnu: Add pbuilder. Date: Tue, 24 May 2022 10:59:18 +0300 Message-Id: X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Vagrant Cascadian , Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * gnu/packages/debian.scm (pbuilder): New variable. --- gnu/packages/debian.scm | 145 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) With this I was able to use `sudo -E pbuilder create` to create a new base chroot for building packages and I was able to download the source packages for hello to run `sudo -E pbuilder build ~/hello_2.10-2.dsc` to actually build a hello binary. For reproducing: (on Guix System, in ~/.pbuilderrc, as a minimum: PBUILDERROOTCMD="/run/setuid-programs/sudo -E") wget https://ftp.debian.org/debian/pool/main/h/hello/hello_2.10-2.debian.tar.xz wget https://ftp.debian.org/debian/pool/main/h/hello/hello_2.10-2.dsc wget https://ftp.debian.org/debian/pool/main/h/hello/hello_2.10.orig.tar.gz guix shell pbuilder -- sudo -E pbuilder create guix shell pbuilder -- sudo -E pbuilder build /path/to/hello_2.10-2.dsc --- diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm index 2efd8114be..737ff9b892 100644 --- a/gnu/packages/debian.scm +++ b/gnu/packages/debian.scm @@ -36,6 +36,8 @@ (define-module (gnu packages debian) #: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) @@ -417,6 +419,149 @@ (define-public dpkg 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 + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ; no configure script + (add-after 'unpack 'patch-source + (lambda* (#:key native-inputs 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 (or native-inputs 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\"~@ + 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-more 'wrap-programs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (for-each + (lambda (file) + (wrap-script file + `("PATH" ":" prefix + (,(dirname (search-input-file (or native-inputs inputs) "/bin/cut")) + ,(dirname (search-input-file (or native-inputs inputs) "/bin/dpkg")) + ,(dirname (search-input-file (or native-inputs inputs) "/bin/grep")) + ,(dirname (search-input-file (or native-inputs inputs) "/bin/perl")) + ,(dirname (search-input-file (or native-inputs inputs) "/bin/sed")) + ,(dirname (search-input-file (or native-inputs inputs) "/bin/which")) + ,(dirname (search-input-file (or native-inputs inputs) "/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 'wrap-programs '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 +NOTE: For Guix System it is recommended to put +@code{PBUILDERROOTCMD=\"/run/setuid-programs/sudo -E\"} inside of your +@file{~/.pbuilderrc}.") + (license license:gpl2+))) + (define-public reprepro (package (name "reprepro") base-commit: 1a1f9e7050a9b787b2111cb5af677510a0122e2b -- 2.36.1 From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 06:09:46 2022 Received: (at 55608) by debbugs.gnu.org; 24 May 2022 10:09:46 +0000 Received: from localhost ([127.0.0.1]:51093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntRU1-0002iH-TL for submit@debbugs.gnu.org; Tue, 24 May 2022 06:09:46 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:40348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntRTz-0002i7-8r for 55608@debbugs.gnu.org; Tue, 24 May 2022 06:09:44 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id aa9h2700i4UW6Th01a9hMb; Tue, 24 May 2022 12:09:41 +0200 Message-ID: <5f757b843a3ecc0c601adc87fcc5208ba3a415b5.camel@telenet.be> Subject: Re: [bug#55608] [PATCH] gnu: Add pbuilder. From: Maxime Devos To: Efraim Flashner , 55608@debbugs.gnu.org Date: Tue, 24 May 2022 12:09:36 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-IwDHaBjPjwGy0xmrql4R" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653386981; bh=5Lid5OQwTK+dZebP9f9KQaYWfQNU0VRdugFV5s9KUrk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=mNwlxYSxU9jnfJMTgXeT84x+S/q2m8+GJFgEgH4M+BOx/xzbIBVOdEviXIfrZOKHT GILCJCt93yHxApVkfpqFEgOk9loI57HKoNBecQzsocj7ViszrURUn9kqErXVFEOueF WaMiE85sY1a8Tng5dGLa5c1vTizzHQyTXl7QXQck1lLK9RmFVQwglImNwLMvC9JrIR fYtBusTOcTSQvYi0AEFrHBEQ6j6YioqrZBPBRQXNKzjf3Ey7WQVxBUNNmdE0wuerIX 3ih8ScH4fkxv2ed5YQ77FzIDuUJ+vA9P2XJ8qqtfENkju2hCpL14FxsjnIY5ukirR0 KJiWkGoc+ey5A== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55608 Cc: Vagrant Cascadian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbug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3V0IiAiL2Jpbi9kcGtnIiAuLi4pKSBb Li4uXQoKCg== --=-IwDHaBjPjwGy0xmrql4R Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYoyu4BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7r5aAP9QhYZ2FjOydZw4CzxawQf7pRA9 IyKbKR5AmsMFX80ARwEAuuKSoBVjf/JtRZbkX0rRGClOjTwGNXn+9jG3no3e4Qg= =fsDw -----END PGP SIGNATURE----- --=-IwDHaBjPjwGy0xmrql4R-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 25 04:43:59 2022 Received: (at 55608) by debbugs.gnu.org; 25 May 2022 08:43:59 +0000 Received: from localhost ([127.0.0.1]:54320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntmcZ-0007Bv-6a for submit@debbugs.gnu.org; Wed, 25 May 2022 04:43:59 -0400 Received: from flashner.co.il ([178.62.234.194]:40260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntmcX-0007Bj-UJ for 55608@debbugs.gnu.org; Wed, 25 May 2022 04:43:58 -0400 Received: from localhost (unknown [141.226.14.232]) by flashner.co.il (Postfix) with ESMTPSA id AE7E740085; Wed, 25 May 2022 08:43:51 +0000 (UTC) Date: Wed, 25 May 2022 11:41:52 +0300 From: Efraim Flashner To: Maxime Devos Subject: Re: [bug#55608] [PATCH v2] gnu: Add pbuilder. Message-ID: Mail-Followup-To: Efraim Flashner , Maxime Devos , 55608@debbugs.gnu.org, Vagrant Cascadian References: <5f757b843a3ecc0c601adc87fcc5208ba3a415b5.camel@telenet.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QYtl+2b0yVFiDHCM" Content-Disposition: inline In-Reply-To: <5f757b843a3ecc0c601adc87fcc5208ba3a415b5.camel@telenet.be> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55608 Cc: Vagrant Cascadian , 55608@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --QYtl+2b0yVFiDHCM Content-Type: multipart/mixed; boundary="yEwEFm28DgpXovpN" Content-Disposition: inline --yEwEFm28DgpXovpN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 24, 2022 at 12:09:36PM +0200, Maxime Devos wrote: > Efraim Flashner schreef op di 24-05-2022 om 10:59 [+0300]: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-afte= r 'install-more 'wrap-programs > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (for-each > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 (lambda (file) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (wrap-script file > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `("PATH" ":" prefix > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (,(dirname (searc= h-input-file (or native-inputs inputs) "/bin/cut")) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(dirname (= search-input-file (or native-inputs inputs) "/bin/dpkg")) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(dirname (= search-input-file (or native-inputs inputs) "/bin/grep")) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(dirname (= search-input-file (or native-inputs inputs) "/bin/perl")) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(dirname (= search-input-file (or native-inputs inputs) "/bin/sed")) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(dirname (= search-input-file (or native-inputs inputs) "/bin/which")) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(dirname (= search-input-file (or native-inputs inputs) "/sbin/debootstrap")))))) >=20 > Shouldn't these be inputs instead of native-inputs, because they will > end up being run when pbuilder is run? Likewise for'patch-source'. I figured using (or native-inputs inputs) would help with cross-building, but I've changed it to just inputs. Also in the other spot where I used that. I tried cross building it before but got stuck in one of the dependencies. > Also, can be simplified to >=20 > [...] "PATH" ":" prefix ,(map (compose dirname (cut search-input-file inp= uts <>)) '("/bin/cut" "/bin/dpkg" ...)) [...] Thanks, I knew there was some way to make it much cleaner. I've made the changes you've suggested and also adjusted #$output/etc/pbuilderrc to use /run/setuid-programs/sudo if it's available and removed the note from the bottom of the package description since it's no longer necessary. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --yEwEFm28DgpXovpN Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="v2-0001-gnu-Add-pbuilder.patch" Content-Transfer-Encoding: quoted-printable =46rom 2daaaacb03652c53891bc95306e6d5cc8a07ab90 Mon Sep 17 00:00:00 2001 Message-Id: <2daaaacb03652c53891bc95306e6d5cc8a07ab90.1653467875.git.efraim= @flashner.co.il> =46rom: Efraim Flashner Date: Tue, 24 May 2022 10:52:20 +0300 Subject: [PATCH v2] gnu: Add pbuilder. * gnu/packages/debian.scm (pbuilder): New variable. --- gnu/packages/debian.scm | 151 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 150 insertions(+), 1 deletion(-) diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm index 2efd8114be..05440d9444 100644 --- a/gnu/packages/debian.scm +++ b/gnu/packages/debian.scm @@ -36,10 +36,13 @@ (define-module (gnu packages debian) #: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)) =20 (define-public debian-archive-keyring (package @@ -417,6 +420,152 @@ (define-public dpkg handling the installation and removal of Debian software packages.") (license license:gpl2+))) =20 +(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 chr= oot. + (substitute* "pbuilderrc" + (("PATH=3D\"/usr/sbin:/usr/bin:/sbin:/bin") + "PATH=3D\"$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/pbuilder= rc") + (lambda () + (format #t "# A couple of presets to make this work mor= e smoothly.~@ + MIRRORSITE=3D\"http://deb.debian.org/debian\"~@ + if [ -r /run/setuid-programs/sudo ]; then~@ + PBUILDERROOTCMD=3D\"/run/setuid-programs/su= do -E\"~@ + fi~@ + PBUILDERSATISFYDEPENDSCMD=3D\"~a/lib/pbuilder/p= builder-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 "ma= n1")) + (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=3D" #$output) + (string-append "SYSCONFDIR=3D" #$output "/etc") + (string-append "BINDIR=3D" #$output "/bin") + (string-append "PKGLIBDIR=3D" #$output "/lib/pbuilder") + (string-append "SBINDIR=3D" #$output "/sbin") + (string-append "PKGDATADIR=3D" #$output "/share/pbuilder") + (string-append "EXAMPLEDIR=3D" #$output "/share/doc/pbuil= der/examples") + "PBUILDDDIR=3D/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 insi= de 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, o= r 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 i= n 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") base-commit: d129d962e437fd215c5e9428fc1b26e2d72ffbda --=20 2.36.1 --yEwEFm28DgpXovpN-- --QYtl+2b0yVFiDHCM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmKN688ACgkQQarn3Mo9 g1GFPg/9EBS3nvgM96ZC+WgOFlgnEORTXI2nkcpIE9ckHqcF4RS0dnvev9iQuR1u nRe7Y5fW4mHdtDTsmcXB3vIj5sOov/+ZnGBFJpiEdMMEPJF/QwVwZNyTj/TWQR2B 7/L9sy5YE/0MSCCJ8Wa+vL4o7WthkQoIKera3jrE3TBjPThSX3PNIKni9WpDaAgE xvgs46HWUkmuZXAXOTA/iN5cegf6ZmCwfd8Q/p+IYdnfvy9Ici8ojs7pUq1AkCkj XVwm0LsvyHt3/54AxqNriI4EnsTw9rn1yKHdWUoXk1BbTJsHYjZjTZ+WcXGhoSkB yH+83fgm9GHRTVwZg0YGOFEqIAsv8oBBr09cxoTJzWET8t2Hlg0FoKzp0yd81hac MCrG7WA9FDInZ0nhN8VQIhW0ZaNKFG1oV2swCa70GhF3cNNn8da21HBeU0DlsvbL MuN7WcALDOQuH/Ooff+2wqLJ5IspQPSmlmbbGXruQD7NHjC31xuNoxo3CljIUxxs R4sLjY5j8xqZjAyv3M3JmBpa15w+eV39ouHB4MytzVK7xcF0erRYdh6QdYL2uWom S1mdPXvr82cNbM3kXHXlpxVSY+f5wcfIe+cQX2MIjRuvl2MoaMkMRPhCZ2Of193+ kgMvfPu2kkkGGtyfOgIouaw06KuJN0F0x+UaHi1BdKtbTB9SYf4= =vu8H -----END PGP SIGNATURE----- --QYtl+2b0yVFiDHCM-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 29 09:04:30 2022 Received: (at 55608-done) by debbugs.gnu.org; 29 May 2022 13:04:30 +0000 Received: from localhost ([127.0.0.1]:39608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvIas-0000Iv-H4 for submit@debbugs.gnu.org; Sun, 29 May 2022 09:04:30 -0400 Received: from flashner.co.il ([178.62.234.194]:49376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvIan-0000Ic-IK for 55608-done@debbugs.gnu.org; Sun, 29 May 2022 09:04:29 -0400 Received: from localhost (unknown [141.226.14.232]) by flashner.co.il (Postfix) with ESMTPSA id AD003401AA for <55608-done@debbugs.gnu.org>; Sun, 29 May 2022 13:04:19 +0000 (UTC) Date: Sun, 29 May 2022 16:03:42 +0300 From: Efraim Flashner To: 55608-done@debbugs.gnu.org Subject: Re: [bug#55608] [PATCH v2] gnu: Add pbuilder. Message-ID: Mail-Followup-To: Efraim Flashner , 55608-done@debbugs.gnu.org References: <5f757b843a3ecc0c601adc87fcc5208ba3a415b5.camel@telenet.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zTCSzD4fAga5aL9M" Content-Disposition: inline In-Reply-To: X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55608-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --zTCSzD4fAga5aL9M Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Patch pushed. Thanks for the review! --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --zTCSzD4fAga5aL9M Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmKTby4ACgkQQarn3Mo9 g1Ed6RAAn2+nbETp/fvMWGGLcCj6HOz/JPMDWVwLHVPl52WVnqBYgcGFqgIT4Olm GQxPZM+HNBGmndO12MMxq0hie6K2OgeV8kLxRpnjIUajalnLZucg2xl2fQSYSOZC Fb683U7G0ocBX/E1aZxAjoug5tXtkkFasJ8hSoMNJKvfJJH0Lb1bcd7ewB+Vv7ei UvX/TtiPs/qKIZlWegz7wQERX7/yE0UAu1YDHKGYCu8ubkh2eOoStpmnAGfM83FK OzTaEji59NwGB2/4AAQWWu4U30waimH5i3zspaN+H66sn1bneHDAX+BmRdt7D3z4 UWMmhEZOcD7C4DELkPBIIgLCcYtpeOde8RAu/KJPYvt6C/aRWWzdKDCqYzXYsJz4 5IZMTAKroAv8S9zK6hKwMIHnu0y0Ox7EhprDEWeOYKyJ2ToHxoRt3z3Nq7vgCLPT Gs6Q81VVPTb+3jZPDnW8zKVl1JzJ4JqYLz0ehKeWTJT5FuM/8Q86rfU1fKvMthqz 6M1thXDHcO8W/H5nvVzXE8FTcduPIuYk6ajuKu2+EKvmpeCMeOrgeqULI9Vu7U0+ OntDwqzQA9CvYPzz6gT12qBDz/V3F0JprO7l16yPhedCEl2l+jtf3SIsHVes1Wae fAkbyDCH7jD+rKJx84yUdOUCbqizkZtkVgp9TGdWHsBocxt3U4w= =0LC9 -----END PGP SIGNATURE----- --zTCSzD4fAga5aL9M-- From unknown Fri Aug 15 02:01:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 27 Jun 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator