unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre Langlois <pierre.langlois@gmx.com>
To: 52790@debbugs.gnu.org
Cc: Pierre Langlois <pierre.langlois@gmx.com>
Subject: [bug#52790] [PATCH v3 4/7] gnu: containerd: Switch to gexp arguments.
Date: Tue, 10 May 2022 00:35:16 +0100	[thread overview]
Message-ID: <20220509233519.26703-4-pierre.langlois@gmx.com> (raw)
In-Reply-To: <20220509233519.26703-1-pierre.langlois@gmx.com>

* gnu/packages/docker.scm (containerd)[arguments]: Rewrite as gexps.
Pass all flags via make-flags variable.  Switch to using
search-input-file.
---
 gnu/packages/docker.scm | 95 +++++++++++++++++++++--------------------
 1 file changed, 49 insertions(+), 46 deletions(-)

diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm
index e95614cfae..aa5f4d523b 100644
--- a/gnu/packages/docker.scm
+++ b/gnu/packages/docker.scm
@@ -29,6 +29,7 @@ (define-module (gnu packages docker)
   #:use-module (gnu packages)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
@@ -186,53 +187,55 @@ (define-public containerd
         (base32 "1hy5jaf5x8lffh3p4hdkk6ar8i4w84i0b539k1h5baqx9gnq2l2s"))))
     (build-system go-build-system)
     (arguments
-     (let ((make-flags (list (string-append "VERSION=" version)
-                             "REVISION=0")))
-       `(#:import-path "github.com/containerd/containerd"
-         #:phases
-         (modify-phases %standard-phases
-           (add-after 'unpack 'patch-paths
-             (lambda* (#:key inputs import-path outputs #:allow-other-keys)
-               (with-directory-excursion (string-append "src/" import-path)
-                 (substitute* "runtime/v1/linux/runtime.go"
-                   (("defaultRuntime[ \t]*=.*")
-                    (string-append "defaultRuntime = \""
-                                   (assoc-ref inputs "runc")
-                                   "/sbin/runc\"\n"))
-                   (("defaultShim[ \t]*=.*")
-                    (string-append "defaultShim = \""
-                                   (assoc-ref outputs "out")
-                                   "/bin/containerd-shim\"\n")))
-                 (substitute* "pkg/cri/config/config_unix.go"
-                   (("DefaultRuntimeName: \"runc\"")
-                    (string-append "DefaultRuntimeName: \""
-                                   (assoc-ref inputs "runc")
-                                   "/sbin/runc\"")))
-                 (substitute* "vendor/github.com/containerd/go-runc/runc.go"
-                   (("DefaultCommand[ \t]*=.*")
-                    (string-append "DefaultCommand = \""
-                                   (assoc-ref inputs "runc")
-                                   "/sbin/runc\"\n")))
-                 (substitute* "vendor/github.com/containerd/continuity/testutil\
+     (let ((make-flags #~(list (string-append "VERSION=" #$version)
+                               (string-append "DESTDIR=" #$output)
+                               "PREFIX="
+                               "REVISION=0")))
+       (list
+        #:import-path "github.com/containerd/containerd"
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'patch-paths
+              (lambda* (#:key inputs import-path outputs #:allow-other-keys)
+                (with-directory-excursion (string-append "src/" import-path)
+                  (substitute* "runtime/v1/linux/runtime.go"
+                    (("defaultRuntime[ \t]*=.*")
+                     (string-append "defaultRuntime = \""
+                                    (search-input-file inputs "/sbin/runc")
+                                    "\"\n"))
+                    (("defaultShim[ \t]*=.*")
+                     (string-append "defaultShim = \""
+                                    (assoc-ref outputs "out")
+                                    "/bin/containerd-shim\"\n")))
+                  (substitute* "pkg/cri/config/config_unix.go"
+                    (("DefaultRuntimeName: \"runc\"")
+                     (string-append "DefaultRuntimeName: \""
+                                    (search-input-file inputs "/sbin/runc")
+                                    "\"")))
+                  (substitute* "vendor/github.com/containerd/go-runc/runc.go"
+                    (("DefaultCommand[ \t]*=.*")
+                     (string-append "DefaultCommand = \""
+                                    (search-input-file inputs "/sbin/runc")
+                                    "\"\n")))
+                  (substitute* "vendor/github.com/containerd/continuity/testutil\
 /loopback/loopback_linux.go"
-                   (("exec\\.Command\\(\"losetup\"")
-                    (string-append "exec.Command(\""
-                                   (assoc-ref inputs "util-linux")
-                                   "/sbin/losetup\"")))
-                 (substitute* "archive/compression/compression.go"
-                   (("exec\\.LookPath\\(\"unpigz\"\\)")
-                    (string-append "\"" (assoc-ref inputs "pigz")
-                                   "/bin/unpigz\", error(nil)"))))))
-           (replace 'build
-             (lambda* (#:key import-path #:allow-other-keys)
-               (with-directory-excursion (string-append "src/" import-path)
-                 (apply invoke "make" ',make-flags))))
-           (replace 'install
-             (lambda* (#:key import-path outputs #:allow-other-keys)
-               (with-directory-excursion (string-append "src/" import-path)
-                 (let* ((out (assoc-ref outputs "out")))
-                   (apply invoke "make" (string-append "DESTDIR=" out)
-                          "PREFIX=" "install" ',make-flags)))))))))
+                    (("exec\\.Command\\(\"losetup\"")
+                     (string-append "exec.Command(\""
+                                    (search-input-file inputs "/sbin/losetup")
+                                    "\"")))
+                  (substitute* "archive/compression/compression.go"
+                    (("exec\\.LookPath\\(\"unpigz\"\\)")
+                     (string-append "\""
+                                    (search-input-file inputs "/bin/unpigz")
+                                    "\", error(nil)"))))))
+            (replace 'build
+              (lambda* (#:key import-path #:allow-other-keys)
+                (with-directory-excursion (string-append "src/" import-path)
+                  (apply invoke "make" #$make-flags))))
+            (replace 'install
+              (lambda* (#:key import-path #:allow-other-keys)
+                (with-directory-excursion (string-append "src/" import-path)
+                  (apply invoke "make" "install" #$make-flags))))))))
     (inputs
      (list btrfs-progs libseccomp pigz runc util-linux))
     (native-inputs
--
2.36.0





  parent reply	other threads:[~2022-05-09 23:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-25 14:17 [bug#52790] [PATCH 0/4] Update docker to 20.10.11 Pierre Langlois
2021-12-25 14:40 ` [bug#52790] [PATCH 1/4] gnu: containerd: Fix patch-paths build phase Pierre Langlois
2021-12-25 14:40   ` [bug#52790] [PATCH 2/4] gnu: containerd: Update to 1.5.8 Pierre Langlois
2021-12-25 14:40   ` [bug#52790] [PATCH 3/4] gnu: runc: Update to 1.0.3 Pierre Langlois
2021-12-25 14:40   ` [bug#52790] [PATCH 4/4] gnu: docker: Update to 20.10.11 Pierre Langlois
2021-12-26 11:37 ` [bug#52790] [PATCH 0/4] Update docker " Mathieu Othacehe
2021-12-27 16:42   ` Pierre Langlois
2022-04-01  0:46 ` [bug#52790] [PATCH v2 0/7] Update docker to 20.10.14 Pierre Langlois
2022-04-01  0:46   ` [bug#52790] [PATCH v2 1/7] gnu: runc: Update to 1.1.0 Pierre Langlois
2022-04-01  0:46   ` [bug#52790] [PATCH v2 2/7] gnu: containerd: Fix patch-paths build phase Pierre Langlois
2022-04-01  0:46   ` [bug#52790] [PATCH v2 3/7] gnu: containerd: Update to 1.6.2 Pierre Langlois
2022-04-01  0:46   ` [bug#52790] [PATCH v2 4/7] gnu: containerd: Switch to gexp arguments Pierre Langlois
2022-04-01  0:46   ` [bug#52790] [PATCH v2 5/7] gnu: docker: Fix mkfs.xfs reference Pierre Langlois
2022-04-01  0:46   ` [bug#52790] [PATCH v2 6/7] gnu: docker: Update to 20.10.14 Pierre Langlois
2022-04-01  1:11     ` Pierre Langlois
2022-04-01  0:46   ` [bug#52790] [PATCH v2 7/7] gnu: docker: Switch to gexp and new input style Pierre Langlois
2022-05-09 23:27   ` [bug#52790] [PATCH v3 0/7] Update docker to 20.10.15 Pierre Langlois
2022-05-09 23:35     ` [bug#52790] [PATCH v3 1/7] gnu: runc: Update to 1.1.1 Pierre Langlois
2022-05-09 23:35       ` [bug#52790] [PATCH v3 2/7] gnu: containerd: Fix patch-paths build phase Pierre Langlois
2022-05-09 23:35       ` [bug#52790] [PATCH v3 3/7] gnu: containerd: Update to 1.6.4 Pierre Langlois
2022-05-09 23:35       ` Pierre Langlois [this message]
2022-05-09 23:35       ` [bug#52790] [PATCH v3 5/7] gnu: docker: Fix mkfs.xfs reference Pierre Langlois
2022-05-10 10:06         ` Danny Milosavljevic
2022-05-09 23:35       ` [bug#52790] [PATCH v3 6/7] gnu: docker: Update to 20.10.15 Pierre Langlois
2022-05-10 10:11         ` Danny Milosavljevic
2022-05-14 16:01           ` Pierre Langlois
2022-05-17 20:28             ` Danny Milosavljevic
2022-05-09 23:35       ` [bug#52790] [PATCH v3 7/7] gnu: docker: Switch to gexp and new input style Pierre Langlois
2022-06-24  5:05         ` bug#52790: [PATCH 0/4] Update docker to 20.10.11 Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220509233519.26703-4-pierre.langlois@gmx.com \
    --to=pierre.langlois@gmx.com \
    --cc=52790@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).