diff mbox series

[bug#36477,07/31] gnu: libgpg-error: Fix cross compilation.

Message ID 20190708095913.3460-8-m.othacehe@gmail.com
State Accepted
Headers show
Series Fix cross-compilation issues | expand

Commit Message

Mathieu Othacehe July 8, 2019, 9:58 a.m. UTC
* gnu/packages/gnupg.scm (libgpg-error)[arguments]: Add a lock-obj header to
the target platform when cross-compiling,
[native-inputs]: add gettext that is needed when cross-compiling.
---
 gnu/packages/gnupg.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Ludovic Courtès July 15, 2019, 8:24 p.m. UTC | #1
Hello,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * gnu/packages/gnupg.scm (libgpg-error)[arguments]: Add a lock-obj header to
> the target platform when cross-compiling,
> [native-inputs]: add gettext that is needed when cross-compiling.

[...]

> +    (arguments
> +     (if (%current-target-system)
> +         `(#:modules ((ice-9 match)
> +                      (guix build gnu-build-system)
> +                      (guix build utils))
> +           #:phases
> +           (modify-phases %standard-phases
> +             (add-after 'unpack 'cross-symlinks
> +               (lambda* (#:key inputs #:allow-other-keys)
> +                 (let* ((target ,(%current-target-system))
> +                        (tuple
> +                         (match (string-take target (string-index target #\-))
> +                           ("armhf" "arm-unknown-linux-gnueabi")
> +                           (x
> +                            (string-append x "-unknown-linux-gnu")))))

Two things:

  1. s/tuple/triplet/

  2. The target triplet is actually passed as a keyword argument to
     phases.  So if I’m not mistaken, you can write:

      (lambda* (#:key target …)
        …)

     and get rid of the ‘match’ form above.

> +                   (symlink
> +                    (string-append "lock-obj-pub." tuple ".h")
> +                    "src/syscfg/lock-obj-pub.linux-gnu.h"))

If possible, a short comment or a link to some upstream discussion that
explains this would be helpful.

Could you send an updated patch?

Thank you,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index f84f8d73a0..68e8270206 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -15,6 +15,7 @@ 
 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -86,6 +87,27 @@ 
        (base32
         "1jj08ns4sh1hmafqp1giskvdicdz18la516va26jycy27kkwaif3"))))
     (build-system gnu-build-system)
+    (arguments
+     (if (%current-target-system)
+         `(#:modules ((ice-9 match)
+                      (guix build gnu-build-system)
+                      (guix build utils))
+           #:phases
+           (modify-phases %standard-phases
+             (add-after 'unpack 'cross-symlinks
+               (lambda* (#:key inputs #:allow-other-keys)
+                 (let* ((target ,(%current-target-system))
+                        (tuple
+                         (match (string-take target (string-index target #\-))
+                           ("armhf" "arm-unknown-linux-gnueabi")
+                           (x
+                            (string-append x "-unknown-linux-gnu")))))
+                   (symlink
+                    (string-append "lock-obj-pub." tuple ".h")
+                    "src/syscfg/lock-obj-pub.linux-gnu.h"))
+                 #t))))
+         '()))
+    (native-inputs `(("gettext" ,gettext-minimal)))
     (home-page "https://gnupg.org")
     (synopsis "Library of error values for GnuPG components")
     (description