mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: containerd: Switch to gexp arguments.
* gnu/packages/docker.scm (containerd)[arguments]: Rewrite as gexps. Pass all flags via make-flags variable. Switch to using search-input-file. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
parent
f3a16cab5a
commit
c37d970f4d
1 changed files with 49 additions and 46 deletions
|
@ -29,6 +29,7 @@
|
||||||
#:use-module (gnu packages)
|
#:use-module (gnu packages)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
|
#:use-module (guix gexp)
|
||||||
#:use-module (guix git-download)
|
#:use-module (guix git-download)
|
||||||
#:use-module (guix build-system cmake)
|
#:use-module (guix build-system cmake)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
|
@ -186,19 +187,22 @@ Python without keeping their credentials in a Docker configuration file.")
|
||||||
(base32 "1vsl747i3wyy68j4lp4nprwxadbyga8qxlrk892afcd2990zp5mr"))))
|
(base32 "1vsl747i3wyy68j4lp4nprwxadbyga8qxlrk892afcd2990zp5mr"))))
|
||||||
(build-system go-build-system)
|
(build-system go-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(let ((make-flags (list (string-append "VERSION=" version)
|
(let ((make-flags #~(list (string-append "VERSION=" #$version)
|
||||||
|
(string-append "DESTDIR=" #$output)
|
||||||
|
"PREFIX="
|
||||||
"REVISION=0")))
|
"REVISION=0")))
|
||||||
`(#:import-path "github.com/containerd/containerd"
|
(list
|
||||||
|
#:import-path "github.com/containerd/containerd"
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'patch-paths
|
(add-after 'unpack 'patch-paths
|
||||||
(lambda* (#:key inputs import-path outputs #:allow-other-keys)
|
(lambda* (#:key inputs import-path outputs #:allow-other-keys)
|
||||||
(with-directory-excursion (string-append "src/" import-path)
|
(with-directory-excursion (string-append "src/" import-path)
|
||||||
(substitute* "runtime/v1/linux/runtime.go"
|
(substitute* "runtime/v1/linux/runtime.go"
|
||||||
(("defaultRuntime[ \t]*=.*")
|
(("defaultRuntime[ \t]*=.*")
|
||||||
(string-append "defaultRuntime = \""
|
(string-append "defaultRuntime = \""
|
||||||
(assoc-ref inputs "runc")
|
(search-input-file inputs "/sbin/runc")
|
||||||
"/sbin/runc\"\n"))
|
"\"\n"))
|
||||||
(("defaultShim[ \t]*=.*")
|
(("defaultShim[ \t]*=.*")
|
||||||
(string-append "defaultShim = \""
|
(string-append "defaultShim = \""
|
||||||
(assoc-ref outputs "out")
|
(assoc-ref outputs "out")
|
||||||
|
@ -206,33 +210,32 @@ Python without keeping their credentials in a Docker configuration file.")
|
||||||
(substitute* "pkg/cri/config/config_unix.go"
|
(substitute* "pkg/cri/config/config_unix.go"
|
||||||
(("DefaultRuntimeName: \"runc\"")
|
(("DefaultRuntimeName: \"runc\"")
|
||||||
(string-append "DefaultRuntimeName: \""
|
(string-append "DefaultRuntimeName: \""
|
||||||
(assoc-ref inputs "runc")
|
(search-input-file inputs "/sbin/runc")
|
||||||
"/sbin/runc\"")))
|
"\"")))
|
||||||
(substitute* "vendor/github.com/containerd/go-runc/runc.go"
|
(substitute* "vendor/github.com/containerd/go-runc/runc.go"
|
||||||
(("DefaultCommand[ \t]*=.*")
|
(("DefaultCommand[ \t]*=.*")
|
||||||
(string-append "DefaultCommand = \""
|
(string-append "DefaultCommand = \""
|
||||||
(assoc-ref inputs "runc")
|
(search-input-file inputs "/sbin/runc")
|
||||||
"/sbin/runc\"\n")))
|
"\"\n")))
|
||||||
(substitute* "vendor/github.com/containerd/continuity/testutil\
|
(substitute* "vendor/github.com/containerd/continuity/testutil\
|
||||||
/loopback/loopback_linux.go"
|
/loopback/loopback_linux.go"
|
||||||
(("exec\\.Command\\(\"losetup\"")
|
(("exec\\.Command\\(\"losetup\"")
|
||||||
(string-append "exec.Command(\""
|
(string-append "exec.Command(\""
|
||||||
(assoc-ref inputs "util-linux")
|
(search-input-file inputs "/sbin/losetup")
|
||||||
"/sbin/losetup\"")))
|
"\"")))
|
||||||
(substitute* "archive/compression/compression.go"
|
(substitute* "archive/compression/compression.go"
|
||||||
(("exec\\.LookPath\\(\"unpigz\"\\)")
|
(("exec\\.LookPath\\(\"unpigz\"\\)")
|
||||||
(string-append "\"" (assoc-ref inputs "pigz")
|
(string-append "\""
|
||||||
"/bin/unpigz\", error(nil)"))))))
|
(search-input-file inputs "/bin/unpigz")
|
||||||
|
"\", error(nil)"))))))
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(lambda* (#:key import-path #:allow-other-keys)
|
(lambda* (#:key import-path #:allow-other-keys)
|
||||||
(with-directory-excursion (string-append "src/" import-path)
|
(with-directory-excursion (string-append "src/" import-path)
|
||||||
(apply invoke "make" ',make-flags))))
|
(apply invoke "make" #$make-flags))))
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key import-path outputs #:allow-other-keys)
|
(lambda* (#:key import-path #:allow-other-keys)
|
||||||
(with-directory-excursion (string-append "src/" import-path)
|
(with-directory-excursion (string-append "src/" import-path)
|
||||||
(let* ((out (assoc-ref outputs "out")))
|
(apply invoke "make" "install" #$make-flags))))))))
|
||||||
(apply invoke "make" (string-append "DESTDIR=" out)
|
|
||||||
"PREFIX=" "install" ',make-flags)))))))))
|
|
||||||
(inputs
|
(inputs
|
||||||
(list btrfs-progs libseccomp pigz runc util-linux))
|
(list btrfs-progs libseccomp pigz runc util-linux))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue