# Maintainer: Morten Linderud # Contributor: Daniel Martí # Contributor: Bartłomiej Piotrowski # Contributor: Alexander F. Rødseth # Contributor: Pierre Neidhardt # Contributor: Vesa Kaihlavirta # Contributor: Rémy Oudompheng # Contributor: Andres Perera # Contributor: Matthew Bauer # Contributor: Christian Himpel # Contributor: Mike Rosset # Contributor: Daniel YC Lin # Contributor: John Luebs #Included in Slint by Didier Spaier didieratslintdotfr pkgname=google-go-lang epoch=2 pkgver=1.22.0 pkgrel=1slint slackdesc="$pkgname (Core compiler tools for the Go programming language)" url='https://golang.org/' license=(BSD-3-Clause) makedepends=(git go) replaces=(go-pie) provides=(go-pie) source=(https://go.dev/dl/go${pkgver}.src.tar.gz{,.asc}) validpgpkeys=('EB4C1BFD4F042F6DDDCCEC917721F63BD38B4796') sha256sums=('00197ab20f33813832bff62fd93cca1c42a08cc689a32a6672ca49591959bff6' 'SKIP') docs=("README.*" LICENSE PATENTS) optiond=("nosrcpack") build() { 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 cd "$SRC/$pkgname" [ -f README.md ] && pandoc -f gfm -t html5 -o README.html README.md cd "$SRC/$pkgname/src" ./make.bash -v cd "$SRC/$pkgname" install -d "$PKG/usr/bin" "$PKG/usr/lib64/go" "$PKG/usr/share/doc/go" \ "$PKG/usr/lib64/go/pkg/linux_amd64_"{dynlink,race} cp -a bin pkg src lib misc api test "$PKG/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 "$PKG/usr/lib64/go"{/bin/*,/pkg/tool/*/*} cp -r doc/* "$PKG/usr/doc/go" ln -sf /usr/lib64/go/bin/go "$PKG/usr/bin/go" ln -sf /usr/lib64/go/bin/gofmt "$PKG/usr/bin/gofmt" ln -sf /usr/share/doc/go "$PKG/usr/lib64/go/doc" install -Dm644 VERSION "$PKG/usr/lib64/go/VERSION" rm -rf "$PKG/usr/lib64/go/pkg/bootstrap" "$PKG/usr/lib64/go/pkg/tool/*/api" # TODO: Figure out if really needed rm -rf "$PKG"/usr/lib64/go/pkg/obj/go-build # https://github.com/golang/go/issues/57179 install -Dm644 go.env "$PKG/usr/lib64/go/go.env" # Put the profile scripts for setting PATH and env variables mkdir -p $PKG/etc/profile.d cat > $PKG/etc/profile.d/go.csh << EOF #!/bin/csh setenv GOROOT ${GOROOT_FINAL} setenv PATH \${GOROOT}/bin:\${PATH} EOF cat > $PKG/etc/profile.d/go.sh << EOF #!/bin/sh export GOROOT="${GOROOT_FINAL}" export PATH="\${GOROOT}/bin:\${PATH}" EOF chmod 0755 $PKG/etc/profile.d/go.csh chmod 0755 $PKG/etc/profile.d/go.sh }