diff --git a/common/build-style/go.sh b/common/build-style/go.sh index 3a8187c11f..a8728683ad 100644 --- a/common/build-style/go.sh +++ b/common/build-style/go.sh @@ -3,12 +3,17 @@ # do_build() { + local path="${GOPATH}/src/${go_import_path}" if [[ "${go_get}" != "yes" ]]; then - local path="${GOPATH}/src/${go_import_path}" mkdir -p "$(dirname ${path})" ln -fs $PWD "${path}" fi + if [[ -x /usr/bin/dep ]]; then + cd "${path}" + dep ensure + fi + go_package=${go_package:-$go_import_path} go get -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package} } diff --git a/srcpkgs/dep/template b/srcpkgs/dep/template new file mode 100644 index 0000000000..7e9bd64de1 --- /dev/null +++ b/srcpkgs/dep/template @@ -0,0 +1,23 @@ +# Template file for 'dep' +pkgname=dep +version=0.3.0 +revision=1 +build_style=go +hostmakedepends="git" +depends="git go" +short_desc="Go dependency management tool" +maintainer="Andrea Brancaleoni " +license="Apache" +go_import_path="github.com/golang/dep" +go_package="$go_import_path/cmd/dep" +homepage="https://$go_import_path" +distfiles="$homepage/archive/v$version.tar.gz" +checksum=7d816ffb14f57c4b01352676998a8cda9e4fb24eaec92bd79526e1045c5a0c83 + +pre_build() { + git config --global http.https://gopkg.in.followRedirects true +} + +post_install() { + vlicense LICENSE +}