Was supposed to be a linux distribution, now just a collection of build scripts for packages on top of (ideally) any distribution.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB

name=go
version=1.7.1
bootstrap_version=1.4.3
update_url='https://golang.org/dl/'
define_option '!bootstrap: Build for the first time'
dlextract "https://storage.googleapis.com/golang/$name$version.src.tar.gz" \
'433e2158e5c28fe24b11622df393cc46'
if option bootstrap; then
download "https://storage.googleapis.com/golang/$name$bootstrap_version.src.tar.gz" \
'dfb604511115dd402a77a553a5923a04'
fi
header_end
if option bootstrap; then
mkdir bootstrap; cd bootstrap
extract "$name$bootstrap_version.src.tar.gz"
cd "$name/src"
CGO_ENABLED=0 ./make.bash
cd ..
GOROOT_BOOTSTRAP="$PWD"
cd ../..
else
GOROOT_BOOTSTRAP="$dir_sysroot/$dir_prefix/$dir_libdir/$name"
fi
cd "$name/src"
GOROOT_BOOTSTRAP="$GOROOT_BOOTSTRAP" \
GOROOT_FINAL="$dir_sysroot/$dir_prefix/$dir_libdir/$name" \
./make.bash
cd ..
rm -rf pkg/bootstrap pkg/obj
mkdir -p "$dir_install/$dir_prefix/$dir_libdir/$name"
cp -at "$dir_install/$dir_prefix/$dir_libdir/$name" bin pkg src
# Create symlinks
mkdir -p "$dir_install/$dir_prefix/$dir_bindir"
for x in bin/*; do
ln -s "$dir_sysroot/$dir_prefix/$dir_libdir/$name/$x" "$dir_install/$dir_prefix/$dir_bindir/$(basename "$x")"
done
# Set global GOPATH for external libraries
echo "export GOPATH=\"$dir_sysroot/$dir_prefix/$dir_libdir/$name/site\"" > go.sh
install -Dm755 -t "$dir_install/$dir_sysconfdir/profile.d" go.sh
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: