Message ID | 87fs4iew25.fsf@gmail.com |
---|---|
State | New |
Headers | show |
Simon Tournier <zimon.toutoune@gmail.com> skribis: > solved by adding the package guile, > > $ guix shell -C disarchive guile -- disarchive disassemble hello-2.12.1 > > then, I think the contrary: having two packages is more convenient. Hi! Yes, I think you mentioned it before. To me, there’s a precedent in favor of the status quo (a single package): quite a few other packages (guix, cuirass, mumi, guile-smc, etc.) are also both a Guile library and a set of commands, and they’re provided as a single package. I think we shouldn’t lose our hair over it anyway. :-) Ludo’.
Hi Ludo, On Fri, 18 Aug 2023 at 15:56, Ludovic Courtès <ludo@gnu.org> wrote: > > solved by adding the package guile, > > > > $ guix shell -C disarchive guile -- disarchive disassemble hello-2.12.1 > > > > then, I think the contrary: having two packages is more convenient. > > Hi! Yes, I think you mentioned it before. To me, there’s a precedent > in favor of the status quo (a single package): quite a few other > packages (guix, cuirass, mumi, guile-smc, etc.) are also both a Guile > library and a set of commands, and they’re provided as a single package. Hum, thus the status quo is in favor of my initial patch [1]. ;-) --8<---------------cut here---------------start------------->8--- $ for tool in guix cuirass mumi; do guix shell -C $tool -- $tool --version done guix shell -C guile-smc -- smc --version > > guix (GNU Guix) 1.4.0-7.44bbfc2 Copyright (C) 2023 the Guix authors License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. cuirass (Cuirass) 1.1.0-16.b825967 Copyright (C) 2021 the Cuirass authors License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. `mumi search QUERY': search mumi for issues. [...] ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /gnu/store/8jmrygas3krkdrqalj0g0cp273whm84s-guile-smc-0.6.0/bin/.smc-real ;;; compiled /home/simon/.cache/guile/ccache/3.0-LE-8-4.6/gnu/store/8jmrygas3krkdrqalj0g0cp273whm84s-guile-smc-0.6.0/bin/.smc-real.go smc 0.6.0 Copyright (C) 2021-2022 Artyom V. Poptsov <poptsov.artyom@gmail.com> License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Artyom V. Poptsov. --8<---------------cut here---------------end--------------->8--- Please note that cuirass, mumi and guile-smc does not propagate any inputs. Hum, I do not know where cuirass and mumi are used as library, but that’s another story. :-) Well, I can live with one single package – although I think it’s confusing :-) – however I cannot live without “guix shell -C disarchive -- disarchive”. Therefore, could you send a patch that fixes this and suits your needs? Cheers, simon 1: https://issues.guix.gnu.org/62008#1
Re,
On Fri, 18 Aug 2023 at 15:56, Ludovic Courtès <ludo@gnu.org> wrote:
> I think we shouldn’t lose our hair over it anyway. :-)
For sure. Just to point that the two packages way is somehow
shared. ;-) At least in Python context, for example see:
Re: poetry: python-poetry?
by Hilton Chain <hako@ultrarare.space>
Mon, 31 Jul 2023 10:05:54 +0800
https://yhetil.org/guix/87leew25tp.wl-hako@ultrarare.space
Re: poetry: python-poetry?
by Lars-Dominik Braun <lars@6xq.net>
Thu, 27 Jul 2023 09:03:34 +0200
https://yhetil.org/guix/ZMIWxvt4jyx9mv--@noor.fritz.box
And I do not see why Guile and disarchive would be an exception.
That’s said, it’s time to go to the hairdresser for brushing my hair
before loosing them. ;-)
Cheers,
simon
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm index d484c34826..e60570b037 100644 --- a/gnu/packages/backup.scm +++ b/gnu/packages/backup.scm @@ -1256,9 +1256,9 @@ (define-public burp backup.") (license license:agpl3))) -(define-public disarchive +(define-public guile-disarchive (package - (name "disarchive") + (name "guile-disarchive") (version "0.5.0") (source (origin (method url-fetch) @@ -1290,6 +1290,42 @@ (define-public disarchive compression parameters used by Gzip.") (license license:gpl3+))) +(define-public disarchive + (package/inherit guile-disarchive + (name "disarchive") + (arguments + (list + #:modules `((ice-9 popen) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((effective + (read (open-pipe* OPEN_READ + (string-append #$guile-3.0 "/bin/guile") + "-c" "(write (effective-version))"))) + (scm-dir (string-append "/share/guile/site/" effective)) + (go-dir (string-append "/lib/guile/" effective + "/site-ccache/")) + (modules (list #$output + #$guile-bytestructures + #$guile-gcrypt + #$guile-lzma)) + (scm-path + (map (lambda (module) (string-append module scm-dir)) + modules)) + (go-path + (map (lambda (module) (string-append module scm-dir)) + modules))) + (wrap-program (string-append #$output "/bin/disarchive") + `("PATH" ":" prefix (,(string-append #$output "/bin"))) + `("GUILE_LOAD_PATH" ":" prefix ,scm-path) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix ,go-path)))))))) + (inputs + (list guile-3.0 guile-gcrypt guile-lzma zlib)) + (propagated-inputs (list)))) + (define-public borgmatic (package (name "borgmatic")