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.4
bootstrap_version=1.4.3
update_url='https://golang.org/dl/'
define_option '!bootstrap: Bootstrap this program'
dlextract "https://storage.googleapis.com/golang/$name$version.src.tar.gz" \
'49c1076428a5d3b5ad7ac65233fcca2f'
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 expandtab: