gnu: guile-fibers@1.1: Support cross-compilation.

Fixes <https://issues.guix.gnu.org/54793>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.

* gnu/packages/guile-xyz.scm (guile-fibers-1.1)[arguments]: Add
'support-cross-compilation' phase.
This commit is contained in:
Ludovic Courtès 2022-04-14 11:32:57 +02:00
parent c9cded0955
commit 1f82602153
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -627,6 +627,25 @@ Unix-style DSV format and RFC 4180 format.")
(add-after 'unpack 'regenerate-autotools
(lambda _
(delete-file "configure")))
(add-after 'unpack 'support-cross-compilation
(lambda* (#:key target #:allow-other-keys)
;; Support cross-compilation. These issues are fixed in
;; Fibers commit c4756b9c336374546a41ac90a4431fcc8f7e98ee
;; and this phase can be removed for 1.1.1.
(when target
(substitute* "build-aux/guile.am"
(("\\$\\(AM_V_GEN\\)" all)
(string-append all " FIBERS_CROSS_COMPILING=yes "))
(("compile")
(string-append "compile --target=" target
" -L $(abs_top_srcdir)")))
(substitute* "fibers/epoll.scm"
(("\\(dynamic-call")
"(unless (getenv \"FIBERS_CROSS_COMPILING\") (dynamic-call")
(("\\(dynamic-link.*" all)
(string-append all ")\n"))
(("#,(%sizeof|%offsetof)" _ prefix)
prefix)))))
(add-after 'install 'mode-guile-objects
(lambda* (#:key outputs #:allow-other-keys)
;; .go files are installed to "lib/guile/X.Y/cache".