mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
gnu: distrobox: Fix dependency usage.
* gnu/packages/containers.scm (distrobox): Use WRAP-SCRIPT to patch the scripts to use system wget and podman. Change-Id: Ida9affcb212f64892e85dfa8bc4dd4d59f832f4f Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
af1759bb9c
commit
f094e43510
1 changed files with 38 additions and 8 deletions
|
@ -6,6 +6,7 @@
|
||||||
;;; Copyright © 2023 Zongyuan Li <zongyuan.li@c0x0o.me>
|
;;; Copyright © 2023 Zongyuan Li <zongyuan.li@c0x0o.me>
|
||||||
;;; Copyright © 2023 Ricardo Wurmus <rekado@elephly.net>
|
;;; Copyright © 2023 Ricardo Wurmus <rekado@elephly.net>
|
||||||
;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
|
;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
|
||||||
|
;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundation.xyz>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; 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 glib)
|
||||||
#:use-module (gnu packages gnupg)
|
#:use-module (gnu packages gnupg)
|
||||||
#:use-module (gnu packages golang)
|
#:use-module (gnu packages golang)
|
||||||
|
#:use-module (gnu packages guile)
|
||||||
#:use-module (gnu packages linux)
|
#:use-module (gnu packages linux)
|
||||||
#:use-module (gnu packages python)
|
#:use-module (gnu packages python)
|
||||||
#:use-module (gnu packages networking)
|
#:use-module (gnu packages networking)
|
||||||
|
@ -160,20 +162,48 @@ (define-public distrobox
|
||||||
(base32 "1g14q1sm3026h9n85v1gc3m2v9sgrac2mr9yrkh98qg5yahzmpc3"))
|
(base32 "1g14q1sm3026h9n85v1gc3m2v9sgrac2mr9yrkh98qg5yahzmpc3"))
|
||||||
(file-name (git-file-name name version))))
|
(file-name (git-file-name name version))))
|
||||||
(build-system copy-build-system)
|
(build-system copy-build-system)
|
||||||
(inputs
|
|
||||||
(list podman wget))
|
|
||||||
(arguments
|
(arguments
|
||||||
(list #:phases
|
(list #:phases
|
||||||
#~(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-before 'install 'refer-to-inputs
|
;; Use WRAP-SCRIPT to wrap all of the scripts of distrobox,
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
;; excluding the host side ones.
|
||||||
(substitute* (find-files "." "^distrobox[^.]*[^1]$")
|
(add-after 'install 'wrap-scripts
|
||||||
(("podman") (search-input-file inputs "/bin/podman"))
|
(lambda _
|
||||||
(("wget") (search-input-file inputs "/bin/wget"))
|
(let ((path (search-path-as-list
|
||||||
(("command -v") "test -x"))))
|
(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
|
(replace 'install
|
||||||
(lambda _
|
(lambda _
|
||||||
(invoke "./install" "--prefix" #$output))))))
|
(invoke "./install" "--prefix" #$output))))))
|
||||||
|
(inputs
|
||||||
|
(list guile-3.0 ; for wrap-script
|
||||||
|
podman
|
||||||
|
wget))
|
||||||
(home-page "https://distrobox.privatedns.org/")
|
(home-page "https://distrobox.privatedns.org/")
|
||||||
(synopsis "Create and start containers highly integrated with the hosts")
|
(synopsis "Create and start containers highly integrated with the hosts")
|
||||||
(description
|
(description
|
||||||
|
|
Loading…
Reference in a new issue