From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +DUBA43sjWLe2AAAbAwnHQ (envelope-from ) for ; Wed, 25 May 2022 10:45:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MMweA43sjWKwRgAA9RJhRA (envelope-from ) for ; Wed, 25 May 2022 10:45:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2AEB8AB10 for ; Wed, 25 May 2022 10:45:00 +0200 (CEST) Received: from localhost ([::1]:58232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntmdX-0007TS-Ap for larch@yhetil.org; Wed, 25 May 2022 04:44:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntmcc-0006wm-9q for guix-patches@gnu.org; Wed, 25 May 2022 04:44:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60423) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntmcc-0008T3-0Z for guix-patches@gnu.org; Wed, 25 May 2022 04:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ntmcb-0007CJ-RT for guix-patches@gnu.org; Wed, 25 May 2022 04:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55608] [PATCH v2] gnu: Add pbuilder. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 25 May 2022 08:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55608 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Vagrant Cascadian , 55608@debbugs.gnu.org Received: via spool by 55608-submit@debbugs.gnu.org id=B55608.165346823927652 (code B ref 55608); Wed, 25 May 2022 08:44:01 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653468300; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=6XUOIimW2AJLe1d7a+tNk7eSemRf8PvpZrdZAbZ4qns=; b=Eu+DqG5VM4qU2iqCC0+5vSZD8OJmWJx6uxLlpbEI5dDh0O8REwWiiJb9ReFDfFcNQzYqcE Eb2GyTWRgcfzpDcLNOICES3qaneNenUzlMNqRIvSpFcfRz3nlcxSAVesT8tU2/dD97gMOm SrcyN+KE9gY8Xy52g1Wfu1KkGFzXkC8Lc/xZYvx1Llh9z97XvznRb0hbtWdC5iNhUex2jW Y4imyhp1eeRIyfFGlqeYK4QmtqNAWXwA3p6XcMYFdM8WfTV8CjUUGtFN/YADEQANDM25tc rcpaEvhQWX0Q82akHCfuhXv4do1913t09LVrBAj9xblXoIMH5nsVGrjL/WB2Pw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653468300; a=rsa-sha256; cv=none; b=OYvBtuU3XD76ZDZYnwWwdUrT446AvuYyTjJPrb0Ny5Ktg7gD/pmFMkJ1g3s5Sl5ka4Wmm8 FFaXaaevvNNpwNKQc91g9EkAA5ldjWGhY93joENWC1NrM7zNYxFGyOeS8Q9U8oCdGH8ER4 fa/1geke2IP9INKerTkhCPIErIhNXf+zqz9b/8FPvX4p3Pp9FaMdTMfAe+y/5Zj8NSZHZL +Wcx5bapCt2Gb21CW+o0WmNBOgFmZzBDqAA5KAy0uLiN2ucxIs1Yr7oji8fqhvK8T58rsr 9HaPI8BmiNUgpf62h5v7Sl3p4Ie9mLODJ49xxny36+tTXxSx8Oy6ebwlgmwSfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.14 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2AEB8AB10 X-Spam-Score: -5.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: AUpwryCrrvEt --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--