From de4f5df95db6c2e7071bf5e44c0d7ae928da1025 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 26 Apr 2021 21:13:06 +0300 Subject: build/go: Support cross compiling. * guix/build-system/go.scm (go-target): New procedure. (go-build): Add goarch, goos keywords. Adjust bag depending if doing a native or cross compile. (go-cross-build): New procedure. * guix/build/go-build-system.scm (setup-go-environment): Accept goarch, goos keywords. Set go environment variables based on target architecture. * doc/guix.texi (Build Systems): Mention new go-build-system keywords. --- doc/guix.texi | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 220499503d..2fc9687910 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7759,6 +7759,13 @@ Packages that provide Go libraries should install their source code into the built output. The key @code{#:install-source?}, which defaults to @code{#t}, controls whether or not the source code is installed. It can be set to @code{#f} for packages that only provide executable files. + +Packages can be cross-built, and if a specific architecture or operating +system is desired then the keywords @code{#:goarch} and @code{#:goos} +can be used to force the package to be built for that architecture and +operating system. The combinations known to Go can be found +@url{"https://golang.org/doc/install/source#environment", in their +documentation}. @end defvr @defvr {Scheme Variable} glib-or-gtk-build-system -- cgit v1.2.1