|
|
@ -1,6 +1,6 @@ |
|
|
|
#!/bin/bash |
|
|
|
# Build script for Slackware |
|
|
|
# Copyright (C) 2017,2019 Damien Goutte-Gattat |
|
|
|
# Copyright (C) 2017,2019,2020 Damien Goutte-Gattat |
|
|
|
# |
|
|
|
# Redistribution and use of this script, with or without modifications, |
|
|
|
# is permitted provided that the following conditions are met: |
|
|
@ -26,9 +26,9 @@ |
|
|
|
|
|
|
|
# Source package infos |
|
|
|
NAMESRC=${NAMESRC:-go} |
|
|
|
VERSION=${VERSION:-1.13.4} |
|
|
|
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz} |
|
|
|
GITREPO=${GITREPO:-https://go.googlesource.com/go} |
|
|
|
VERSION=${VERSION:-1.14.4} |
|
|
|
ARCHIVE=${ARCHIVE:-$NAMESRC$VERSION.src.tar.gz} |
|
|
|
WGET=${WGET:-https://dl.google.com/go/$ARCHIVE} |
|
|
|
|
|
|
|
# Build infos |
|
|
|
NAMEPKG=${NAMEPKG:-golang} |
|
|
@ -64,24 +64,19 @@ fi |
|
|
|
|
|
|
|
# Get and verify the source archive |
|
|
|
if [ ! -r $ARCHIVE ]; then |
|
|
|
git clone $GITREPO gosrc |
|
|
|
cd gosrc |
|
|
|
git archive --prefix=go-$VERSION/ go$VERSION | gzip -c > ../$ARCHIVE |
|
|
|
cd .. |
|
|
|
rm -rf gosrc |
|
|
|
wget -c -O $ARCHIVE.part "$WGET" |
|
|
|
mv $ARCHIVE.part $ARCHIVE |
|
|
|
fi |
|
|
|
sha256sum -c $ARCHIVE.sha256 |
|
|
|
|
|
|
|
# Compile |
|
|
|
cd $TMP |
|
|
|
mkdir -p $PKG/opt |
|
|
|
cd $PKG/opt |
|
|
|
echo "Building $ARCHIVE..." |
|
|
|
tar xf $CWD/$ARCHIVE |
|
|
|
cd go-$VERSION/src |
|
|
|
cd go/src |
|
|
|
export GOROOT_BOOTSTRAP |
|
|
|
TMPDIR=$TMP GOROOT_FINAL=/opt/go ./all.bash |
|
|
|
cd ../.. |
|
|
|
mkdir -p $PKG/opt |
|
|
|
mv go-$VERSION $PKG/opt/go |
|
|
|
|
|
|
|
# Remove go-build files |
|
|
|
rm -rf $PKG/opt/go/pkg/obj/go-build |
|
|
@ -104,7 +99,6 @@ PACKAGING=" |
|
|
|
chown root:root . -R |
|
|
|
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT |
|
|
|
rm -rf $PKG |
|
|
|
rm -rf $TMP/go $TMP/go-$VERSION |
|
|
|
" |
|
|
|
if type -p fakeroot ; then |
|
|
|
echo "$PACKAGING" | fakeroot |
|
|
|