summaryrefslogtreecommitdiff
path: root/gnu/packages/debian.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-05-23 18:18:46 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-05-23 21:59:49 +0300
commitd660d3f337e77850d40c0ee84930e3ee4c847017 (patch)
treeead72a3e3d14656a7ece4dd227ec04c8b2c229ae /gnu/packages/debian.scm
parent83fd96ed389801baa16d6e995499d86ef34f87d5 (diff)
gnu: debootstrap: Rewrite using new style.
* gnu/packages/debian.scm (debootstrap)[arguments]: Rewrite using g-exps. [inputs]: Remove input labels.
Diffstat (limited to 'gnu/packages/debian.scm')
-rw-r--r--gnu/packages/debian.scm104
1 files changed, 51 insertions, 53 deletions
diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm
index 22f51d2db6b..615367baa3d 100644
--- a/gnu/packages/debian.scm
+++ b/gnu/packages/debian.scm
@@ -22,6 +22,7 @@
22 #:use-module ((guix licenses) #:prefix license:) 22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download) 23 #:use-module (guix download)
24 #:use-module (guix git-download) 24 #:use-module (guix git-download)
25 #:use-module (guix gexp)
25 #:use-module (guix packages) 26 #:use-module (guix packages)
26 #:use-module (guix build-system gnu) 27 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system trivial) 28 #:use-module (guix build-system trivial)
@@ -201,62 +202,59 @@ contains the archive keys used for that.")
201 (base32 "0hfx6k86kby4xf0xqskpllq00g159j4khh66hfi6dhcdb91dgyd7")))) 202 (base32 "0hfx6k86kby4xf0xqskpllq00g159j4khh66hfi6dhcdb91dgyd7"))))
202 (build-system gnu-build-system) 203 (build-system gnu-build-system)
203 (arguments 204 (arguments
204 `(#:phases 205 (list
205 (modify-phases %standard-phases 206 #:phases
206 (delete 'configure) 207 #~(modify-phases %standard-phases
207 (add-after 'unpack 'patch-source 208 (delete 'configure)
208 (lambda* (#:key inputs outputs #:allow-other-keys) 209 (add-after 'unpack 'patch-source
209 (let ((out (assoc-ref outputs "out")) 210 (lambda* (#:key inputs outputs #:allow-other-keys)
210 (tzdata (assoc-ref inputs "tzdata")) 211 (let ((debian #$(this-package-input "debian-archive-keyring"))
211 (dpkg (assoc-ref inputs "dpkg")) 212 (ubuntu #$(this-package-input "ubuntu-keyring")))
212 (debian (assoc-ref inputs "debian-keyring")) 213 (substitute* "Makefile"
213 (ubuntu (assoc-ref inputs "ubuntu-keyring"))) 214 (("/usr") "")
214 (substitute* "Makefile" 215 (("-o root -g root") "")
215 (("/usr") "") 216 (("chown root.*") "\n"))
216 (("-o root -g root") "") 217 (substitute* '("scripts/etch"
217 (("chown root.*") "\n")) 218 "scripts/potato"
218 (substitute* '("scripts/etch" 219 "scripts/sarge"
219 "scripts/potato" 220 "scripts/sid"
220 "scripts/sarge" 221 "scripts/woody"
221 "scripts/sid" 222 "scripts/woody.buildd")
222 "scripts/woody" 223 (("/usr") debian))
223 "scripts/woody.buildd") 224 (substitute* "scripts/gutsy"
224 (("/usr") debian)) 225 (("/usr") ubuntu))
225 (substitute* "scripts/gutsy" 226 (substitute* "debootstrap"
226 (("/usr") ubuntu)) 227 (("=/usr") (string-append "=" #$output))
227 (substitute* "debootstrap" 228 (("/usr/bin/dpkg") (search-input-file inputs "/bin/dpkg")))
228 (("=/usr") (string-append "=" out)) 229 ;; Ensure PATH works both in guix and within the debian chroot
229 (("/usr/bin/dpkg") (string-append dpkg "/bin/dpkg"))) 230 ;; workaround for: https://bugs.debian.org/929889
230 ;; Ensure PATH works both in guix and within the debian chroot 231 (substitute* "functions"
231 ;; workaround for: https://bugs.debian.org/929889 232 (("PATH=/sbin:/usr/sbin:/bin:/usr/bin")
232 (substitute* "functions" 233 "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin"))
233 (("PATH=/sbin:/usr/sbin:/bin:/usr/bin") 234 (substitute* (find-files "scripts")
234 "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin")) 235 (("/usr/share/zoneinfo")
235 (substitute* (find-files "scripts" ".") 236 (search-input-directory inputs "/share/zoneinfo"))))))
236 (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo")))))) 237 (add-after 'install 'install-man-file
237 (add-after 'install 'install-man-file 238 (lambda* (#:key outputs #:allow-other-keys)
238 (lambda* (#:key outputs #:allow-other-keys)
239 (let ((out (assoc-ref outputs "out")))
240 (install-file "debootstrap.8" 239 (install-file "debootstrap.8"
241 (string-append out "/share/man/man8"))))) 240 (string-append #$output "/share/man/man8"))))
242 (add-after 'install 'wrap-executable 241 (add-after 'install 'wrap-executable
243 (lambda* (#:key outputs #:allow-other-keys) 242 (lambda* (#:key outputs #:allow-other-keys)
244 (let ((debootstrap (string-append (assoc-ref outputs "out") 243 (let ((debootstrap (string-append #$output "/sbin/debootstrap"))
245 "/sbin/debootstrap")) 244 (path (getenv "PATH")))
246 (path (getenv "PATH"))) 245 (wrap-program debootstrap
247 (wrap-program debootstrap 246 `("PATH" ":" prefix (,path)))))))
248 `("PATH" ":" prefix (,path))))))) 247 #:make-flags #~(list (string-append "DESTDIR=" #$output))
249 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))) 248 #:tests? #f)) ; no tests
250 #:tests? #f)) ; no tests
251 (inputs 249 (inputs
252 `(("debian-keyring" ,debian-archive-keyring) 250 (list debian-archive-keyring
253 ("ubuntu-keyring" ,ubuntu-keyring) 251 ubuntu-keyring
254 ("dpkg" ,dpkg) 252 dpkg
255 ("tzdata" ,tzdata) 253 tzdata
256 254
257 ;; Called at run-time from various places, needs to be in PATH. 255 ;; Called at run-time from various places, needs to be in PATH.
258 ("gnupg" ,gnupg) 256 gnupg
259 ("wget" ,wget))) 257 wget))
260 (native-inputs 258 (native-inputs
261 (list perl)) 259 (list perl))
262 (home-page "https://tracker.debian.org/pkg/debootstrap") 260 (home-page "https://tracker.debian.org/pkg/debootstrap")