diff --git a/common/build-style/go.sh b/common/build-style/go.sh index c68354c6641..dee1ef795e4 100644 --- a/common/build-style/go.sh +++ b/common/build-style/go.sh @@ -3,22 +3,13 @@ # do_build() { - case "$XBPS_TARGET_MACHINE" in - armv6*) export GOARCH=arm; export GOARM=6;; - armv7*) export GOARCH=arm; export GOARM=7;; - i686*) export GOARCH=386;; - x86_64*) export GOARCH=amd64;; - esac - - export GOPATH="$(mktemp -d --tmpdir="${wrksrc}")" - if [[ "${go_get}" != "yes" ]]; then local path="${GOPATH}/src/${go_import_path}" mkdir -p "$(dirname ${path})" ln -fs $PWD "${path}" fi - go get -d -v "${go_import_path}" + go get -d "${go_import_path}" go build -x "${go_import_path}" } diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh index 8c474839b63..ba05061ed14 100644 --- a/common/environment/build-style/go.sh +++ b/common/environment/build-style/go.sh @@ -3,3 +3,12 @@ if [ "$CROSS_BUILD" ]; then hostmakedepends+=" go-cross-linux" fi nostrip=yes + +case "$XBPS_TARGET_MACHINE" in + armv6*) export GOARCH=arm; export GOARM=6;; + armv7*) export GOARCH=arm; export GOARM=7;; + i686*) export GOARCH=386;; + x86_64*) export GOARCH=amd64;; +esac + +export GOPATH="${wrksrc}/_build-${pkgname}-xbps" diff --git a/srcpkgs/syncthing/template b/srcpkgs/syncthing/template index db8254d40aa..15b04ac4ec2 100644 --- a/srcpkgs/syncthing/template +++ b/srcpkgs/syncthing/template @@ -2,10 +2,8 @@ pkgname=syncthing version=0.10.23 revision=1 -hostmakedepends="go>=1.3" -if [ "$CROSS_BUILD" ]; then - hostmakedepends+=" go-cross-linux" -fi +build_style=go +go_import_path="github.com/syncthing/syncthing" short_desc="Open Source Continuous File Synchronization" maintainer="Duncan Overbruck " license="GPL-3" @@ -14,13 +12,8 @@ distfiles="https://github.com/syncthing/${pkgname}/archive/v${version}.tar.gz" checksum=c8c829191620e2268209c3da19b4b58b3568aaf859d9be84b161da26454fb54a do_build() { - case "$XBPS_TARGET_MACHINE" in - arm*) goarch=arm;; - i686*) goarch=386;; - x86_64*) goarch=amd64;; - esac - - export GOPATH="${PWD}/gopath" + goarch="${GOARCH}" + unset GOARCH export CGO_ENABLED=0 mkdir -p $GOPATH/src/github.com/syncthing ln -s $PWD $GOPATH/src/github.com/syncthing/${pkgname}