diff --git a/ports/g/go/.nostrip b/ports/g/go/.nostrip new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/ports/g/go/.nostrip @@ -0,0 +1 @@ +.* diff --git a/ports/g/go/Pkgfile b/ports/g/go/Pkgfile new file mode 100644 index 0000000..a371755 --- /dev/null +++ b/ports/g/go/Pkgfile @@ -0,0 +1,38 @@ +# Description: The Go Programming Language +# URL: https://go.dev/ +# Maintainer: Alexander Zhirov + +name=go +version=1.22.1 +release=1 +source=( + https://golang.org/dl/go${version}.src.tar.gz + https://golang.org/dl/go${version}.linux-amd64.tar.gz +) + +unpack_source() { + install -d $SRC/go${version} + bsdtar -xf $PKGMK_SOURCE_DIR/go${version}.linux-amd64.tar.gz \ + -C $SRC/go${version} --strip-components=1 + bsdtar -xf $PKGMK_SOURCE_DIR/go${version}.src.tar.gz \ + -C $SRC +} + +build() { + export GOCACHE=$SRC/go-build + export GOROOT_BOOTSTRAP=$SRC/go${version} + export GOROOT_FINAL=/usr/lib/go + + cd go/src + ./make.bash + + install -d $PKG/usr/lib + mv $SRC/go $PKG/usr/lib/ + + install -d $PKG/usr/bin + ln -s /usr/lib/go/bin/go $PKG/usr/bin/ + ln -s /usr/lib/go/bin/gofmt $PKG/usr/bin/ + + find $PKG \( -name "README*" -o -name "AUTHORS" -o -name "TODO" \) -delete + rm $PKG/usr/lib/go/src/*.bat +}