### this file is sourced not run
PKGVER=1.17.6
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=go${PKGVER}.linux-amd64.tar.gz
MD5SUM=ba9a4d13dc119a953901984292efd713
SRC_URL=https://go.dev/dl/$TARBALL
BUNDLE=

SLACKREQ=
SLACKDESC="golang: golang $PKGVER (Go language compiler)
golang: 
golang: This is the compiler for Go language. It a re-packaged official 
golang: binary. Installs to /opt/go. Note: gcc has an older 'go' binary
golang: as well, so use PATH=/opt/go/bin:\$PATH to use golang's go
golang: instead of gcc's one.
golang: 
golang: https://go.dev/
golang: https://go.dev/dl/
golang: 
golang: 
"

PKG_NOSTRIP=yes # see: https://github.com/golang/go/issues/50509

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	# make sure these things don't exist
	rm -rf /opt/go /opt/go-$PKGVER &&

	mv /tmp/go /opt/go-$PKGVER &&
	ln -s go-$PKGVER /opt/go &&

	mkdir -p /etc/profile.d &&
	echo 'PATH=/opt/go/bin:$PATH' > /etc/profile.d/golang.sh &&
	chmod +x /etc/profile.d/golang.sh &&

	pkg_build_slackdesc
}


