summaryrefslogtreecommitdiff
path: root/repo/devel/go/go.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
committerdavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
commit739c65c54cb0e957df5e9b76f93fb02554e5cac3 (patch)
tree09ddfa0a342f3ea9de136cb50abdd79821bf1b53 /repo/devel/go/go.xibuild
parent4c585ad54388285500fd18a6aaa516894e0f2c16 (diff)
moved everything to new file formatting
Diffstat (limited to 'repo/devel/go/go.xibuild')
-rw-r--r--repo/devel/go/go.xibuild67
1 files changed, 67 insertions, 0 deletions
diff --git a/repo/devel/go/go.xibuild b/repo/devel/go/go.xibuild
new file mode 100644
index 0000000..9a5f1b7
--- /dev/null
+++ b/repo/devel/go/go.xibuild
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+# Ensure we have gcc-go
+MAKEDEPS="make gcc"
+DEPS=""
+
+PKG_VER=1.17.7
+SOURCE=https://go.dev/dl/go$PKG_VER.src.tar.gz
+
+BOOTSTRAP="go1.4-bootstrap-20171003"
+ADDITIONAL="
+ https://dl.google.com/go/$BOOTSTRAP.tar.gz
+"
+
+DESC="Core compiler tools for the Go programming language"
+
+prepare () {
+ export TMPDIR=/tmp
+ tar -xvf $BOOTSTRAP.tar.gz
+ mv go $BOOTSTRAP
+}
+
+build () {
+ export sourceroot=$(pwd)
+ export GOARCH=amd64
+ export GOAMD64=v1 # make sure we're building for the right x86-64 version
+ export GOOS="linux"
+
+ cd $BOOTSTRAP
+ cd src
+ echo "~~~~BUILDING BOOTSTRAP"
+ CGO_ENABLED=0 ./make.bash -v
+
+ cd $sourceroot
+ export GOROOT_FINAL=/usr/lib/go
+ export GOROOT_BOOTSTRAP="$(pwd)/$BOOTSTRAP"
+
+ echo "~~~~BUILDING GOLANG"
+ cd src
+ if [ ! -z "${GOROOT_BOOTSTRAP}" ]; then
+ ./bootstrap.bash -v
+ fi
+ ./make.bash -v
+ cd ..
+}
+
+package () {
+ install -d "$PKG_DEST/usr/bin" "$PKG_DEST/usr/lib/go" "$PKG_DEST/usr/share/doc/go" \
+ "$PKG_DEST/usr/lib/go/pkg/linux_amd64_"dynlink \
+ "$PKG_DEST/usr/lib/go/pkg/linux_amd64_"race
+
+ cp -a bin pkg src lib misc api test "$PKG_DEST/usr/lib/go"
+ cp -r doc/* "$PKG_DEST/usr/share/doc/go"
+
+ ln -sf /usr/lib/go/bin/go "$PKG_DEST/usr/bin/go"
+ ln -sf /usr/lib/go/bin/gofmt "$PKG_DEST/usr/bin/gofmt"
+ ln -sf /usr/share/doc/go "$PKG_DEST/usr/lib/go/doc"
+
+ install -Dm644 VERSION "$PKG_DEST/usr/lib/go/VERSION"
+
+ rm -rf "$PKG_DEST/usr/lib/go/pkg/bootstrap" "$PKG_DEST/usr/lib/go/pkg/tool/*/api"
+
+ # TODO: Figure out if really needed
+ rm -rf "$PKG_DEST"/usr/lib/go/pkg/obj/go-build/*
+
+ install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/$pkgname/LICENSE"
+}