diff options
author | Sören Tempel <soeren@soeren-tempel.net> | 2015-09-30 17:33:18 +0200 |
---|---|---|
committer | Sören Tempel <soeren+git@soeren-tempel.net> | 2015-09-30 22:24:57 +0200 |
commit | 519cd28b21b352e5f70469a1a2892448b1c16667 (patch) | |
tree | 77c4df60ace8246f87721e781e6e0e361ab15192 /community/go | |
parent | ef77a1a3db440aeecf74a7c2d148de937fad2000 (diff) | |
download | aports-519cd28b21b352e5f70469a1a2892448b1c16667.tar.bz2 aports-519cd28b21b352e5f70469a1a2892448b1c16667.tar.xz |
community/go: install all tools in $PATH
Previously you could only access them using `go tool <toolname>`
however, some software expects to find vet, godoc, et cetera in your
$PATH.
Regarding godoc we manually make it accessible via `go tool <toolname>`
as well, which isn't the default and might be dropped in the future.
Diffstat (limited to 'community/go')
-rw-r--r-- | community/go/APKBUILD | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/community/go/APKBUILD b/community/go/APKBUILD index ca7451fac9..59d3680feb 100644 --- a/community/go/APKBUILD +++ b/community/go/APKBUILD @@ -4,7 +4,7 @@ pkgname=go pkgver=1.5.1 # This should be the latest commit on the corresponding release branch _toolsver="d02228d1857b9f49cd0252788516ff5584266eb6" -pkgrel=2 +pkgrel=3 pkgdesc="Go programming language compiler" url="http://www.golang.org/" arch="all" @@ -76,11 +76,11 @@ build() { package() { cd "$_builddir" - mkdir -p "$pkgdir"/usr/bin "$pkgdir"/usr/lib/go "$pkgdir"/usr/share/doc/go + mkdir -p "$pkgdir"/usr/bin "$pkgdir"/usr/lib/go/bin "$pkgdir"/usr/share/doc/go for binary in go gofmt; do - install -Dm755 bin/$binary "$pkgdir"/usr/lib/go/bin/$binary || return 1 - ln -s /usr/lib/go/bin/$binary "$pkgdir"/usr/bin/$binary || return 1 + mv bin/"$binary" "$pkgdir"/usr/lib/go/bin/ || return 1 + ln -s /usr/lib/go/bin/"$binary" "$pkgdir"/usr/bin/ || return 1 done # The source needs to be installed due to an upstream @@ -107,9 +107,15 @@ tools() { pkgdesc="Go programming language tools" depends="$pkgname" - install -dm755 "$subpkgdir"/usr/lib/go/pkg/tool/linux_$GOARCH - install -Dm755 "$_builddir"/bin/godoc \ - "$pkgdir"/usr/lib/go/pkg/tool/linux_$GOARCH/$tool + mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib/go/bin + for binary in "$_builddir"/bin/*; do + mv $binary "$subpkgdir"/usr/lib/go/bin || return 1 + ln -s /usr/lib/go/bin/"${binary##*/}" "$subpkgdir"/usr/bin/ || return 1 + done + + mkdir -p "$subpkgdir"/usr/lib/go/pkg/tool/linux_$GOARCH + cp "$subpkgdir"/usr/lib/go/bin/godoc \ + "$pkgdir"/usr/lib/go/pkg/tool/linux_$GOARCH/godoc || return 1 for tool in $_gotools; do mv "$pkgdir"/usr/lib/go/pkg/tool/linux_$GOARCH/$tool \ |