guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/05: gnu: debootstrap: Rewrite using new style.


From: guix-commits
Subject: 04/05: gnu: debootstrap: Rewrite using new style.
Date: Mon, 23 May 2022 15:04:50 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit d660d3f337e77850d40c0ee84930e3ee4c847017
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Mon May 23 18:18:46 2022 +0300

    gnu: debootstrap: Rewrite using new style.
    
    * gnu/packages/debian.scm (debootstrap)[arguments]: Rewrite using g-exps.
    [inputs]: Remove input labels.
---
 gnu/packages/debian.scm | 104 ++++++++++++++++++++++++------------------------
 1 file changed, 51 insertions(+), 53 deletions(-)

diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm
index 22f51d2db6..615367baa3 100644
--- a/gnu/packages/debian.scm
+++ b/gnu/packages/debian.scm
@@ -22,6 +22,7 @@
   #: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)
@@ -201,62 +202,59 @@ 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"))
-                   (dpkg   (assoc-ref inputs "dpkg"))
-                   (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))
-                 (("/usr/bin/dpkg") (string-append dpkg "/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") (string-append tzdata 
"/share/zoneinfo"))))))
-         (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")))))
-         (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)))))))
-       #: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)
-       ("dpkg" ,dpkg)
-       ("tzdata" ,tzdata)
+     (list debian-archive-keyring
+           ubuntu-keyring
+           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";)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]