From patchwork Tue Feb 21 14:34:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zongyuan Li X-Patchwork-Id: 47198 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9E94716B44; Tue, 21 Feb 2023 16:47:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5820A16AFE for ; Tue, 21 Feb 2023 16:47:08 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUVm1-00083E-1J; Tue, 21 Feb 2023 11:45:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUU5i-0000SK-6b for guix-patches@gnu.org; Tue, 21 Feb 2023 09:58:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUU5h-0001aR-TY for guix-patches@gnu.org; Tue, 21 Feb 2023 09:58:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUU5h-0002Iy-P7 for guix-patches@gnu.org; Tue, 21 Feb 2023 09:58:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61680] [PATCH] gnu: podman: Add 'docker' alias script as 'docker' output Resent-From: Zongyuan Li Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Feb 2023 14:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61680 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61680@debbugs.gnu.org Cc: Zongyuan Li X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16769914248776 (code B ref -1); Tue, 21 Feb 2023 14:58:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Feb 2023 14:57:04 +0000 Received: from localhost ([127.0.0.1]:56978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUU4l-0002HT-Cb for submit@debbugs.gnu.org; Tue, 21 Feb 2023 09:57:04 -0500 Received: from lists.gnu.org ([209.51.188.17]:54566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUTjj-0001Ea-TA for submit@debbugs.gnu.org; Tue, 21 Feb 2023 09:35:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUTjR-0006CA-66 for guix-patches@gnu.org; Tue, 21 Feb 2023 09:35:02 -0500 Received: from mail-4317.proton.ch ([185.70.43.17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUTjI-0003g1-Ch for guix-patches@gnu.org; Tue, 21 Feb 2023 09:34:59 -0500 Date: Tue, 21 Feb 2023 14:34:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c0x0o.me; s=protonmail; t=1676990078; x=1677249278; bh=uAfdakJzIjaDu3x2wogFeEps/Ch0iHtuZFnEf5qJbAA=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=MOxn4n5Vn37TXQJl/MprXBW5meEVqKuYEeHEJzLNzEyjxY6ABDXtSuo3/HsWF4e4S D/5nK7lL1Mr2QsHFJ2O9HtC/8f0sJpTceNwcscPSEiCusmRUqxdbDWLGfKCHUeLmXP x4pcxkSTx1n/+Pykewe0lW7GfCSm+kqKK/gOfUveDGi1LRn2R3ltzrv0npBfGpfHO7 lQQXVlR182pMq3e/dmj1aW0yfRlVuQYOQean5ys2bMaSTQUhbMGFeCJwPo5biLP9LN R9jLlVMv2YbVLxKd9diXDBK6Z6BSpmdycb32aoqUJZtd0SAEETtszdLOkRiVjhAn3P B8pCcqgvxwTyg== Message-ID: <20230221143401.42099-1-zongyuan.li@c0x0o.me> Feedback-ID: 67462066:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.17; envelope-from=zongyuan.li@c0x0o.me; helo=mail-4317.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 21 Feb 2023 09:57:02 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Tue, 21 Feb 2023 11:45:46 -0500 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Zongyuan Li X-ACL-Warn: , Zongyuan Li via Guix-patches X-Patchwork-Original-From: Zongyuan Li via Guix-patches via From: Zongyuan Li Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/containers.scm: New 'docker' output for podman Signed-off-by: Zongyuan Li --- gnu/packages/containers.scm | 157 +++++++++++++++++++----------------- 1 file changed, 83 insertions(+), 74 deletions(-) -- 2.37.1 (Apple Git-137.1) diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm index 272b67c38d..80c4aaa400 100644 --- a/gnu/packages/containers.scm +++ b/gnu/packages/containers.scm @@ -312,83 +312,92 @@ (define-public podman (package (name "podman") (version "4.3.1") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/containers/podman") - (commit (string-append "v" version)))) - (modules '((guix build utils))) - ;; FIXME: Btrfs libraries not detected by these scripts. - (snippet '(substitute* "Makefile" - ((".*hack/btrfs.*") ""))) - (sha256 - (base32 "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h")) - (file-name (git-file-name name version)))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/containers/podman") + (commit (string-append "v" version)))) + (modules '((guix build utils))) + ;; FIXME: Btrfs libraries not detected by these scripts. + (snippet '(substitute* "Makefile" + ((".*hack/btrfs.*") + ""))) + (sha256 + (base32 + "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h")) + (file-name (git-file-name name version)))) (build-system gnu-build-system) + (outputs '("out" "docker")) (arguments - (list - #:make-flags - #~(list #$(string-append "CC=" (cc-for-target)) - (string-append "PREFIX=" #$output)) - #:tests? #f ; /sys/fs/cgroup not set up in guix sandbox - #:test-target "test" - #:phases - #~(modify-phases %standard-phases - (delete 'configure) - (add-after 'unpack 'set-env - (lambda* (#:key inputs #:allow-other-keys) - ;; when running go, things fail because - ;; HOME=/homeless-shelter. - (setenv "HOME" "/tmp"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - ;; (invoke "strace" "-f" "bin/podman" "version") - (invoke "make" "localsystem") - (invoke "make" "remotesystem")))) - (add-after 'unpack 'fix-hardcoded-paths - (lambda _ - (substitute* (find-files "libpod" "\\.go") - (("exec.LookPath[(][\"]slirp4netns[\"][)]") - (string-append "exec.LookPath(\"" - (which "slirp4netns") "\")"))) - (substitute* "hack/install_catatonit.sh" - (("CATATONIT_PATH=\"[^\"]+\"") - (string-append "CATATONIT_PATH=" (which "true")))) - (substitute* "vendor/github.com/containers/common/pkg/config/config_linux.go" - (("/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 'install 'install-completions - (lambda _ - (invoke "make" "install.completions" - (string-append "PREFIX=" #$output))))))) - (inputs - (list btrfs-progs - cni-plugins - conmon - crun - gpgme - go-github-com-go-md2man - iptables - libassuan - libseccomp - libselinux - slirp4netns)) - (native-inputs - (list bats - git - go - ; strace ; XXX debug - pkg-config - python)) + (list #:make-flags #~(list #$(string-append "CC=" + (cc-for-target)) + (string-append "PREFIX=" + #$output)) + #:tests? #f ;/sys/fs/cgroup not set up in guix sandbox + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'set-env + (lambda* (#:key inputs #:allow-other-keys) + (setenv "HOME" "/tmp"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "make" "localsystem") + (invoke "make" "remotesystem")))) + (add-after 'unpack 'fix-hardcoded-paths + (lambda* (#:key outputs #:allow-other-keys) + (substitute* (find-files "libpod" "\\.go") + (("exec.LookPath[(][\"]slirp4netns[\"][)]") + (string-append "exec.LookPath(\"" + (which "slirp4netns") "\")"))) + (substitute* "hack/install_catatonit.sh" + (("CATATONIT_PATH=\"[^\"]+\"") + (string-append "CATATONIT_PATH=" + (which "true")))) + (substitute* "vendor/github.com/containers/common/pkg/config/config_linux.go" + (("/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"))) + (substitute* "docker" + (("/usr/bin/podman") + (string-append (assoc-ref outputs "out") + "/bin/podman"))))) + (add-after 'install 'install-docker + (lambda* (#:key outputs #:allow-other-keys) + (let* ((docker (assoc-ref outputs "docker"))) + (install-file "docker" + (string-append docker "/bin")) #t))) + (add-after 'install 'install-completions + (lambda _ + (invoke "make" "install.completions" + (string-append "PREFIX=" + #$output))))))) + (inputs (list btrfs-progs + cni-plugins + conmon + crun + gpgme + go-github-com-go-md2man + iptables + libassuan + libseccomp + libselinux + slirp4netns)) + (native-inputs (list bats + git + go + ;; strace ; XXX debug + pkg-config + python)) (home-page "https://podman.io") (synopsis "Manage containers, images, pods, and their volumes") (description