Merge branch 'devel' into 'main'

Devel

See merge request glicid-public/guix-glicid!207
This commit is contained in:
Jean-François GUILLAUME 2023-02-08 20:20:11 +00:00
commit 40ca7ebef2

View file

@ -1,172 +1,76 @@
(define-module (glicid packages containers) (define-module (glicid packages containers)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix packages) #:use-module (guix git-download)
#:use-module (guix gexp) #:use-module (guix packages)
#:use-module ((guix licenses) #:use-module (guix gexp)
#:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module ((gnu packages containers) #:use-module ((gnu packages containers) #:prefix gnu:)
#:prefix gnu:) #:use-module (gnu packages linux)
#:use-module (gnu packages linux) #:use-module (gnu packages gnupg)
#:use-module (gnu packages gnupg) #:use-module (gnu packages golang)
#:use-module (gnu packages golang) #:use-module (gnu packages selinux)
#:use-module (gnu packages selinux) #:use-module (gnu packages bash)
#:use-module (gnu packages bash) #:use-module (gnu packages python)
#:use-module (gnu packages version-control) #:use-module (gnu packages version-control)
#:use-module (gnu packages pkg-config) #:use-module (gnu packages pkg-config)
#:use-module (guix utils) #:use-module (guix utils)
#:use-module (guix build-system gnu)) #:use-module (guix build-system gnu))
(define-public podman (define-public podman
(package (package
(name "podman") (name "podman")
(version "4.3.1") (version "4.4.0")
(source (origin (source
(method url-fetch) (origin
(uri (list (string-append (method git-fetch)
"https://github.com/containers/podman/archive/refs/tags/v" (uri (git-reference
version ".tar.gz"))) (url "https://github.com/containers/podman")
(sha256 (commit (string-append "v" version))))
(base32 (sha256 (base32 "0v1zcb2v7b8k2aw30bws1ir94daw1llc4gfx3rfja25vqhvqw9wk"))
"04w8lwybsxix4ms6gnsj2xp4xkm567fj0vnlwmjn7kbqxv22jp25")))) (modules '((guix build utils)))
(home-page "https://podman.io") (snippet '(begin
(synopsis "Manage containers, images, pods, and their volumes") (substitute* "Makefile" ((".*hack/btrfs.*") ""))
(description ; we build without doc
"Podman (the POD MANager) is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers.") (substitute* "Makefile" (("all: binaries docs") "all: binaries"))
(license license:asl2.0) (substitute* "Makefile" (("install: install.bin install.remote install.man install.systemd") "install: install.bin install.remote install.systemd"))))))
(inputs (list btrfs-progs (build-system gnu-build-system)
gnu:cni-plugins (arguments
gnu:conmon (list
gnu:crun #:make-flags
gpgme #~(list #$(string-append "CC=" (cc-for-target))
go-github-com-go-md2man (string-append "PREFIX=" #$output))
iptables #:tests? #f
libassuan #:test-target "test"
libseccomp #:phases
libselinux #~(modify-phases %standard-phases
gnu:slirp4netns)) (delete 'configure)
(native-inputs (list bats git go pkg-config)) (add-after 'unpack 'set-env
(build-system gnu-build-system) (lambda* (#:key inputs #:allow-other-keys)
(arguments (setenv "HOME" "/tmp")))
(list #:make-flags #~(list #$(string-append "CC=" (replace 'check
(cc-for-target)) (lambda* (#:key tests? #:allow-other-keys)
(string-append "PREFIX=" (when tests?
#$output)) (invoke "make" "localsystem")
#:tests? #f (invoke "make" "remotesystem"))))
#:test-target "test" (add-after 'unpack 'fix-hardcoded-paths
#:phases #~(modify-phases %standard-phases (lambda _
(delete 'configure) (substitute* (find-files "libpod" "\\.go")
(add-after 'unpack 'set-env (("exec.LookPath[(][\"]slirp4netns[\"][)]") (string-append "exec.LookPath(\"" (which "slirp4netns") "\")")))
(lambda* (#:key inputs #:allow-other-keys) (substitute* "hack/install_catatonit.sh"
(setenv "HOME" "/tmp"))) (("CATATONIT_PATH=\"[^\"]+\"") (string-append "CATATONIT_PATH=" (which "true"))))
(replace 'check (substitute* "vendor/github.com/containers/common/pkg/config/config_linux.go"
(lambda* (#:key tests? #:allow-other-keys) (("/usr/local/libexec/podman") (string-append #$output "/bin")))
(when tests? (substitute* "vendor/github.com/containers/common/pkg/config/default.go"
(invoke "make" "localsystem") (("/usr/libexec/podman/conmon") (which "conmon"))
(invoke "make" "remotesystem")))) (("/usr/local/libexec/cni") (string-append #$(this-package-input "cni-plugins") "/bin"))
(add-after 'unpack 'fix-hardcoded-paths (("/usr/bin/crun") (which "crun")))))
(lambda _ (add-after 'install 'install-completions
(substitute* (find-files "libpod" "\\.go") (lambda _
(("exec.LookPath[(][\"]slirp4netns[\"][)]") (invoke "make" "install.completions"
(string-append "exec.LookPath(\"" (string-append "PREFIX=" #$output)))))))
(which "slirp4netns") "\")"))) (inputs (list btrfs-progs gnu:cni-plugins gnu:conmon gnu:crun gpgme go-github-com-go-md2man iptables libassuan libseccomp libselinux gnu:slirp4netns))
(substitute* "hack/install_catatonit.sh" (native-inputs (list bats git go-1.18 pkg-config python))
(("CATATONIT_PATH=\"[^\"]+\"") (home-page "https://podman.io")
(string-append "CATATONIT_PATH=" (synopsis "Manage containers, images, pods, and their volumes")
(which "true")))) (description "Podman (the POD MANager) is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers.")
(substitute* "vendor/github.com/containers/common/pkg/config/config_linux.go" (license license:asl2.0)))
(("/usr/local/libexec/podman")
(string-append #$output "/bin")))
(substitute* "vendor/github.com/containers/common/pkg/config/default.go"
(("/usr/libexec/podman/conmon")
(which "conmon"))
(("/usr/local/libexec/cni")
(string-append #$(this-package-input
"cni-plugins") "/bin"))
(("/usr/bin/crun")
(which "crun")))))
(add-after 'unpack 'build-no-docs
(lambda _
(substitute* "Makefile"
(("all: binaries docs")
"all: binaries"))
(substitute* "Makefile"
(("install: install.bin install.remote install.man install.systemd")
"install: install.bin install.remote install.systemd"))))
(add-after 'install 'install-completions
(lambda _
(invoke "make" "install.completions"
(string-append "PREFIX="
#$output)))))))))
(define-public podman-4.3.0
(package
(inherit podman)
(name "podman")
(version "4.3.0")
(source (origin
(method url-fetch)
(uri (list (string-append
"https://github.com/containers/podman/archive/refs/tags/v"
version ".tar.gz")))
(sha256
(base32
"0d5zfi6drac23vb2la2v5s2g27hbz9wgiyvlxfm7hgzjh2ds18sm"))))))
;; YD : now uptreamed…
;(define-public podman-4.2.1
; (package
; (inherit gnu:podman)
; (name "podman")
; (version "4.2.1")
; (source (origin
; (method url-fetch)
; (uri (list
; (string-append "https://github.com/containers/podman/archive/refs/tags/v" version ".tar.gz")
; ))
; (sha256 (base32 "1wqxiln5p29qq92317m7mllalgk2dy7fqrh48pd2hmcz3blh805i"))
; ))
; )
;)
(define-public podman-4.2.0
(package
(inherit gnu:podman)
(name "podman")
(version "4.2.0")
(source (origin
(method url-fetch)
(uri (list (string-append
"https://github.com/containers/podman/archive/refs/tags/v"
version ".tar.gz")))
(sha256
(base32
"1x5jmmz78ggnlyidc0ivcghpkysd4zkm598jjbf9gkaw09cvry0m"))))))
(define-public podman-4.1.1
(package
(inherit gnu:podman)
(name "podman")
(version "4.1.1")
(source (origin
(method url-fetch)
(uri (list (string-append
"https://github.com/containers/podman/archive/refs/tags/v"
version ".tar.gz")))
(sha256
(base32
"198hdf8wg50zcgrl3982yj3xd227224r7mgb135r9vmgn7lk5gr7"))))))
(define-public podman-4.1.0
(package
(inherit gnu:podman)
(name "podman")
(version "4.1.0")
(source (origin
(method url-fetch)
(uri (list (string-append
"https://github.com/containers/podman/archive/refs/tags/v"
version ".tar.gz")))
(sha256
(base32
"158fyxv2hd1nwirabrwxascl9lkdphhv0knwrk0qdm0ifcmf257q"))))))