new go port

This commit is contained in:
Alexander Zhirov 2024-03-24 22:11:07 +03:00
parent 9b2ba843bd
commit 6f0a3365a8
2 changed files with 39 additions and 0 deletions

1
ports/g/go/.nostrip Normal file
View File

@ -0,0 +1 @@
.*

38
ports/g/go/Pkgfile Normal file
View File

@ -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
}