pkgname=go pkgver=1.23.4 pkgrel=2 pkgdesc="Core compiler tools for the Go programming language" arch=('x86_64') url="https://golang.org" license=('BSD-3-Clause') depends=('bash') makedepends=('go') options=('!strip') source=(https://go.dev/dl/${pkgname}${pkgver}.src.tar.gz) sha256sums=(ad345ac421e90814293a9699cca19dd5238251c3f687980bbcae28495b263531) build() { cd ${pkgname}/src export GOARCH=amd64 export GOAMD64=v1 # make sure we're building for the right x86-64 version export GOROOT_FINAL=/usr/lib64/go export GOROOT_BOOTSTRAP=/usr/lib64/go # Should this be set by boulder automatically? export XDG_CACHE_HOME="${srcdir}/.cache" ./make.bash -v } package() { cd ${pkgname} install -vdm755 ${pkgdir}/usr/{bin,lib64/go/pkg/linux_amd64_{dynlink,race},share/doc/${pkgname}-${pkgver}} cp -av bin pkg src lib misc api test ${pkgdir}/usr/lib64/go # We can't strip all binaries and libraries, # as that also strips some testdata directories and breaks the tests. # Just strip the packaged binaries as a compromise. strip ${STRIP_BINARIES} ${pkgdir}/usr/lib64/go{/bin/*,/pkg/tool/*/*} cp -r doc/* ${pkgdir}/usr/share/doc/${pkgname}-${pkgver} ln -sf /usr/lib64/go/bin/go ${pkgdir}/usr/bin/go ln -sf /usr/lib64/go/bin/gofmt ${pkgdir}/usr/bin/gofmt ln -sf /usr/share/doc/${pkgname}-${pkgver} ${pkgdir}/usr/lib64/go/doc install -Dm644 VERSION ${pkgdir}/usr/lib64/go/VERSION rm -rf ${pkgdir}/usr/lib/go/pkg/bootstrap ${pkgdir}/usr/lib64/go/pkg/tool/*/api # TODO: Figure out if really needed rm -rf ${pkgdir}/usr/lib64/go/pkg/obj/go-build # https://github.com/golang/go/issues/57179 install -Dm644 go.env ${pkgdir}/usr/lib64/go/go.env }