unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Zongyuan Li via Guix-patches via <guix-patches@gnu.org>
To: 61680@debbugs.gnu.org
Cc: Zongyuan Li <zongyuan.li@c0x0o.me>
Subject: [bug#61680] [PATCH] gnu: podman: Add 'docker' alias script as 'docker' output
Date: Tue, 21 Feb 2023 14:34:24 +0000	[thread overview]
Message-ID: <20230221143401.42099-1-zongyuan.li@c0x0o.me> (raw)

* gnu/packages/containers.scm: New 'docker' output for podman

Signed-off-by: Zongyuan Li <zongyuan.li@c0x0o.me>
---
 gnu/packages/containers.scm | 157 +++++++++++++++++++-----------------
 1 file changed, 83 insertions(+), 74 deletions(-)

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
--
2.37.1 (Apple Git-137.1)






             reply	other threads:[~2023-02-21 16:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 14:34 Zongyuan Li via Guix-patches via [this message]
2023-02-22  5:19 ` [bug#61680] [PATCH] gnu: podman: Add 'docker' alias script as 'docker' output Liliana Marie Prikler
2023-02-22  5:52   ` lWP6SrZsSwhCy5tUxadDfg via Guix-patches via
2023-02-22 19:23     ` Liliana Marie Prikler
2023-02-23  6:56 ` [bug#61680] [PATCH v2] " Zongyuan Li via Guix-patches via
2023-03-02 18:35   ` [bug#61680] [PATCH] " Ludovic Courtès
2023-03-03  6:30     ` Zongyuan Li via Guix-patches via
2023-03-03  8:08 ` [bug#61680] [PATCH v3] " Zongyuan Li via Guix-patches via
2023-03-24 10:29   ` Zongyuan Li via Guix-patches via

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=20230221143401.42099-1-zongyuan.li@c0x0o.me \
    --to=guix-patches@gnu.org \
    --cc=61680@debbugs.gnu.org \
    --cc=zongyuan.li@c0x0o.me \
    /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).