all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#74564] [PATCH] gnu: Add podman-docker.
@ 2024-11-27 23:52 Arjan Adriaanse
  2024-11-29 13:43 ` [bug#74564] [PATCH v2] gnu: podman: Add docker output Arjan Adriaanse
  0 siblings, 1 reply; 2+ messages in thread
From: Arjan Adriaanse @ 2024-11-27 23:52 UTC (permalink / raw)
  To: 74564; +Cc: Arjan Adriaanse

* gnu/packages/containers.scm (podman-docker): New variable.

Change-Id: Ib6a3e0423d8257ce13e72ac12a908da42015cf8d
---
 gnu/packages/containers.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index c638736cda..b606215842 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
 ;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundation.xyz>
 ;;; Copyright © 2024 Jean-Pierre De Jesus DIAZ <jean@foundation.xyz>
+;;; Copyright © 2024 Arjan Adriaanse <arjan@adriaan.se>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@ (define-module (gnu packages containers)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gnupg)
@@ -576,6 +578,33 @@ (define-public podman
 @code{openssh} packages.")
     (license license:asl2.0)))
 
+(define-public podman-docker
+  (package/inherit podman
+    (name "podman-docker")
+    (native-inputs `(,@(package-native-inputs podman)
+                     ("gettext" ,gettext-minimal))) ; for envsubst
+    (propagated-inputs (list podman))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'set-env
+            (lambda _
+              ;; When running go, things fail because HOME=/homeless-shelter.
+              (setenv "HOME" "/tmp")
+              (setenv "PREFIX" #$output)
+              (setenv "ETCDIR" (string-append #$output "/etc"))))
+          (replace 'install
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "Makefile"
+                (("BINDIR=\\$\\{BINDIR\\}") ; directory of podman command
+                 (string-append "BINDIR=" (assoc-ref inputs "podman") "/bin"))
+                (("ETCDIR=\\$\\{ETCDIR\\}") ; configuration directory
+                 "ETCDIR='$${XDG_CONFIG_HOME}'"))
+              (invoke "make" "docker-docs" "install.docker-full"))))))
+    (synopsis "Emulate Docker CLI using Podman")))
+
 (define-public podman-compose
   (package
     (name "podman-compose")

base-commit: c6d15cf27a137051ccd8f301330a70dd0eecc3d4
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [bug#74564] [PATCH v2] gnu: podman: Add docker output.
  2024-11-27 23:52 [bug#74564] [PATCH] gnu: Add podman-docker Arjan Adriaanse
@ 2024-11-29 13:43 ` Arjan Adriaanse
  0 siblings, 0 replies; 2+ messages in thread
From: Arjan Adriaanse @ 2024-11-29 13:43 UTC (permalink / raw)
  To: 74564; +Cc: Arjan Adriaanse

* gnu/packages/containers.scm (podman-docker)[arguments]<#:phases>: Add
'override-docker-envsubst-args and 'install-docker.
[inputs]: Add gettext-minimal.
[outputs]: Add docker.

Change-Id: Ib6a3e0423d8257ce13e72ac12a908da42015cf8d
---
 gnu/packages/containers.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index c638736cda..6cc1a199d2 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
 ;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundation.xyz>
 ;;; Copyright © 2024 Jean-Pierre De Jesus DIAZ <jean@foundation.xyz>
+;;; Copyright © 2024 Arjan Adriaanse <arjan@adriaan.se>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@ (define-module (gnu packages containers)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gnupg)
@@ -541,7 +543,20 @@ (define-public podman
           (add-after 'install 'install-completions
             (lambda _
               (invoke "make" "install.completions"
-                      (string-append "PREFIX=" #$output)))))))
+                      (string-append "PREFIX=" #$output))))
+          (add-after 'unpack 'override-docker-envsubst-args
+            (lambda _
+              (substitute* "Makefile"
+                ;; BINDIR is the directory of the podman command and
+                ;; ETCDIR is the system configuration directory.
+                (("envsubst < docker/docker.in")
+                 (string-append "BINDIR=" #$output "/bin ETCDIR=/etc "
+                                "envsubst < docker/docker.in")))))
+          (add-after 'install 'install-docker
+            (lambda _
+              (invoke "make" "docker-docs" "install.docker-full"
+                      (string-append "PREFIX=" #$output:docker)
+                      (string-append "ETCDIR=" #$output:docker "/etc")))))))
     (inputs
      (list bash-minimal
            btrfs-progs
@@ -553,12 +568,15 @@ (define-public podman
      (list (package/inherit grep
              (inputs (list pcre2)))     ; Drop once grep on master supports -P
            bats
+           gettext-minimal
            git
            go-1.22
            go-github-com-go-md2man
            mandoc
            pkg-config
            python))
+    (outputs '("out"
+               "docker")) ; Emulate Docker CLI
     (home-page "https://podman.io")
     (synopsis "Manage containers, images, pods, and their volumes")
     (description

base-commit: c6d15cf27a137051ccd8f301330a70dd0eecc3d4
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-29 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27 23:52 [bug#74564] [PATCH] gnu: Add podman-docker Arjan Adriaanse
2024-11-29 13:43 ` [bug#74564] [PATCH v2] gnu: podman: Add docker output Arjan Adriaanse

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.