diff mbox series

[bug#51440,04/10] gnu: guile-netlink: Allow cross-compilation.

Message ID 20211027140245.18970-4-ludo@gnu.org
State Accepted
Headers show
Series [bug#51440,01/10] tests: Add 'static-networking' test. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Ludovic Courtès Oct. 27, 2021, 2:02 p.m. UTC
* gnu/packages/guile-xyz.scm (guile-netlink)[arguments]: Add #:phases.
Remove unnecessary #:tests? #f.
[native-inputs]: Add GUILE-3.0.
---
 gnu/packages/guile-xyz.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Julien Lepiller Oct. 28, 2021, 12:58 a.m. UTC | #1
Le Wed, 27 Oct 2021 16:02:39 +0200,
Ludovic Courtès <ludo@gnu.org> a écrit :

> * gnu/packages/guile-xyz.scm (guile-netlink)[arguments]: Add #:phases.
> Remove unnecessary #:tests? #f.
> [native-inputs]: Add GUILE-3.0.
> ---
>  gnu/packages/guile-xyz.scm | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
> index 355b23f57e..daef8bbb26 100644
> --- a/gnu/packages/guile-xyz.scm
> +++ b/gnu/packages/guile-xyz.scm
> @@ -4854,13 +4854,22 @@ (define-public guile-netlink
>           "03zmsha2d7whlwb52gna83jdas9bqi18rq3sss7kkicv814qb35g"))))
>      (build-system gnu-build-system)
>      (arguments
> -     `(#:tests? #f)); no tests
> +     `(#:phases (modify-phases %standard-phases
> +                  (add-before 'bootstrap 'set-guile-target
> +                    (lambda* (#:key target #:allow-other-keys)
> +                      (when target
> +                        ;; Pass '--target=TRIPLET' to 'guild
> compile'.
> +                        (substitute* "guile.am"
> +                          (("\\$\\(GUILD\\) compile")
> +                           (string-append "$(GUILD) compile
> --target="
> +                                          target " ")))))))))
>      (inputs
>       `(("guile" ,guile-3.0)))
>      (native-inputs
>       `(("automake" ,automake)
>         ("autoconf" ,autoconf)
>         ("pkg-config" ,pkg-config)
> +       ("guile" ,guile-3.0)                    ;for 'guild compile'
> + guile.m4 ("texinfo" ,texinfo)))
>      (home-page "https://git.lepiller.eu/guile-netlink")
>      (synopsis "Netlink protocol implementation for Guile")

Is there anything I can do as the author of guile-netlink to allow
cross-compilation?
Ludovic Courtès Oct. 29, 2021, 9:38 p.m. UTC | #2
Hi,

Julien Lepiller <julien@lepiller.eu> skribis:

> Le Wed, 27 Oct 2021 16:02:39 +0200,
> Ludovic Courtès <ludo@gnu.org> a écrit :

[...]

>> +                        ;; Pass '--target=TRIPLET' to 'guild
>> compile'.
>> +                        (substitute* "guile.am"
>> +                          (("\\$\\(GUILD\\) compile")
>> +                           (string-append "$(GUILD) compile
>> --target="

[...]

> Is there anything I can do as the author of guile-netlink to allow
> cross-compilation?

Yes, please!  Pass ‘--target=$(HOST)’ to ‘guild compile’.  See for
example how guile-zstd does it.

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 355b23f57e..daef8bbb26 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4854,13 +4854,22 @@  (define-public guile-netlink
          "03zmsha2d7whlwb52gna83jdas9bqi18rq3sss7kkicv814qb35g"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f)); no tests
+     `(#:phases (modify-phases %standard-phases
+                  (add-before 'bootstrap 'set-guile-target
+                    (lambda* (#:key target #:allow-other-keys)
+                      (when target
+                        ;; Pass '--target=TRIPLET' to 'guild compile'.
+                        (substitute* "guile.am"
+                          (("\\$\\(GUILD\\) compile")
+                           (string-append "$(GUILD) compile --target="
+                                          target " ")))))))))
     (inputs
      `(("guile" ,guile-3.0)))
     (native-inputs
      `(("automake" ,automake)
        ("autoconf" ,autoconf)
        ("pkg-config" ,pkg-config)
+       ("guile" ,guile-3.0)                    ;for 'guild compile' + guile.m4
        ("texinfo" ,texinfo)))
     (home-page "https://git.lepiller.eu/guile-netlink")
     (synopsis "Netlink protocol implementation for Guile")