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

From: Ludovic Courtès <[email-masked]>
Date: Mon, 15 Jul 2019 22:24:38 +0200

Hello,

Mathieu Othacehe <[email-masked]> 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’.