diff mbox series

[bug#54618] gnu: lbzip2: Fix cross-compilation.

Message ID 20220329013641.gfixewbrmu2qkz34@peregrine
State Accepted
Headers show
Series [bug#54618] gnu: lbzip2: Fix cross-compilation. | expand

Commit Message

Brian Kubisiak March 29, 2022, 1:36 a.m. UTC
* gnu/packages/compression.scm (lbzip2)[arguments]: Add (or
native-inputs inputs) to ASSOC-REF.
---
 gnu/packages/compression.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Liliana Marie Prikler March 29, 2022, 6:07 a.m. UTC | #1
Am Montag, dem 28.03.2022 um 18:36 -0700 schrieb Brian Kubisiak:
> * gnu/packages/compression.scm (lbzip2)[arguments]: Add (or
> native-inputs inputs) to ASSOC-REF.
> ---
>  gnu/packages/compression.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gnu/packages/compression.scm
> b/gnu/packages/compression.scm
> index 3edaecd951..34e9fa49de 100644
> --- a/gnu/packages/compression.scm
> +++ b/gnu/packages/compression.scm
> @@ -411,8 +411,8 @@ (define-public lbzip2
>         `(#:phases
>           (modify-phases %standard-phases
>             (add-after 'unpack 'unpack-gnulib
> -             (lambda* (#:key inputs #:allow-other-keys)
> -               (let ((gnulib (assoc-ref inputs "gnulib")))
> +             (lambda* (#:key inputs native-inputs #:allow-other-
> keys)
> +               (let ((gnulib (assoc-ref (or native-inputs inputs)
> "gnulib")))
>                   (copy-recursively gnulib "lib")
>                   (setenv "PATH" (string-append "lib:" (getenv
> "PATH")))
>                   #t)))
Note that referring to inputs by name is discouraged. In this case, the
gnulib origin should be inlined (see ppsspp or gnome-recipes for
examples on how that is done).  I don't think there is a native vs.
non-native distinction for origins, but if there is, simply use #+
instead of #$.

Cheers
M March 29, 2022, 9:05 a.m. UTC | #2
Liliana Marie Prikler schreef op di 29-03-2022 om 08:07 [+0200]:
> +             (lambda* (#:key inputs native-inputs #:allow-other-
> keys)
> +               (let ((gnulib (assoc-ref (or native-inputs inputs)
> "gnulib")))
>                   (copy-recursively gnulib "lib")
>                   (setenv "PATH" (string-append "lib:" (getenv
> "PATH")))
>                   #t)))
Note that referring to inputs by name is discouraged. In this case, the
gnulib origin should be inlined (see ppsspp or gnome-recipes for
examples on how that is done).  I don't think there is a native vs.
non-native distinction for origins, but if there is, simply use #+
instead of #$.

I would go with

  (let ((gnulib (dirname (search-input-file (or native-inputs inputs) "gnulib-tool.py"))))
    [...]).

That way, no input labels are used yet package transformations are
still possible:

  (package (inherit lbzip2) (native-inputs [some inputs with a different gnulib]))

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 3edaecd951..34e9fa49de 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -411,8 +411,8 @@  (define-public lbzip2
        `(#:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'unpack-gnulib
-             (lambda* (#:key inputs #:allow-other-keys)
-               (let ((gnulib (assoc-ref inputs "gnulib")))
+             (lambda* (#:key inputs native-inputs #:allow-other-keys)
+               (let ((gnulib (assoc-ref (or native-inputs inputs) "gnulib")))
                  (copy-recursively gnulib "lib")
                  (setenv "PATH" (string-append "lib:" (getenv "PATH")))
                  #t)))