Skip to content
Snippets Groups Projects
Unverified Commit 7111ea0d authored by Efraim Flashner's avatar Efraim Flashner
Browse files

gnu: debootstrap: Update build.

* gnu/packages/debian.scm (debootstrap)[arguments]: Update the
substitutes during the custom 'patch-source phase. Add custom
'wrap-executable phase.
[inputs]: Remove coreutils, wget. Add tzdata.
[propagated-inputs]: Remove binutils, gnupg. Move perl ...
[native-inputs]: ... to here.
[description]: Add implementation hint.
parent 454e7132
No related branches found
No related tags found
No related merge requests found
...@@ -27,8 +27,7 @@ (define-module (gnu packages debian) ...@@ -27,8 +27,7 @@ (define-module (gnu packages debian)
#:use-module (gnu packages base) #:use-module (gnu packages base)
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages gnupg) #:use-module (gnu packages gnupg)
#:use-module (gnu packages perl) #:use-module (gnu packages perl))
#:use-module (gnu packages wget))
(define-public debian-archive-keyring (define-public debian-archive-keyring
(package (package
...@@ -137,46 +136,57 @@ (define-public debootstrap ...@@ -137,46 +136,57 @@ (define-public debootstrap
(add-after 'unpack 'patch-source (add-after 'unpack 'patch-source
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")) (let ((out (assoc-ref outputs "out"))
(coreutils (assoc-ref inputs "coreutils")) (tzdata (assoc-ref inputs "tzdata"))
(wget (assoc-ref inputs "wget"))
(debian (assoc-ref inputs "debian-keyring")) (debian (assoc-ref inputs "debian-keyring"))
(ubuntu (assoc-ref inputs "ubuntu-keyring"))) (ubuntu (assoc-ref inputs "ubuntu-keyring")))
(substitute* "Makefile" (substitute* "Makefile"
(("/usr") "") (("/usr") "")
(("-o root -g root") "") (("-o root -g root") "")
(("chown root.*") "\n")) (("chown root.*") "\n"))
(substitute* "scripts/sid" (substitute* '("scripts/etch"
"scripts/potato"
"scripts/sarge"
"scripts/sid"
"scripts/woody"
"scripts/woody.buildd")
(("/usr") debian)) (("/usr") debian))
(substitute* "scripts/gutsy" (substitute* "scripts/gutsy"
(("/usr") ubuntu)) (("/usr") ubuntu))
(substitute* "debootstrap" (substitute* "debootstrap"
(("chroot ") (string-append coreutils "/bin/chroot "))
(("=/usr") (string-append "=" out))) (("=/usr") (string-append "=" out)))
(substitute* "functions" (substitute* (find-files "scripts" ".")
(("wget ") (string-append wget "/bin/wget "))) (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo")))
#t))) #t)))
(add-after 'install 'install-man-file (add-after 'install 'install-man-file
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(install-file "debootstrap.8" (install-file "debootstrap.8"
(string-append out "/share/man/man8")) (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)))) #t))))
#:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))) #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
#:tests? #f)) ; no tests #:tests? #f)) ; no tests
(inputs (inputs
`(("coreutils" ,coreutils) `(("debian-keyring" ,debian-archive-keyring)
("debian-keyring" ,debian-archive-keyring)
("ubuntu-keyring" ,ubuntu-keyring) ("ubuntu-keyring" ,ubuntu-keyring)
("wget" ,wget))) ("tzdata" ,tzdata)))
;; The following are required for debootstrap to work correctly (native-inputs
(propagated-inputs `(("perl" ,perl)))
`(("binutils" ,binutils)
("gnupg" ,gnupg)
("perl" ,perl)))
(home-page "https://tracker.debian.org/pkg/debootstrap") (home-page "https://tracker.debian.org/pkg/debootstrap")
(synopsis "Bootstrap a basic Debian system") (synopsis "Bootstrap a basic Debian system")
(description "Debootstrap is used to create a Debian base system from (description "Debootstrap is used to create a Debian base system from
scratch, without requiring the availability of @code{dpkg} or @code{apt}. scratch, without requiring the availability of @code{dpkg} or @code{apt}.
It does this by downloading .deb files from a mirror site, and carefully It does this by downloading .deb files from a mirror site, and carefully
unpacking them into a directory which can eventually be chrooted into.") unpacking them into a directory which can eventually be chrooted into.
It is recommended to run @code{debootstrap --foreign --arch=...} and then
@code{chroot} into the directory, set the PATH and run @code{debootstrap
--second-stage} after.")
(license license:gpl2))) (license license:gpl2)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment