# Compiling Time: 0.16 SBU # Maintainer: DeX77 pkgname=go pkgver=1.16.6 pkgrel=1 go_bootstrap_ver=1.4.3 pkgdesc='Compiler and tools for the Go programming language from Google' archs=('x86_64') groups=('devel-extra') url='http://golang.org/' depends=('perl>=5.28.2' 'gawk') makedepends=('git') Fpkgversep="" _F_archive_prefix=".src" _F_cd_path="go/src" _F_archive_grepv="beta\|alpha\|rc[1-9]" up2date="Flastarchive $url/dl/ .src.tar.gz" options=('nostrip' 'scriptlet') source=(https://storage.googleapis.com/golang/go${pkgver}.src.tar.gz \ go.sh) sha1sums=('047772552a78bb6d20682425e38d43dc4d94ad3f' \ 'a760c32cbad5a013f384a086efb3b8b8fd88794f') build() { export GOROOT="$Fsrcdir/$pkgname" export GOPATH="$Fsrcdir/gopath" export GOROOT_FINAL="/usr/lib/go" export GOROOT_BOOTSTRAP="$Fsrcdir/$pkgname${go_bootstrap_ver}" mkdir $GOROOT_BOOTSTRAP export GOARCH=amd64 Fcd Fexec wget https://storage.googleapis.com/golang/go${go_bootstrap_ver}.linux-amd64.tar.gz || Fdie Fexec tar -zxvf go${go_bootstrap_ver}.linux-amd64.tar.gz -C $GOROOT_BOOTSTRAP || Fdie export GOROOT_BOOTSTRAP="$GOROOT_BOOTSTRAP/go" Fexec bash make.bash --no-clean || Fdie Fmkdir usr/share/go Fcp go/doc usr/share/go Fcp go/misc usr/share/go Fln usr/share/go/doc usr/lib/go/doc Fmkdir usr/bin Fexe go/bin/go usr/bin/ Fexe go/bin/gofmt usr/bin/ Fcp go/pkg/ usr/lib/go/ # Remove obj files Frm usr/lib/go/pkg/obj/ Fmkdir usr/lib/go/src Fcpr go/src usr/lib/go Fmkdir usr/lib/go/src/cmd Fcp "go/src/cmd/*" usr/lib/go/src/cmd Fcpr go/lib usr/lib/go Finstall 644 go/src/Make.* usr/lib/go/src # Remove object files from target src dir find "${Fdestdir}/usr/lib/go/src/" -type f -name '*.[ao]' -delete # For packages that source /etc/profile.d/go.sh Finstall 755 "$pkgname.sh" /etc/profile.d/$pkgname.sh # This is to make go get code.google.com/p/go-tour/gotour and # then running the gotour executable work out of the box. Fln /usr/bin /usr/lib/go/bin # Chmod *.a files Ffileschmod "usr/lib/go/pkg/linux_${GOARCH}/" 755 Ffileschmod "usr/lib/go/pkg/tool/linux_${GOARCH}/" 755 # For godoc Finstall 644 go/favicon.ico usr/lib/go/favicon.ico Frm usr/share/go/doc/articles/wiki/get.bin } # optimization OK