All, here are more non-api-breaking updates to golang-vcs.eclass:
1. The GOPATH environment variable is now passed directly to the
commands that need it.
2. The correct directory of source files is copied to the correct
location under ${S}.
I'll post this as a patch since the eclass is in the tree.
Thanks,
William
Index: golang-vcs.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v
retrieving revision 1.2
diff -u -B -r1.2 golang-vcs.eclass
--- golang-vcs.eclass 18 Jun 2015 15:19:04 -0000 1.2
+++ golang-vcs.eclass 22 Jun 2015 22:12:37 -0000
@@ -50,7 +50,7 @@
#
# Example:
# @CODE
-# EGO_PN="github.com/user/repository/package"
+# EGO_PN="github.com/user/repository/..."
# EGO_SRC="github.com/user/repository"
# @CODE
@@ -79,7 +79,7 @@
# @FUNCTION: _golang-vcs_env_setup
# @INTERNAL
# @DESCRIPTION:
-# Create EGO_STORE_DIR if necessary and set GOPATH.
+# Create EGO_STORE_DIR if necessary.
_golang-vcs_env_setup() {
debug-print-function ${FUNCNAME} "$@"
@@ -96,7 +96,6 @@
fi
addwrite "${EGO_STORE_DIR}"
- export GOPATH="${EGO_STORE_DIR}"
[[ -n ${EVCS_UMASK} ]] && eumask_pop
mkdir -p "${WORKDIR}/${P}/src" ||
@@ -118,32 +117,26 @@
[[ -z ${EGO_PN} ]] &&
die "${ECLASS}: EGO_PN is not set"
- if [[ -n ${EVCS_OFFLINE} ]]; then
- export GOPATH="${WORKDIR}/${P}:${GOPATH}"
- return 0
- fi
-
- [[ -n ${EVCS_UMASK} ]] && eumask_push ${EVCS_UMASK}
+ if [[ -z ${EVCS_OFFLINE} ]]; then
+ [[ -n ${EVCS_UMASK} ]] && eumask_push ${EVCS_UMASK}
- set -- go get -d -t -u -v -x "${EGO_PN}"
- echo "$@"
- "$@" || die
- # The above dies if you pass repositories in EGO_PN instead of
- # packages, e.g. golang.org/x/tools instead of golang.org/x/tools/cmd/vet.
- # This is being discussed in the following upstream issue:
- # https://github.com/golang/go/issues/11090
- # I am hoping this will be fixed so "go get -d" is successful if
- # downloading the top level repository is successful.
+ set -- env GOPATH="${EGO_STORE_DIR}" go get -d -t -u -v -x "${EGO_PN}"
+ echo "$@"
+ "$@" || die
+ # The above dies if you pass repositories in EGO_PN instead of
+ # packages, e.g. golang.org/x/tools instead of golang.org/x/tools/cmd/vet.
+ # This is being discussed in the following upstream issue:
+ # https://github.com/golang/go/issues/11090
- [[ -n ${EVCS_UMASK} ]] && eumask_pop
- export GOPATH="${WORKDIR}/${P}:${EGO_STORE_DIR}"
- set -- mkdir -p "${WORKDIR}/${P}/src/${EGO_SRC}"
+ [[ -n ${EVCS_UMASK} ]] && eumask_pop
+ fi
+ set -- mkdir -p "${WORKDIR}/${P}/src/${EGO_SRC%/*}"
echo "$@"
- "$@" || die "Unable to create ${WORKDIR}/${P}/src/${EGO_SRC}"
- set -- cp -r "${EGO_STORE_DIR}/src/${EGO_SRC}/*" \
- "${WORKDIR}/${P}/src/${EGO_SRC}"
+ "$@" || die "Unable to create ${WORKDIR}/${P}/src"
+ set -- cp -r "${EGO_STORE_DIR}/src/${EGO_SRC}" \
+ "${WORKDIR}/${P}/src/${EGO_SRC%/*}"
echo "$@"
- $@ || die "Unable to copy sources to ${WORKDIR}/${P}"
+ "$@" || die "Unable to copy sources to ${WORKDIR}/${P}"
return 0
}
signature.asc
Description: Digital signature
