From 736e4b7989b0e3300d174f0891c4d9c342e0ca1c Mon Sep 17 00:00:00 2001 From: Eivind Uggedal Date: Fri, 8 May 2015 09:34:06 +0000 Subject: [PATCH] go: fix musl build --- srcpkgs/go/patches/no-longjmp-redefine.patch | 12 ++++++++++++ srcpkgs/go/template | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/go/patches/no-longjmp-redefine.patch diff --git a/srcpkgs/go/patches/no-longjmp-redefine.patch b/srcpkgs/go/patches/no-longjmp-redefine.patch new file mode 100644 index 00000000000..148341e0f8a --- /dev/null +++ b/srcpkgs/go/patches/no-longjmp-redefine.patch @@ -0,0 +1,12 @@ +--- include/libc.h.orig ++++ include/libc.h +@@ -102,7 +102,10 @@ extern void sysfatal(char*, ...); + #define atoll p9atoll + #define getenv p9getenv + #define getwd p9getwd ++#ifdef longjmp ++#undef longjmp ++#endif + #define longjmp p9longjmp + #undef setjmp + #define setjmp p9setjmp diff --git a/srcpkgs/go/template b/srcpkgs/go/template index 0baa24c0d88..8bc0b5f7103 100644 --- a/srcpkgs/go/template +++ b/srcpkgs/go/template @@ -15,6 +15,8 @@ nostrip=yes noverifyrdeps=yes _go_targetarch() { + local hostarch targetarch + case "$XBPS_MACHINE" in arm*) export hostarch=arm;; i686*) export hostarch=386;; @@ -32,7 +34,7 @@ _go_targetarch() { do_build() { unset GCC CC CXX LD CFLAGS - targetarch=$(_go_targetarch) + local targetarch=$(_go_targetarch) export GOROOT=$PWD export GOROOT_FINAL="/usr/lib/go" export GOOS= @@ -66,6 +68,8 @@ do_build() { } do_install() { + local bindir + if [ "$CROSS_BUILD" ]; then case "$XBPS_TARGET_MACHINE" in arm*) bindir=bin/linux_arm;; @@ -106,7 +110,7 @@ go-cross-linux_package() { depends="${sourcepkg}-${version}_${revision}" short_desc+=" - Cross compilers for Linux" pkg_install() { - targetarch=$(_go_targetarch) + local targetarch=$(_go_targetarch) mkdir -p $PKGDESTDIR/usr/lib/go/pkg/tool/ cd ${DESTDIR}/usr/lib/go/pkg/tool/ for i in linux_*; do