From: Christopher Baines <mail@cbaines.net>
To: Leo Prikler <leo.prikler@student.tugraz.at>
Cc: 46725@debbugs.gnu.org
Subject: [bug#46725] [PATCH] gnu: guile-lib: Fix cross compilation.
Date: Wed, 24 Feb 2021 08:45:48 +0000 [thread overview]
Message-ID: <87czwplupv.fsf@cbaines.net> (raw)
In-Reply-To: <d3ce8a30601c3601a08d6a10b17628ef368d9f75.camel@student.tugraz.at>
[-- Attachment #1: Type: text/plain, Size: 2659 bytes --]
Leo Prikler <leo.prikler@student.tugraz.at> writes:
> Am Dienstag, den 23.02.2021, 20:07 +0000 schrieb Christopher Baines:
>> These changes were sent upstream as
>> https://lists.gnu.org/archive/html/guile-devel/2021-02/msg00004.html
>>
>> Without this change, the .go files are built for the host
>> architecture, rather
>> than the target. I noticed this when cross building the
>> guix-build-coordinator (for which guile-lib is an input) to the Hurd.
>>
>> * gnu/packages/guile-xyz.scm (guile-lib)[arguments]: Add
>> 'patch-for-cross-compilation phase.
>> [native-inputs]: Add autoconf, automake and gettext.
>> ---
>> gnu/packages/guile-xyz.scm | 19 ++++++++++++++++++-
>> 1 file changed, 18 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
>> index ce5aad8ec7..e9dfc6cc8d 100644
>> --- a/gnu/packages/guile-xyz.scm
>> +++ b/gnu/packages/guile-xyz.scm
>> @@ -2194,6 +2194,20 @@ library.")
>> '("GUILE_AUTO_COMPILE=0") ; to prevent guild errors
>> #:phases
>> (modify-phases %standard-phases
>> + (add-after 'unpack 'patch-for-cross-compilation
>> + (lambda _
>> + (substitute* "configure.ac"
>> + (("GUILE_FLAGS")
>> + "GUILE_FLAGS
>> +if test \"$cross_compiling\" != no; then
>> + GUILE_TARGET=\"--target=$host_alias\"
>> + AC_SUBST([GUILE_TARGET])
>> +fi
>> +"))
>> + (substitute* "am/guile.mk"
>> + (("guild compile") "guild compile $(GUILE_TARGET)"))
>> + (invoke "autoreconf" "-vif")
>
> Invoking autoreconf seems a bit overkill for a "patch-<something>"
> phase. Wouldn't it be regenerated in bootstrap if you (delete-file
> "configure")?
Yeah, this works as well. I've changed this phase to delete the
configure file instead.
>> + #t))
>> (add-before 'configure 'patch-module-dir
>> (lambda _
>> (substitute* "src/Makefile.in"
>> @@ -2204,7 +2218,10 @@ library.")
>> $(libdir)/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n"))
>> #t)))))
>> (native-inputs
>> - `(("guile" ,guile-3.0)
>> + `(("autoconf" ,autoconf)
>> + ("automake" ,automake)
>> + ("gettext" ,gettext-minimal)
>> + ("guile" ,guile-3.0)
>> ("pkg-config" ,pkg-config)))
>> (inputs
>> `(("guile" ,guile-3.0)))
>
> Otherwise LGTM, but I haven't checked cross-compiling. From your
> message I'll assume you did.
Turns out I broke guile2.0-lib and guile2.2-lib, so I've sent another
patch which fixes that.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]
next prev parent reply other threads:[~2021-02-24 8:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 20:07 [bug#46725] [PATCH] gnu: guile-lib: Fix cross compilation Christopher Baines
2021-02-24 7:58 ` Leo Prikler
2021-02-24 8:45 ` Christopher Baines [this message]
2021-02-24 8:37 ` Christopher Baines
2021-03-02 19:20 ` Ludovic Courtès
2021-03-04 13:16 ` Maxim Cournoyer
2021-03-08 14:22 ` Ludovic Courtès
2021-03-08 22:11 ` bug#46725: " Christopher Baines
2021-03-11 21:01 ` [bug#46725] " Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czwplupv.fsf@cbaines.net \
--to=mail@cbaines.net \
--cc=46725@debbugs.gnu.org \
--cc=leo.prikler@student.tugraz.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).