[PATCH 0/2] gnu: distrobox: Fix package and update.

  • Done
  • quality assurance status badge
Details
2 participants
  • Jean-Pierre De Jesus DIAZ
  • Ludovic Courtès
Owner
unassigned
Submitted by
Jean-Pierre De Jesus DIAZ
Severity
normal
J
J
Jean-Pierre De Jesus DIAZ wrote on 12 Mar 2024 12:51
(address . guix-patches@gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundation.xyz)
cover.1710244132.git.jean@foundation.xyz
Hi,

Previously the distrobox package wasn't working for me, while I didn't
find the cause of it I tried rewriting the definition and applied some
recommendations I've found when the package was added first.

So it now uses wrap-script to patch the scripts and un-patches the
shebang of scripts that are only used inside of the containers.

Also updated the package to 1.7.0.

Thanks,

Jean-Pierre De Jesus DIAZ (2):
gnu: distrobox: Update to 1.7.0.
gnu: distrobox: Fix dependency usage.

gnu/packages/containers.scm | 50 +++++++++++++++++++++++++++++--------
1 file changed, 40 insertions(+), 10 deletions(-)


base-commit: 1e5e3d8e24e8ed0b071fcd4b95d2a0a05c80c546
--
2.41.0
J
J
Jean-Pierre De Jesus DIAZ wrote on 12 Mar 2024 13:26
[PATCH 1/2] gnu: distrobox: Update to 1.7.0.
(address . 69744@debbugs.gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundation.xyz)
9a8ce0c8d824d234cef732d3367cb6f3222e5260.1710244132.git.jean@foundation.xyz
* gnu/packages/containers.scm (distrobox): Update to 1.7.0.

Change-Id: Ie62683317f6c984e5a64ce5436a17c8f2b7fbcf9
---
gnu/packages/containers.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index aa270a25f3..21bd7e64bc 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -149,7 +149,7 @@ (define-public conmon
(define-public distrobox
(package
(name "distrobox")
- (version "1.5.0.2")
+ (version "1.7.0")
(source
(origin
(method git-fetch)
@@ -157,7 +157,7 @@ (define-public distrobox
(url "https://github.com/89luca89/distrobox")
(commit version)))
(sha256
- (base32 "0h6rpgbcmg33vriyzh9nkdxj8yhfn0y35i1wh1zmb7zss3ik9kxj"))
+ (base32 "1g14q1sm3026h9n85v1gc3m2v9sgrac2mr9yrkh98qg5yahzmpc3"))
(file-name (git-file-name name version))))
(build-system copy-build-system)
(inputs
--
2.41.0
J
J
Jean-Pierre De Jesus DIAZ wrote on 12 Mar 2024 13:26
[PATCH 2/2] gnu: distrobox: Fix dependency usage.
(address . 69744@debbugs.gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundation.xyz)
a67021d001dfdec7afa5094c847b4ae3a0a6d5de.1710244132.git.jean@foundation.xyz
* gnu/packages/containers.scm (distrobox): Use WRAP-SCRIPT to patch the
scripts to use system wget and podman.

Change-Id: Ida9affcb212f64892e85dfa8bc4dd4d59f832f4f
---
gnu/packages/containers.scm | 46 ++++++++++++++++++++++++++++++-------
1 file changed, 38 insertions(+), 8 deletions(-)

Toggle diff (79 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 21bd7e64bc..d93ca04960 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2023 Zongyuan Li <zongyuan.li@c0x0o.me>
;;; Copyright © 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
+;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundation.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -43,6 +44,7 @@ (define-module (gnu packages containers)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages golang)
+ #:use-module (gnu packages guile)
#:use-module (gnu packages linux)
#:use-module (gnu packages python)
#:use-module (gnu packages networking)
@@ -160,20 +162,48 @@ (define-public distrobox
(base32 "1g14q1sm3026h9n85v1gc3m2v9sgrac2mr9yrkh98qg5yahzmpc3"))
(file-name (git-file-name name version))))
(build-system copy-build-system)
- (inputs
- (list podman wget))
(arguments
(list #:phases
#~(modify-phases %standard-phases
- (add-before 'install 'refer-to-inputs
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* (find-files "." "^distrobox[^.]*[^1]$")
- (("podman") (search-input-file inputs "/bin/podman"))
- (("wget") (search-input-file inputs "/bin/wget"))
- (("command -v") "test -x"))))
+ ;; Use WRAP-SCRIPT to wrap all of the scripts of distrobox,
+ ;; excluding the host side ones.
+ (add-after 'install 'wrap-scripts
+ (lambda _
+ (let ((path (search-path-as-list
+ (list "bin")
+ (list #$(this-package-input "podman")
+ #$(this-package-input "wget")))))
+ (for-each (lambda (script)
+ (wrap-script
+ (string-append #$output "/bin/distrobox-"
+ script)
+ `("PATH" ":" prefix ,path)))
+ '("assemble"
+ "create"
+ "enter"
+ "ephemeral"
+ "generate-entry"
+ "list"
+ "rm"
+ "stop"
+ "upgrade")))))
+ ;; These scripts are used in the container side and the
+ ;; /gnu/store path is not shared with the containers.
+ (add-after 'patch-shebangs 'unpatch-shebangs
+ (lambda _
+ (for-each (lambda (script)
+ (substitute*
+ (string-append #$output "/bin/distrobox-"
+ script)
+ (("#!.*/bin/sh") "#!/bin/sh\n")))
+ '("export" "host-exec" "init"))))
(replace 'install
(lambda _
(invoke "./install" "--prefix" #$output))))))
+ (inputs
+ (list guile-3.0 ; for wrap-script
+ podman
+ wget))
(home-page "https://distrobox.privatedns.org/")
(synopsis "Create and start containers highly integrated with the hosts")
(description
--
2.41.0
L
L
Ludovic Courtès wrote on 22 Mar 2024 11:38
Re: [bug#69744] [PATCH 0/2] gnu: distrobox: Fix package and update.
(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundation.xyz)(address . 69744-done@debbugs.gnu.org)
8734situtm.fsf@gnu.org
Hi,

Jean-Pierre De Jesus DIAZ <jean@foundation.xyz> skribis:

Toggle quote (3 lines)
> gnu: distrobox: Update to 1.7.0.
> gnu: distrobox: Fix dependency usage.

Applied, thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 69744@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 69744
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch