pkgname=go pkgver=1.23.4 pkgrel=1 pkgdesc="Core compiler tools for the Go programming language" arch=('x86_64') url="https://golang.org" license=('BSD-3-Clause') depends=('bash') options=('!strip') source=(https://go.dev/dl/${pkgname}${pkgver}.linux-amd64.tar.gz) sha256sums=(6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971) 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 }