[PATCH] gnu: lbzip2: Fix cross-compilation.

DoneSubmitted by Brian Kubisiak.
Details
4 participants
  • Brian Kubisiak
  • Liliana Marie Prikler
  • Maxime Devos
  • Mathieu Othacehe
Owner
unassigned
Severity
normal
B
B
Brian Kubisiak wrote on 29 Mar 03:36 +0200
(address . guix-patches@gnu.org)
20220329013641.gfixewbrmu2qkz34@peregrine
* 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(-)

Toggle diff (17 lines)
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)))
-- 
2.34.0
L
L
Liliana Marie Prikler wrote on 29 Mar 08:07 +0200
b91791f5caf8be939d7e41a1dc9bbaec52d1fdce.camel@ist.tugraz.at
Am Montag, dem 28.03.2022 um 18:36 -0700 schrieb Brian Kubisiak:
Toggle quote (25 lines)
> * 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
M
Maxime Devos wrote on 29 Mar 11:05 +0200
Re: [bug#54618] [PATCH] gnu: lbzip2: Fix cross-compilation.
38042d6a6141d9ba6b0394ef457a086c15015986.camel@telenet.be
Liliana Marie Prikler schreef op di 29-03-2022 om 08:07 [+0200]:
Toggle quote (8 lines)
> +             (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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkLL5BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7r/fAQDeGTw7MHMyPsN0CAgL8BhDeuSO
ZfSzMVUdOgUABtIuoQEAiqI69hnfZHW02sZEecwkTQhr4qETmSJSpEExTsn2agg=
=2nfy
-----END PGP SIGNATURE-----


B
B
Brian Kubisiak wrote on 30 Mar 03:45 +0200
[PATCH v2] gnu: lbzip2: Fix cross-compilation.
(address . 54618@debbugs.gnu.org)
20220330014555.tucyos5b36qxzmd5@peregrine
* gnu/packages/compression.scm (lbzip2)[arguments]: Search (or
native-inputs inputs) for gnulib-tool.py.
---
gnu/packages/compression.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 3edaecd951..e1d8f721a3 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -411,8 +411,10 @@ (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
+                      (dirname (search-input-file (or native-inputs inputs)
+                                                  "gnulib-tool.py"))))
                  (copy-recursively gnulib "lib")
                  (setenv "PATH" (string-append "lib:" (getenv "PATH")))
                  #t)))
-- 
2.34.0
M
M
Mathieu Othacehe wrote on 30 Mar 12:39 +0200
Re: bug#54618: [PATCH] gnu: lbzip2: Fix cross-compilation.
(name . Brian Kubisiak)(address . brian@kubisiak.com)(address . 54618-done@debbugs.gnu.org)
87lewrybas.fsf_-_@gnu.org
Toggle quote (3 lines)
> * gnu/packages/compression.scm (lbzip2)[arguments]: Search (or
> native-inputs inputs) for gnulib-tool.py.

Pushed as 2387adf60022799a8af144ed8dd2b7a46c155374.

Thanks,

Mathieu
Closed
?
Your comment

This issue is archived.

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