42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
# Description: The Go Programming Language
|
|
# URL: https://golang.org/
|
|
# Maintainer: Matt Housh, jaeger at crux dot ninja
|
|
|
|
name=go
|
|
version=1.7
|
|
release=1
|
|
source=(https://storage.googleapis.com/golang/${name}${version}.linux-amd64.tar.gz \
|
|
https://storage.googleapis.com/golang/${name}${version}.src.tar.gz \
|
|
$name-certpath.diff)
|
|
|
|
unpack_source() {
|
|
install -d $SRC/go${version:0:3}
|
|
bsdtar -xf $PKGMK_SOURCE_DIR/${name}${version}.linux-amd64.tar.gz \
|
|
-C $SRC/go${version:0:3} --strip-components 1
|
|
bsdtar -xf $PKGMK_SOURCE_DIR/${name}${version}.src.tar.gz \
|
|
-C $SRC
|
|
cp $name-certpath.diff $SRC
|
|
}
|
|
|
|
build() {
|
|
export GOROOT_BOOTSTRAP=${SRC}/go${version:0:3}
|
|
export GOROOT_FINAL=/usr/lib/go
|
|
export GOOS=linux
|
|
export GOARCH=amd64
|
|
|
|
patch -p0 -i $SRC/$name-certpath.diff
|
|
|
|
cd go/src
|
|
bash make.bash --no-clean
|
|
|
|
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/
|
|
|
|
# work around a bug in the build system
|
|
find $PKG -name "*.a" -exec chmod 644 '{}' \;
|
|
}
|