diff options
Diffstat (limited to 'development/google-go-lang')
-rw-r--r-- | development/google-go-lang/google-go-lang.SlackBuild | 192 | ||||
-rw-r--r-- | development/google-go-lang/google-go-lang.info | 10 |
2 files changed, 174 insertions, 28 deletions
diff --git a/development/google-go-lang/google-go-lang.SlackBuild b/development/google-go-lang/google-go-lang.SlackBuild index 117ddef8b3..50a4c3a14b 100644 --- a/development/google-go-lang/google-go-lang.SlackBuild +++ b/development/google-go-lang/google-go-lang.SlackBuild @@ -29,7 +29,9 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=google-go-lang -VERSION=${VERSION:-1.17.9} +VERSION=${VERSION:-1.22.7} +BOOTSTRAP_VERSION=${BOOTSTRAP_VERSION:-1.19.13} +BOOTSTRAP_VERSION2=${BOOTSTRAP_VERSION2:-1.21.12} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -55,15 +57,15 @@ elif [ "$ARCH" = "x86_64" ]; then elif [ "$ARCH" = "arm" ]; then LIBDIRSUFFIX="" GOARCH="arm" - export GOARM="6" # can be '5' as well, to use soft float instead of hardware + export GOARM="7" # can be '5' as well, to use soft float instead of hard float +elif [ "$ARCH" = "aarch64" ]; then + LIBDIRSUFFIX="64" + GOARCH="arm64" else LIBDIRSUFFIX="" GOARCH=386 fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -76,7 +78,138 @@ OUTPUT=${OUTPUT:-/tmp} set -e rm -rf $PKG -mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX}/go${VERSION} $OUTPUT + +CGO_MINOR_VERSION="$(/usr/bin/go version | awk '{ print $3 }' | sed 's/go//' | awk -F. '{ print $2 }')" +if [[ $CGO_MINOR_VERSION -lt 18 ]] ; then + mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION} $OUTPUT + cd $PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION} + tar xvf $CWD/go${BOOTSTRAP_VERSION}.src.tar.gz + cd go + chown -R root:root . + find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + + # 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 + + # Not sure why, but this causes run.bash to fail --rworkman + unset BASH_ENV + + # gcc 5+ is go1.4 API, so we'll bootstrap with it + export GOROOT_BOOTSTRAP="/usr" + + # 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 + GOROOT="$(pwd)" + export GOROOT + + # The value of GOROOT once the package is installed + export GOROOT_FINAL="/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION}/go" + + case "$ARCH" in + arm|i?86) export GOMAXPROCS=1 ;; + esac + + cd src + + if [[ "${RUN_TEST}" = "true" ]] ; then + LC_ALL=C \ + ./all.bash + else + LC_ALL=C \ + ./make.bash + fi + + # As of go1.5, golang supports shared libraries, so generate them for use. + $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 +fi + +if [[ $CGO_MINOR_VERSION -lt 20 ]] ; then + mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION2} $OUTPUT + cd $PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION2} + tar xvf $CWD/go${BOOTSTRAP_VERSION2}.src.tar.gz + cd go + chown -R root:root . + find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + + # 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 + + # Not sure why, but this causes run.bash to fail --rworkman + unset BASH_ENV + + # gcc 5+ is go1.4 API, so we'll bootstrap with it + if [[ $CGO_MINOR_VERSION -lt 18 ]] ; then + export GOROOT_BOOTSTRAP="$PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION}/go" + else + 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 + GOROOT="$(pwd)" + export GOROOT + + # The value of GOROOT once the package is installed + export GOROOT_FINAL="/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION2}/go" + + case "$ARCH" in + arm|i?86) export GOMAXPROCS=1 ;; + esac + + cd src + + if [[ "${RUN_TEST}" = "true" ]] ; then + LC_ALL=C \ + ./all.bash + else + LC_ALL=C \ + ./make.bash + fi + + # As of go1.5, golang supports shared libraries, so generate them for use. + $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 +fi + +# remove bootstrap +if [[ $CGO_MINOR_VERSION -lt 18 ]] ; then + rm -rf $PKG/usr/lib$LIBDIRSUFFIX/go$BOOTSTRAP_VERSION +fi + +mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/go${VERSION} $OUTPUT cd $PKG/usr/lib${LIBDIRSUFFIX}/go${VERSION} tar xvf $CWD/go${VERSION}.src.tar.gz cd go @@ -94,19 +227,10 @@ unset GOBIN GOPATH GOOS GOARCH # 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" +# gcc 5+ is go1.4 API, so we'll bootstrap with it +if [[ $CGO_MINOR_VERSION -lt 20 ]] ; then + export GOROOT_BOOTSTRAP="$PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION2}/go" else - # gcc 5+ is go1.4 API, so we'll bootstrap with it export GOROOT_BOOTSTRAP="/usr" fi @@ -114,24 +238,33 @@ fi # which is the current directory we're in. # Defining it here means we can use it below when building # shared libraries -export GOROOT="$(pwd)" +GOROOT="$(pwd)" +export GOROOT # The value of GOROOT once the package is installed export GOROOT_FINAL="/usr/lib${LIBDIRSUFFIX}/go${VERSION}/go" +case "$ARCH" in + arm|i?86) export GOMAXPROCS=1 ;; +esac + cd src -if [ "x${RUN_TEST}" = "xtrue" ] ; then - LC_ALL=C \ - ./all.bash +if [[ "${RUN_TEST}" = "true" ]] ; then + LC_ALL=C \ + ./all.bash else - LC_ALL=C \ - ./make.bash + LC_ALL=C \ + ./make.bash fi # As of go1.5, golang supports shared libraries, so generate them for use. $GOROOT/bin/go install -buildmode=shared std +find $PKG/$GOROOT_FINAL -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +find $PKG/$GOROOT_FINAL -type f -name "*.so" -exec chmod +x {} \; 2> /dev/null || true + cd .. # remove Go build cache @@ -140,8 +273,17 @@ rm -rf pkg/obj/go-build/* # remove the doc Makefile rm -f doc/Makefile +# remove tests, nothing needs these at runtime +find $PKG/$GOROOT_FINAL/src -type d -name "testdata" -exec rm -rf {} + +find $PKG/$GOROOT_FINAL/src -type f -name "*_test.go" -exec rm -rf {} + + mkdir -p $PKG$GOROOT_FINAL +# remove bootstrap +if [[ $CGO_MINOR_VERSION -lt 20 ]] ; then + rm -rf $PKG/usr/lib$LIBDIRSUFFIX/go$BOOTSTRAP_VERSION2 +fi + # Put the profile scripts for setting PATH and env variables mkdir -p $PKG/etc/profile.d cat > $PKG/etc/profile.d/go.csh << EOF @@ -160,7 +302,7 @@ chmod 0755 $PKG/etc/profile.d/go.sh mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ - AUTHORS CONTRIBUTING.md CONTRIBUTORS LICENSE PATENTS README.md VERSION \ + CONTRIBUTING.md LICENSE PATENTS README.md SECURITY.md VERSION \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild diff --git a/development/google-go-lang/google-go-lang.info b/development/google-go-lang/google-go-lang.info index 466fbc9e10..b8f3b64315 100644 --- a/development/google-go-lang/google-go-lang.info +++ b/development/google-go-lang/google-go-lang.info @@ -1,8 +1,12 @@ PRGNAM="google-go-lang" -VERSION="1.17.9" +VERSION="1.22.7" HOMEPAGE="http://golang.org" -DOWNLOAD="https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz https://storage.googleapis.com/golang/go1.17.9.src.tar.gz" -MD5SUM="dbf727a4b0e365bf88d97cbfde590016 f18e366bc6b56244591a4f4af4624363" +DOWNLOAD="https://storage.googleapis.com/golang/go1.22.7.src.tar.gz \ + https://storage.googleapis.com/golang/go1.21.12.src.tar.gz \ + https://storage.googleapis.com/golang/go1.19.13.src.tar.gz" +MD5SUM="59f70fbfefc4fd6d5ec1f1fd6ca81c32 \ + bb790f2c7b1ee800ab06b4093ce4929e \ + 6d3625cac26503932002b98eae2d0001" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" |