williamh    15/06/24 15:38:34

  Modified:             ChangeLog
  Added:                golang-build.eclass
  Log:
  Add an eclass for building Go software

Revision  Changes    Path
1.1683               eclass/ChangeLog

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

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1682
retrieving revision 1.1683
diff -u -r1.1682 -r1.1683
--- ChangeLog   24 Jun 2015 13:36:03 -0000      1.1682
+++ ChangeLog   24 Jun 2015 15:38:33 -0000      1.1683
@@ -1,6 +1,9 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1682 2015/06/24 
13:36:03 grknight Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1683 2015/06/24 
15:38:33 williamh Exp $
+
+  24 Jun 2015; William Hubbs <[email protected]> +golang-build.eclass:
+  Add an eclass for building Go software
 
   24 Jun 2015; <[email protected]> depend.php.eclass:
   depend.php.eclass is deprecated and is set to be removed 30 days after bug



1.1                  eclass/golang-build.eclass

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

Index: golang-build.eclass
===================================================================
# 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.1 2015/06/24 
15:38:33 williamh Exp $

# @ECLASS: golang-build.eclass
# @MAINTAINER:
# William Hubbs <[email protected]>
# @BLURB: Eclass for compiling go packages.
# @DESCRIPTION:
# This eclass provides default  src_compile, src_test and src_install
# functions for software written in the Go programming language.

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

EXPORT_FUNCTIONS src_compile src_install src_test

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

_GOLANG_BUILD=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(s) to build. Please emerge
# dev-lang/go and read "go help importpath" for syntax.
#
# Example:
# @CODE
# 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
}

golang-build_src_compile() {
        debug-print-function ${FUNCNAME} "$@"

        _golang-build_setup
        set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \
                go build -v -work -x "${EGO_PN}"
        echo "$@"
        "$@" || die
}

golang-build_src_install() {
        debug-print-function ${FUNCNAME} "$@"

        _golang-build_setup
        set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \
                go install -v -work -x "${EGO_PN}"
        echo "$@"
        "$@" || die
        insinto /usr/lib/go-gentoo
        insopts -m0644 -p # preserve timestamps for bug 551486
        doins -r pkg src
}

golang-build_src_test() {
        debug-print-function ${FUNCNAME} "$@"

        _golang-build_setup
        set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \
                go test -v -work -x "${EGO_PN}"
        echo "$@"
        "$@" || die
}

fi




Reply via email to