[gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-vcs.eclass
williamh15/06/23 18:59:43 Modified: ChangeLog golang-vcs.eclass Log: The GOPATH environment variable is now passed directly to the commands that need it. The correct directory of source files is copied to the correct location under ${S}. Revision ChangesPath 1.1679 eclass/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1679view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1679content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1678r2=1.1679 Index: ChangeLog === RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v retrieving revision 1.1678 retrieving revision 1.1679 diff -u -r1.1678 -r1.1679 --- ChangeLog 22 Jun 2015 14:18:19 - 1.1678 +++ ChangeLog 23 Jun 2015 18:59:43 - 1.1679 @@ -1,6 +1,12 @@ # ChangeLog for eclass directory # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1678 2015/06/22 14:18:19 pesa Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1679 2015/06/23 18:59:43 williamh Exp $ + + 23 Jun 2015; William Hubbs willi...@gentoo.org golang-vcs.eclass: + The GOPATH environment variable is now passed directly to the + commands that need it. + The correct directory of source files is copied to the correct + location under ${S}. 22 Jun 2015; Davide Pesavento p...@gentoo.org qmake-utils.eclass: Introduce qt{4,5}_get_libdir(). 1.3 eclass/golang-vcs.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?rev=1.3view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?rev=1.3content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?r1=1.2r2=1.3 Index: golang-vcs.eclass === RCS file: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- golang-vcs.eclass 18 Jun 2015 15:19:04 - 1.2 +++ golang-vcs.eclass 23 Jun 2015 18:59:43 - 1.3 @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v 1.2 2015/06/18 15:19:04 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v 1.3 2015/06/23 18:59:43 williamh Exp $ # @ECLASS: golang-vcs.eclass # @MAINTAINER: @@ -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
[gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-vcs.eclass
williamh15/06/18 15:19:04 Modified: ChangeLog golang-vcs.eclass Log: golang-vcs.eclass: Add the EGO_SRC variable for repositories that contain multiple Go packages. Change references from ${S} to ${WORKDIR}/${P} to match other eclasses. Copy the appropriate sources to${WORKDIR}/${P}. Revision ChangesPath 1.1675 eclass/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1675view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1675content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1674r2=1.1675 Index: ChangeLog === RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v retrieving revision 1.1674 retrieving revision 1.1675 diff -u -r1.1674 -r1.1675 --- ChangeLog 18 Jun 2015 14:22:59 - 1.1674 +++ ChangeLog 18 Jun 2015 15:19:04 - 1.1675 @@ -1,6 +1,12 @@ # ChangeLog for eclass directory # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1674 2015/06/18 14:22:59 grknight Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1675 2015/06/18 15:19:04 williamh Exp $ + + 18 Jun 2015; William Hubbs willi...@gentoo.org golang-vcs.eclass: + Add the EGO_SRC variable for repositories that contain multiple Go + packages. + Change references from ${S} to ${WORKDIR}/${P} to match other eclasses. + Copy the appropriate sources to${WORKDIR}/${P}. 18 Jun 2015; grkni...@gentoo.org depend.php.eclass: Remove phpconfutils calls in preparation for its deprecation 1.2 eclass/golang-vcs.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?rev=1.2view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?rev=1.2content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?r1=1.1r2=1.2 Index: golang-vcs.eclass === RCS file: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- golang-vcs.eclass 16 Jun 2015 21:40:51 - 1.1 +++ golang-vcs.eclass 18 Jun 2015 15:19:04 - 1.2 @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v 1.1 2015/06/16 21:40:51 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v 1.2 2015/06/18 15:19:04 williamh Exp $ # @ECLASS: golang-vcs.eclass # @MAINTAINER: @@ -40,6 +40,20 @@ # EGO_PN=github.com/user1/package1 github.com/user2/package2 # @CODE +# @ECLASS-VARIABLE: EGO_SRC +# @DESCRIPTION: +# This is the Go upstream repository which will be copied to +# ${WORKDIR}/${P}. +# If it isn't set, it defaults to the first word of ${EGO_PN}. +# This should be set if you are retrieving a repository that includes +# multiple packages, e.g. golang.org/x/tools. +# +# Example: +# @CODE +# EGO_PN=github.com/user/repository/package +# EGO_SRC=github.com/user/repository +# @CODE + # @ECLASS-VARIABLE: EGO_STORE_DIR # @DESCRIPTION: # Storage directory for Go sources. @@ -85,8 +99,12 @@ export GOPATH=${EGO_STORE_DIR} [[ -n ${EVCS_UMASK} ]] eumask_pop - mkdir -p ${S} || - die ${ECLASS}: unable to create ${S} + mkdir -p ${WORKDIR}/${P}/src || + die ${ECLASS}: unable to create ${WORKDIR}/${P} + if [ -z ${EGO_SRC} ]; then + set -- ${EGO_PN} + EGO_SRC=$1 + fi return 0 } @@ -101,7 +119,7 @@ die ${ECLASS}: EGO_PN is not set if [[ -n ${EVCS_OFFLINE} ]]; then - export GOPATH=${S}:${GOPATH} + export GOPATH=${WORKDIR}/${P}:${GOPATH} return 0 fi @@ -118,7 +136,14 @@ # downloading the top level repository is successful. [[ -n ${EVCS_UMASK} ]] eumask_pop - export GOPATH=${S}:${EGO_STORE_DIR} + export GOPATH=${WORKDIR}/${P}:${EGO_STORE_DIR} + 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} + echo $@ + $@ || die Unable to copy sources to ${WORKDIR}/${P} return 0 }
[gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-vcs.eclass
williamh15/06/16 21:40:51 Modified: ChangeLog Added:golang-vcs.eclass Log: Add golang-vcs.eclass to retrieve go packages from vcs repositories for software written in the Go programming language Revision ChangesPath 1.1669 eclass/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1669view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1669content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1668r2=1.1669 Index: ChangeLog === RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v retrieving revision 1.1668 retrieving revision 1.1669 diff -u -r1.1668 -r1.1669 --- ChangeLog 16 Jun 2015 21:38:00 - 1.1668 +++ ChangeLog 16 Jun 2015 21:40:51 - 1.1669 @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1668 2015/06/16 21:38:00 pesa Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1669 2015/06/16 21:40:51 williamh Exp $ + + 16 Jun 2015; William Hubbs willi...@gentoo.org +golang-vcs.eclass: + Add golang-vcs.eclass to retrieve go packages from vcs repositories + for live ebuilds of software written in the Go programming language. 16 Jun 2015; Davide Pesavento p...@gentoo.org qt4-build-multilib.eclass: Minor changes to reduce diff with qt5-build.eclass 1.1 eclass/golang-vcs.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?rev=1.1view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?rev=1.1content-type=text/plain Index: golang-vcs.eclass === # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v 1.1 2015/06/16 21:40:51 williamh Exp $ # @ECLASS: golang-vcs.eclass # @MAINTAINER: # William Hubbs willi...@gentoo.org # @BLURB: Eclass for fetching and unpacking go repositories. # @DESCRIPTION: # This eclass is written to ease the maintenance of live ebuilds # of software written in the Go programming language. inherit eutils case ${EAPI:-0} in 5) ;; *) die ${ECLASS}: Unsupported eapi (EAPI=${EAPI}) ;; esac EXPORT_FUNCTIONS src_unpack if [[ -z ${_GOLANG_VCS} ]]; then _GOLANG_VCS=1 DEPEND==dev-lang/go-1.4.2 # @ECLASS-VARIABLE: EGO_PN # @REQUIRED # @DESCRIPTION: # This is the import path for the go package(s). Please emerge dev-lang/go # and read go help importpath for syntax. # # Example: # @CODE # EGO_PN=github.com/user/package # EGO_PN=github.com/user1/package1 github.com/user2/package2 # @CODE # @ECLASS-VARIABLE: EGO_STORE_DIR # @DESCRIPTION: # Storage directory for Go sources. # # This is intended to be set by the user in make.conf. Ebuilds must not set # it. # # EGO_STORE_DIR=${DISTDIR}/go-src # @ECLASS-VARIABLE: EVCS_OFFLINE # @DEFAULT_UNSET # @DESCRIPTION: # If non-empty, this variable prevents any online operations. # @ECLASS-VARIABLE: EVCS_UMASK # @DEFAULT_UNSET # @DESCRIPTION: # Set this variable to a custom umask. This is intended to be set by # users. By setting this to something like 002, it can make life easier # for people who do development as non-root (but are in the portage # group) and use FEATURES=userpriv. # @FUNCTION: _golang-vcs_env_setup # @INTERNAL # @DESCRIPTION: # Create EGO_STORE_DIR if necessary and set GOPATH. _golang-vcs_env_setup() { debug-print-function ${FUNCNAME} $@ local distdir=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}} : ${EGO_STORE_DIR:=${distdir}/go-src} [[ -n ${EVCS_UMASK} ]] eumask_push $EVCS_UMASK if [[ ! -d ${EGO_STORE_DIR} ]]; then ( addwrite / mkdir -p ${EGO_STORE_DIR} ) || die ${ECLASS}: unable to create ${EGO_STORE_DIR} fi addwrite ${EGO_STORE_DIR} export GOPATH=${EGO_STORE_DIR} [[ -n ${EVCS_UMASK} ]] eumask_pop mkdir -p ${S} || die ${ECLASS}: unable to create ${S} return 0 } # @FUNCTION: _golang-vcs_fetch # @INTERNAL # @DESCRIPTION: # Retrieve the EGO_PN go package along with its dependencies. _golang-vcs_fetch() { debug-print-function ${FUNCNAME} $@ [[ -z ${EGO_PN} ]] die ${ECLASS}: EGO_PN is not set if [[ -n ${EVCS_OFFLINE} ]]; then export GOPATH=${S}:${GOPATH} return 0 fi [[ -n ${EVCS_UMASK} ]] eumask_push ${EVCS_UMASK} set -- go get -d -t -u -v -x ${EGO_PN} echo $@ $@ || die # The above dies if you