summaryrefslogtreecommitdiffstats
path: root/development/google-go-lang/google-go-lang.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/google-go-lang/google-go-lang.SlackBuild')
-rw-r--r--development/google-go-lang/google-go-lang.SlackBuild37
1 files changed, 34 insertions, 3 deletions
diff --git a/development/google-go-lang/google-go-lang.SlackBuild b/development/google-go-lang/google-go-lang.SlackBuild
index 2207e81595..69a1fef84a 100644
--- a/development/google-go-lang/google-go-lang.SlackBuild
+++ b/development/google-go-lang/google-go-lang.SlackBuild
@@ -27,7 +27,7 @@
# SOFTWARE.
PRGNAM=google-go-lang
-VERSION=${VERSION:-1.14.14}
+VERSION=${VERSION:-1.16.4}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -80,10 +80,33 @@ find -L . \
# as of >= go1.5, the cross-compiler does not need to be bootstrap, so the
# compiler need only be compiled for the host OS, which it detects
unset GOBIN GOPATH GOOS GOARCH
-unset BASH_ENV # Not sure why, but this causes run.bash to fail --rworkman
-export GOROOT_BOOTSTRAP="/usr" # gcc 5+ is go1.4 API, so we'll bootstrap with it
+# Not sure why, but this causes run.bash to fail --rworkman
+unset BASH_ENV
+
+if [ "$ARCH" = "i586" ]; then
+ # issue with gccgo+go1.16 on x86
+ # https://www.linuxquestions.org/questions/showthread.php?p=6253507
+ # hopefully this is not needed forever...
+ tar -C $TMP -xf $CWD/go1.4-bootstrap-20171003.tar.gz
+ pushd $TMP/go
+ export GOROOT=$TMP/go
+ cd ./src
+ ./make.bash
+ popd
+ export GOROOT_BOOTSTRAP="$TMP/go"
+else
+ # gcc 5+ is go1.4 API, so we'll bootstrap with it
+ export GOROOT_BOOTSTRAP="/usr"
+fi
+
+# Default GOROOT is the parent directory of all.bash,
+# which is the current directory we're in.
+# Defining it here means we can use it below when building
+# shared libraries
export GOROOT="$(pwd)"
+
+# The value of GOROOT once the package is installed
export GOROOT_FINAL="/usr/lib${LIBDIRSUFFIX}/go${VERSION}/go"
cd src
@@ -101,6 +124,14 @@ $GOROOT/bin/go install -buildmode=shared std
cd ..
+# remove Go build cache
+rm -rf pkg/obj/go-build/*
+
+# remove the doc Makefile
+rm -f doc/Makefile
+
+mkdir -p $PKG$GOROOT_FINAL
+
# Put the profile scripts for setting PATH and env variables
mkdir -p $PKG/etc/profile.d
cat > $PKG/etc/profile.d/go.csh << EOF