public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-build.eclass
@ 2015-06-24 15:38 William Hubbs (williamh)
  0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs (williamh) @ 2015-06-24 15:38 UTC (permalink / raw
  To: gentoo-commits

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 <williamh@gentoo.org> +golang-build.eclass:
+  Add an eclass for building Go software
 
   24 Jun 2015; <grknight@gentoo.org> 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 <williamh@gentoo.org>
# @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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-build.eclass
@ 2015-06-24 17:04 William Hubbs (williamh)
  0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs (williamh) @ 2015-06-24 17:04 UTC (permalink / raw
  To: gentoo-commits

williamh    15/06/24 17:04:54

  Modified:             ChangeLog golang-build.eclass
  Log:
  Typo fix, use double brackets.

Revision  Changes    Path
1.1684               eclass/ChangeLog

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

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1683
retrieving revision 1.1684
diff -u -r1.1683 -r1.1684
--- ChangeLog	24 Jun 2015 15:38:33 -0000	1.1683
+++ ChangeLog	24 Jun 2015 17:04:53 -0000	1.1684
@@ -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.1683 2015/06/24 15:38:33 williamh Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1684 2015/06/24 17:04:53 williamh Exp $
+
+  24 Jun 2015; William Hubbs <williamh@gentoo.org> golang-build.eclass:
+  typo fix, use double brackets
 
   24 Jun 2015; William Hubbs <williamh@gentoo.org> +golang-build.eclass:
   Add an eclass for building Go software



1.2                  eclass/golang-build.eclass

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

Index: golang-build.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- golang-build.eclass	24 Jun 2015 15:38:33 -0000	1.1
+++ golang-build.eclass	24 Jun 2015 17:04:53 -0000	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-build.eclass,v 1.1 2015/06/24 15:38:33 williamh Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v 1.2 2015/06/24 17:04:53 williamh Exp $
 
 # @ECLASS: golang-build.eclass
 # @MAINTAINER:
@@ -43,7 +43,7 @@
 # @DESCRIPTION:
 # Make sure EGO_PN has a value.
 _golang-build_setup() {
-	[ -z "${EGO_PN}" ] &&
+	[[ -z "${EGO_PN}" ]] &&
 		die "${ECLASS}.eclass: EGO_PN is not set"
 	return 0
 }





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-build.eclass
@ 2015-07-03 21:45 William Hubbs (williamh)
  0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs (williamh) @ 2015-07-03 21:45 UTC (permalink / raw
  To: gentoo-commits

williamh    15/07/03 21:45:06

  Modified:             ChangeLog golang-build.eclass
  Log:
  golang-build.eclass: drop the slot dependency; it was pointed out to me
  that they do not force rebuilds in DEPEND

Revision  Changes    Path
1.1697               eclass/ChangeLog

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

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1696
retrieving revision 1.1697
diff -u -r1.1696 -r1.1697
--- ChangeLog	1 Jul 2015 11:28:23 -0000	1.1696
+++ ChangeLog	3 Jul 2015 21:45:06 -0000	1.1697
@@ -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.1696 2015/07/01 11:28:23 mrueg Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1697 2015/07/03 21:45:06 williamh Exp $
+
+  03 Jul 2015; William Hubbs <williamh@gentoo.org> golang-build.eclass:
+  drop the slot dependency; it was pointed out to me that they do not trigger
+  rebuilds in DEPEND
 
   01 Jul 2015; Manuel Rüger <mrueg@gentoo.org> kde4-base.eclass:
   Sync with overlay. Add SRC_URIs for newer KDE SC, KDE Workspace releases and



1.3                  eclass/golang-build.eclass

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

Index: golang-build.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- golang-build.eclass	24 Jun 2015 17:04:53 -0000	1.2
+++ golang-build.eclass	3 Jul 2015 21:45:06 -0000	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-build.eclass,v 1.2 2015/06/24 17:04:53 williamh Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v 1.3 2015/07/03 21:45:06 williamh Exp $
 
 # @ECLASS: golang-build.eclass
 # @MAINTAINER:
@@ -24,7 +24,7 @@
 
 _GOLANG_BUILD=1
 
-DEPEND=">=dev-lang/go-1.4.2:="
+DEPEND=">=dev-lang/go-1.4.2"
 STRIP_MASK="*.a"
 
 # @ECLASS-VARIABLE: EGO_PN





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-build.eclass
@ 2015-07-06 16:48 William Hubbs (williamh)
  0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs (williamh) @ 2015-07-06 16:48 UTC (permalink / raw
  To: gentoo-commits

williamh    15/07/06 16:48:21

  Modified:             ChangeLog golang-build.eclass
  Log:
  Add back the subslot operator in the dependency on Go. We need this so that we have the Go version the package was built with recorded.

Revision  Changes    Path
1.1702               eclass/ChangeLog

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

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1701
retrieving revision 1.1702
diff -u -r1.1701 -r1.1702
--- ChangeLog	6 Jul 2015 15:48:51 -0000	1.1701
+++ ChangeLog	6 Jul 2015 16:48:21 -0000	1.1702
@@ -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.1701 2015/07/06 15:48:51 kensington Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1702 2015/07/06 16:48:21 williamh Exp $
+
+  06 Jul 2015; William Hubbs <williamh@gentoo.org> golang-build.eclass:
+  Add back the subslot operator in the dependency on Go. We need this so that
+  we have the Go version the package was built with recorded.
 
   06 Jul 2015; Michael Palimaka <kensington@gentoo.org> kde5.eclass:
   Add missing USE dependency default wrt bug #554056.



1.4                  eclass/golang-build.eclass

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

Index: golang-build.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- golang-build.eclass	3 Jul 2015 21:45:06 -0000	1.3
+++ golang-build.eclass	6 Jul 2015 16:48:21 -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-build.eclass,v 1.3 2015/07/03 21:45:06 williamh Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v 1.4 2015/07/06 16:48:21 williamh Exp $
 
 # @ECLASS: golang-build.eclass
 # @MAINTAINER:
@@ -24,7 +24,7 @@
 
 _GOLANG_BUILD=1
 
-DEPEND=">=dev-lang/go-1.4.2"
+DEPEND=">=dev-lang/go-1.4.2:="
 STRIP_MASK="*.a"
 
 # @ECLASS-VARIABLE: EGO_PN





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-build.eclass
@ 2015-07-23 15:42 William Hubbs (williamh)
  0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs (williamh) @ 2015-07-23 15:42 UTC (permalink / raw
  To: gentoo-commits

williamh    15/07/23 15:42:26

  Modified:             ChangeLog golang-build.eclass
  Log:
  Add functions to retrieve Go library paths and install Go packages.

Revision  Changes    Path
1.1726               eclass/ChangeLog

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

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1725
retrieving revision 1.1726
diff -u -r1.1725 -r1.1726
--- ChangeLog	22 Jul 2015 12:47:40 -0000	1.1725
+++ ChangeLog	23 Jul 2015 15:42:26 -0000	1.1726
@@ -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.1725 2015/07/22 12:47:40 kensington Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1726 2015/07/23 15:42:26 williamh Exp $
+
+  23 Jul 2015; William Hubbs <williamh@gentoo.org> golang-build.eclass:
+  Add functions to retrieve Go library paths and install Go packages.
 
   22 Jul 2015; Michael Palimaka <kensington@gentoo.org> kde4-meta.eclass:
   Fix oldpim unpack by Andreas Sturmlechner <andreas.sturmlechner@gmail.com>



1.5                  eclass/golang-build.eclass

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

Index: golang-build.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- golang-build.eclass	6 Jul 2015 16:48:21 -0000	1.4
+++ golang-build.eclass	23 Jul 2015 15:42:26 -0000	1.5
@@ -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.4 2015/07/06 16:48:21 williamh Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v 1.5 2015/07/23 15:42:26 williamh Exp $
 
 # @ECLASS: golang-build.eclass
 # @MAINTAINER:
@@ -48,11 +48,40 @@
 	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
-	set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \
+	set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
 		go build -v -work -x "${EGO_PN}"
 	echo "$@"
 	"$@" || die
@@ -62,20 +91,18 @@
 	debug-print-function ${FUNCNAME} "$@"
 
 	_golang-build_setup
-	set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \
+	set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
 		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_install_pkgs
 }
 
 golang-build_src_test() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	_golang-build_setup
-	set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \
+	set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
 		go test -v -work -x "${EGO_PN}"
 	echo "$@"
 	"$@" || die





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-23 15:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-24 15:38 [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog golang-build.eclass William Hubbs (williamh)
  -- strict thread matches above, loose matches on Subject: below --
2015-06-24 17:04 William Hubbs (williamh)
2015-07-03 21:45 William Hubbs (williamh)
2015-07-06 16:48 William Hubbs (williamh)
2015-07-23 15:42 William Hubbs (williamh)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox