williamh    15/07/27 19:11:00

  Modified:             ChangeLog golang-build.eclass golang-vcs.eclass
  Added:                golang-base.eclass
  Log:
  Add golang-base.eclass for the basic golang functions and set up the
  other go eclasses to use it.

Revision  Changes    Path
1.1733               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1733&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1733&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1732&r2=1.1733

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1732
retrieving revision 1.1733
diff -u -r1.1732 -r1.1733
--- ChangeLog   27 Jul 2015 16:35:19 -0000      1.1732
+++ ChangeLog   27 Jul 2015 19:11:00 -0000      1.1733
@@ -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.1732 2015/07/27 
16:35:19 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1733 2015/07/27 
19:11:00 williamh Exp $
+
+  27 Jul 2015; William Hubbs <willi...@gentoo.org> +golang-base.eclass,
+  golang-build.eclass, golang-vcs.eclass:
+  Add golang-base.eclass for the basic golang functions and set up the
+  other go eclasses to use it.
+
 
   27 Jul 2015; Michał Górny <mgo...@gentoo.org> python-utils-r1.eclass:
   python_wrapper_setup(): make banned helpers exit with 127.



1.6                  eclass/golang-build.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-build.eclass?rev=1.6&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-build.eclass?rev=1.6&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-build.eclass?r1=1.5&r2=1.6

Index: golang-build.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- golang-build.eclass 23 Jul 2015 15:42:26 -0000      1.5
+++ golang-build.eclass 27 Jul 2015 19:11:00 -0000      1.6
@@ -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-build.eclass,v 1.5 2015/07/23 
15:42:26 williamh Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v 1.6 2015/07/27 
19:11:00 williamh Exp $
 
 # @ECLASS: golang-build.eclass
 # @MAINTAINER:
@@ -10,6 +10,8 @@
 # This eclass provides default  src_compile, src_test and src_install
 # functions for software written in the Go programming language.
 
+inherit golang-base
+
 case "${EAPI:-0}" in
        5)
                ;;
@@ -24,9 +26,6 @@
 
 _GOLANG_BUILD=1
 
-DEPEND=">=dev-lang/go-1.4.2:="
-STRIP_MASK="*.a"
-
 # @ECLASS-VARIABLE: EGO_PN
 # @REQUIRED
 # @DESCRIPTION:
@@ -38,49 +37,10 @@
 # EGO_PN=github.com/user/package
 # @CODE
 
-# @FUNCTION: _golang-build_setup
-# @INTERNAL
-# @DESCRIPTION:
-# Make sure EGO_PN has a value.
-_golang-build_setup() {
-       [[ -z "${EGO_PN}" ]] &&
-               die "${ECLASS}.eclass: EGO_PN is not set"
-       return 0
-}
-
-# @FUNCTION: get_golibdir
-# @DESCRIPTION:
-# Return the non-prefixed library directory where Go packages
-# should be installed
-get_golibdir() {
-       echo /usr/lib/go-gentoo
-}
-
-# @FUNCTION: get_golibdir
-# @DESCRIPTION:
-# Return the library directory where Go packages should be installed
-# This is the prefixed version which should be included in GOPATH
-get_golibdir_gopath() {
-       echo "${EPREFIX}$(get_golibdir)"
-}
-
-# @FUNCTION: golang_install_pkgs
-# @DESCRIPTION:
-# Install Go packages.
-# This function assumes that $cwd is a Go workspace.
-golang_install_pkgs() {
-       debug-print-function ${FUNCNAME} "$@"
-
-       _golang-build_setup
-       insinto "$(get_golibdir)"
-       insopts -m0644 -p # preserve timestamps for bug 551486
-       doins -r pkg src
-}
-
 golang-build_src_compile() {
        debug-print-function ${FUNCNAME} "$@"
 
-       _golang-build_setup
+       ego_pn_check
        set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
                go build -v -work -x "${EGO_PN}"
        echo "$@"
@@ -90,7 +50,7 @@
 golang-build_src_install() {
        debug-print-function ${FUNCNAME} "$@"
 
-       _golang-build_setup
+       ego_pn_check
        set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
                go install -v -work -x "${EGO_PN}"
        echo "$@"
@@ -101,7 +61,7 @@
 golang-build_src_test() {
        debug-print-function ${FUNCNAME} "$@"
 
-       _golang-build_setup
+       ego_pn_check
        set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
                go test -v -work -x "${EGO_PN}"
        echo "$@"



1.4                  eclass/golang-vcs.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?rev=1.4&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?rev=1.4&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-vcs.eclass?r1=1.3&r2=1.4

Index: golang-vcs.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- golang-vcs.eclass   23 Jun 2015 18:59:43 -0000      1.3
+++ golang-vcs.eclass   27 Jul 2015 19:11:00 -0000      1.4
@@ -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.3 2015/06/23 
18:59:43 williamh Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v 1.4 2015/07/27 
19:11:00 williamh Exp $
 
 # @ECLASS: golang-vcs.eclass
 # @MAINTAINER:
@@ -10,7 +10,7 @@
 # This eclass is written to ease the maintenance of live ebuilds
 # of software written in the Go programming language.
 
-inherit eutils
+inherit eutils golang-base
 
 case "${EAPI:-0}" in
        5)
@@ -26,8 +26,6 @@
 
 _GOLANG_VCS=1
 
-DEPEND=">=dev-lang/go-1.4.2"
-
 # @ECLASS-VARIABLE: EGO_PN
 # @REQUIRED
 # @DESCRIPTION:
@@ -114,8 +112,7 @@
 _golang-vcs_fetch() {
        debug-print-function ${FUNCNAME} "$@"
 
-       [[ -z ${EGO_PN} ]] &&
-               die "${ECLASS}: EGO_PN is not set"
+       ego_pn_check
 
        if [[ -z ${EVCS_OFFLINE} ]]; then
                [[ -n ${EVCS_UMASK} ]] && eumask_push ${EVCS_UMASK}



1.1                  eclass/golang-base.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-base.eclass?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-base.eclass?rev=1.1&content-type=text/plain

Index: golang-base.eclass
===================================================================
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/golang-base.eclass,v 1.1 2015/07/27 
19:11:00 williamh Exp $

# @ECLASS: golang-build.eclass
# @MAINTAINER:
# William Hubbs <willi...@gentoo.org>
# @BLURB: Eclass that provides base functions for Go packages.
# @DESCRIPTION:
# This eclass provides base functions for software written in the Go
# programming language; it also provides the build-time dependency on
# dev-lang/go.

case "${EAPI:-0}" in
        5)
                ;;
        *)
                die "${ECLASS}: Unsupported eapi (EAPI=${EAPI})"
                ;;
esac

if [[ -z ${_GOLANG_BASE} ]]; then

_GOLANG_BASE=1

DEPEND=">=dev-lang/go-1.4.2:="
STRIP_MASK="*.a"

# @ECLASS-VARIABLE: EGO_PN
# @REQUIRED
# @DESCRIPTION:
# This is the import path for the go package to build. Please emerge
# dev-lang/go and read "go help importpath" for syntax.
#
# Example:
# @CODE
# EGO_PN=github.com/user/package
# @CODE

# @FUNCTION: ego_pn_check
# @DESCRIPTION:
# Make sure EGO_PN has a value.
ego_pn_check() {
        [[ -z "${EGO_PN}" ]] &&
                die "${ECLASS}.eclass: EGO_PN is not set"
        return 0
}

# @FUNCTION: get_golibdir
# @DESCRIPTION:
# Return the non-prefixed library directory where Go packages
# should be installed
get_golibdir() {
        echo /usr/lib/go-gentoo
}

# @FUNCTION: get_golibdir_gopath
# @DESCRIPTION:
# Return the library directory where Go packages should be installed
# This is the prefixed version which should be included in GOPATH
get_golibdir_gopath() {
        echo "${EPREFIX}$(get_golibdir)"
}

# @FUNCTION: golang_install_pkgs
# @DESCRIPTION:
# Install Go packages.
# This function assumes that $cwd is a Go workspace.
golang_install_pkgs() {
        debug-print-function ${FUNCNAME} "$@"

        ego_pn_check
        insinto "$(get_golibdir)"
        insopts -m0644 -p # preserve timestamps for bug 551486
        doins -r pkg src
}

fi




Reply via email to