diff options
Diffstat (limited to 'eclass/golang-vcs-snapshot.eclass')
-rw-r--r-- | eclass/golang-vcs-snapshot.eclass | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/eclass/golang-vcs-snapshot.eclass b/eclass/golang-vcs-snapshot.eclass index 3a35d7e1aa58..d34b8a6e913d 100644 --- a/eclass/golang-vcs-snapshot.eclass +++ b/eclass/golang-vcs-snapshot.eclass @@ -1,12 +1,13 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: golang-vcs-snapshot.eclass # @MAINTAINER: # William Hubbs <williamh@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 -# @BLURB: support eclass for unpacking VCS snapshot tarballs for -# software written in the Go programming language +# @SUPPORTED_EAPIS: 6 7 +# @PROVIDES: golang-base +# @BLURB: eclass to unpack VCS snapshot tarballs for Go software +# @DEPRECATED: go-module.eclass # @DESCRIPTION: # This eclass provides a convenience src_unpack() which unpacks the # first tarball mentioned in SRC_URI to its appropriate location in @@ -43,16 +44,17 @@ # ${WORKDIR}/${P}/src/github.com/user/package # and add the vendored tarballs to ${WORKDIR}/src/${EGO_PN}/vendor -inherit golang-base - -case ${EAPI:-0} in - 5|6|7) ;; - *) die "${ECLASS} API in EAPI ${EAPI} not yet established." +case ${EAPI} in + 6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS src_unpack +if [[ -z ${_GOLANG_VCS_SNAPSHOT_ECLASS} ]]; then +_GOLANG_VCS_SNAPSHOT_ECLASS=1 -# @ECLASS-VARIABLE: EGO_VENDOR +inherit golang-base go-env + +# @ECLASS_VARIABLE: EGO_VENDOR # @DESCRIPTION: # This variable contains a list of vendored packages. # The items of this array are strings that contain the @@ -81,7 +83,7 @@ unset -f _golang-vcs-snapshot_set_vendor_uri _golang-vcs-snapshot_dovendor() { local VENDOR_PATH=$1 VENDORPN=$2 TARBALL=$3 - rm -fr "${VENDOR_PATH}/${VENDORPN}" || die + rm -rf "${VENDOR_PATH}/${VENDORPN}" || die mkdir -p "${VENDOR_PATH}/${VENDORPN}" || die tar -C "${VENDOR_PATH}/${VENDORPN}" -x --strip-components 1\ -f "${DISTDIR}"/${TARBALL} || die @@ -90,6 +92,7 @@ _golang-vcs-snapshot_dovendor() { # @FUNCTION: golang-vcs-snapshot_src_unpack # @DESCRIPTION: # Extract the first archive from ${A} to the appropriate location for GOPATH. +# Set compile env via go-env. golang-vcs-snapshot_src_unpack() { local lib vendor_path x ego_pn_check @@ -115,4 +118,10 @@ golang-vcs-snapshot_src_unpack() { fi done fi + + go-env_set_compile_environment } + +fi + +EXPORT_FUNCTIONS src_unpack |