summaryrefslogtreecommitdiff
path: root/go/Pkgfile
diff options
context:
space:
mode:
Diffstat (limited to 'go/Pkgfile')
-rw-r--r--go/Pkgfile42
1 files changed, 42 insertions, 0 deletions
diff --git a/go/Pkgfile b/go/Pkgfile
new file mode 100644
index 0000000..e00b7d8
--- /dev/null
+++ b/go/Pkgfile
@@ -0,0 +1,42 @@
+# Description: The Go Programming Language
+# URL: https://golang.org/
+# Maintainer: Aaron Ball, nullspoon at oper dot io
+
+name=go
+version=1.15.4
+release=1
+bootstrap_version=1.11.8
+source=(https://storage.googleapis.com/golang/go${bootstrap_version}.linux-arm64.tar.gz \
+ https://storage.googleapis.com/golang/${name}${version}.src.tar.gz)
+
+unpack_source() {
+ install -d $SRC/go${bootstrap_version%.*}
+ bsdtar -xf $PKGMK_SOURCE_DIR/${name}${bootstrap_version}.linux-arm64.tar.gz \
+ -C $SRC/go${bootstrap_version%.*} --strip-components 1
+ bsdtar -xf $PKGMK_SOURCE_DIR/${name}${version}.src.tar.gz \
+ -C $SRC
+}
+
+build() {
+ export GOROOT_BOOTSTRAP=${SRC}/go${bootstrap_version%.*}
+ export GOROOT_FINAL=/usr/lib/go
+ export GOOS=linux
+ export GOARCH=arm64
+ export GOCACHE=off
+
+ cd go/src
+ bash make.bash --no-clean
+
+ rm -rf $SRC/go/pkg/obj/go-build/*
+
+ install -d $PKG/usr/lib
+ cp -r $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 "*.a" -o -name "*.go" \) -exec chmod 644 '{}' \;
+ find $PKG \( -name "README*" -o -name "AUTHORS" -o -name "TODO" \) -delete
+ rm $PKG/usr/lib/go/src/*.bat
+}

Generated by cgit