summaryrefslogtreecommitdiff
path: root/go/Pkgfile
blob: e00b7d89438c79fa37293a4cd1ac4cf9f9131be5 (plain)
    1 # Description: The Go Programming Language
    2 # URL: https://golang.org/
    3 # Maintainer: Aaron Ball, nullspoon at oper dot io
    4 
    5 name=go
    6 version=1.15.4
    7 release=1
    8 bootstrap_version=1.11.8
    9 source=(https://storage.googleapis.com/golang/go${bootstrap_version}.linux-arm64.tar.gz \
   10     https://storage.googleapis.com/golang/${name}${version}.src.tar.gz)
   11 
   12 unpack_source() {
   13     install -d $SRC/go${bootstrap_version%.*}
   14     bsdtar -xf $PKGMK_SOURCE_DIR/${name}${bootstrap_version}.linux-arm64.tar.gz \
   15         -C $SRC/go${bootstrap_version%.*} --strip-components 1
   16     bsdtar -xf $PKGMK_SOURCE_DIR/${name}${version}.src.tar.gz \
   17         -C $SRC
   18 }
   19 
   20 build() {
   21     export GOROOT_BOOTSTRAP=${SRC}/go${bootstrap_version%.*}
   22     export GOROOT_FINAL=/usr/lib/go
   23     export GOOS=linux
   24     export GOARCH=arm64
   25     export GOCACHE=off
   26 
   27     cd go/src
   28     bash make.bash --no-clean
   29 
   30     rm -rf $SRC/go/pkg/obj/go-build/*
   31 
   32     install -d $PKG/usr/lib
   33     cp -r $SRC/go $PKG/usr/lib/
   34 
   35     install -d $PKG/usr/bin
   36     ln -s /usr/lib/go/bin/go $PKG/usr/bin/
   37     ln -s /usr/lib/go/bin/gofmt $PKG/usr/bin/
   38 
   39     find $PKG \( -name "*.a" -o -name "*.go" \) -exec chmod 644 '{}' \;
   40     find $PKG \( -name "README*" -o -name "AUTHORS" -o -name "TODO" \) -delete
   41     rm $PKG/usr/lib/go/src/*.bat
   42 }

Generated by cgit