diff --git a/lang-golang/go/autobuild/alternatives b/lang-golang/go/autobuild/alternatives index 9b1a2669c10..6812feec41b 100644 --- a/lang-golang/go/autobuild/alternatives +++ b/lang-golang/go/autobuild/alternatives @@ -1,2 +1,2 @@ -alternative /usr/bin/go /usr/bin/go-google 80 -alternative /usr/bin/gofmt /usr/bin/gofmt-google 80 +alternative /usr/bin/go /usr/lib/go/bin/go 80 +alternative /usr/bin/gofmt /usr/lib/go/bin/gofmt 80 diff --git a/lang-golang/go/autobuild/build b/lang-golang/go/autobuild/build index 9199952e206..ae2a1455c75 100644 --- a/lang-golang/go/autobuild/build +++ b/lang-golang/go/autobuild/build @@ -59,9 +59,9 @@ cp -rv "$SRCDIR"/{doc,misc} \ ln -sv ../../share/go/doc \ "$PKGDIR/usr/lib/go/doc" cp -av "$SRCDIR"/bin \ - "$PKGDIR/usr" + "$PKGDIR/usr/lib/go/" cp -av "$SRCDIR"/pkg \ - "$PKGDIR/usr/lib/go" + "$PKGDIR/usr/lib/go/" cp -av "$GOROOT/src" \ "$PKGDIR/usr/lib/go/" cp -av "$GOROOT/src/cmd" \ @@ -83,10 +83,6 @@ abinfo "Setting executable bit for sql.go ..." find "$PKGDIR" \ -type f -name sql.go -exec chmod -v -x {} \; -abinfo "Creating a symlink for /usr/lib/go/bin to /usr/bin ..." -ln -svf ../../bin \ - "$PKGDIR/usr/lib/go/bin" - abinfo "Installing build scripts ..." install -Dvm755 "$SRCDIR"/src/make.bash \ "$PKGDIR/usr/lib/go/src/make.bash" @@ -103,7 +99,7 @@ install -Dvm644 "$SRCDIR"/VERSION \ "$PKGDIR/usr/lib/go/VERSION" abinfo "Touching all installed files ..." -find "$PKGDIR"/usr/{lib/go/pkg,bin} \ +find "$PKGDIR"/usr/lib/go/{pkg,bin} \ -type f -exec touch '{}' + abinfo "Installing basic Go tools ..." @@ -111,9 +107,10 @@ install -dvm755 "$PKGDIR"/usr/lib/go/pkg/tool/"${GOOS}"_"$GOARCH" install -pvm755 "$SRCDIR"/pkg/tool/"${GOOS}"_"$GOARCH"/* \ "$PKGDIR"/usr/lib/go/pkg/tool/"${GOOS}"_"$GOARCH" -abinfo "Renaming go and gofmt for alternatives ..." -mv -v "$PKGDIR"/usr/bin/go{,-google} -mv -v "$PKGDIR"/usr/bin/gofmt{,-google} +abinfo "Linking go and gofmt installed in GOROOT to /usr/bin ..." +mkdir "$PKGDIR"/usr/bin +ln -sfv ../lib/go/bin/go "$PKGDIR"/usr/bin/go-google +ln -sfv ../lib/go/bin/gofmt "$PKGDIR"/usr/bin/gofmt-google abinfo "Preparing to build extra Go tools ..." mkdir -pv "$SRCDIR"/go-tools/src/golang.org/x/ diff --git a/lang-golang/go/autobuild/build.stage2 b/lang-golang/go/autobuild/build.stage2 index b99c4d9c9fa..82de1343844 100644 --- a/lang-golang/go/autobuild/build.stage2 +++ b/lang-golang/go/autobuild/build.stage2 @@ -66,9 +66,9 @@ cp -rv "$SRCDIR"/{doc,misc} \ ln -sv ../../share/go/doc \ "$PKGDIR/usr/lib/go/doc" cp -av "$SRCDIR"/bin \ - "$PKGDIR/usr" + "$PKGDIR/usr/lib/go/" cp -av "$SRCDIR"/pkg \ - "$PKGDIR/usr/lib/go" + "$PKGDIR/usr/lib/go/" cp -av "$GOROOT/src" \ "$PKGDIR/usr/lib/go/" cp -av "$GOROOT/src/cmd" \ @@ -90,10 +90,6 @@ abinfo "Setting executable bit for sql.go ..." find "$PKGDIR" \ -type f -name sql.go -exec chmod -v -x {} \; -abinfo "Creating a symlink for /usr/lib/go/bin to /usr/bin ..." -ln -svf ../../bin \ - "$PKGDIR/usr/lib/go/bin" - abinfo "Installing build scripts ..." install -Dvm755 "$SRCDIR"/src/make.bash \ "$PKGDIR/usr/lib/go/src/make.bash" @@ -110,7 +106,7 @@ install -Dvm644 "$SRCDIR"/VERSION \ "$PKGDIR/usr/lib/go/VERSION" abinfo "Touching all installed files ..." -find "$PKGDIR"/usr/{lib/go/pkg,bin} \ +find "$PKGDIR"/usr/lib/go/{pkg,bin} \ -type f -exec touch '{}' + abinfo "Installing basic Go tools ..." @@ -118,9 +114,10 @@ install -dvm755 "$PKGDIR"/usr/lib/go/pkg/tool/"${GOOS}"_"$GOARCH" install -pvm755 "$SRCDIR"/pkg/tool/"${GOOS}"_"$GOARCH"/* \ "$PKGDIR"/usr/lib/go/pkg/tool/"${GOOS}"_"$GOARCH" -abinfo "Renaming go and gofmt for alternatives ..." -mv -v "$PKGDIR"/usr/bin/go{,-google} -mv -v "$PKGDIR"/usr/bin/gofmt{,-google} +abinfo "Linking go and gofmt installed in GOROOT to /usr/bin ..." +mkdir "$PKGDIR"/usr/bin +ln -sfv ../lib/go/bin/go "$PKGDIR"/usr/bin/go-google +ln -sfv ../lib/go/bin/gofmt "$PKGDIR"/usr/bin/gofmt-google abinfo "Preparing to build extra Go tools ..." mkdir -pv "$SRCDIR"/go-tools/src/golang.org/x/