1 |
williamh 15/07/23 15:42:26 |
2 |
|
3 |
Modified: ChangeLog golang-build.eclass |
4 |
Log: |
5 |
Add functions to retrieve Go library paths and install Go packages. |
6 |
|
7 |
Revision Changes Path |
8 |
1.1726 eclass/ChangeLog |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1726&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1726&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1725&r2=1.1726 |
13 |
|
14 |
Index: ChangeLog |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
17 |
retrieving revision 1.1725 |
18 |
retrieving revision 1.1726 |
19 |
diff -u -r1.1725 -r1.1726 |
20 |
--- ChangeLog 22 Jul 2015 12:47:40 -0000 1.1725 |
21 |
+++ ChangeLog 23 Jul 2015 15:42:26 -0000 1.1726 |
22 |
@@ -1,6 +1,9 @@ |
23 |
# ChangeLog for eclass directory |
24 |
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1725 2015/07/22 12:47:40 kensington Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1726 2015/07/23 15:42:26 williamh Exp $ |
27 |
+ |
28 |
+ 23 Jul 2015; William Hubbs <williamh@g.o> golang-build.eclass: |
29 |
+ Add functions to retrieve Go library paths and install Go packages. |
30 |
|
31 |
22 Jul 2015; Michael Palimaka <kensington@g.o> kde4-meta.eclass: |
32 |
Fix oldpim unpack by Andreas Sturmlechner <andreas.sturmlechner@×××××.com> |
33 |
|
34 |
|
35 |
|
36 |
1.5 eclass/golang-build.eclass |
37 |
|
38 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-build.eclass?rev=1.5&view=markup |
39 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-build.eclass?rev=1.5&content-type=text/plain |
40 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/golang-build.eclass?r1=1.4&r2=1.5 |
41 |
|
42 |
Index: golang-build.eclass |
43 |
=================================================================== |
44 |
RCS file: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v |
45 |
retrieving revision 1.4 |
46 |
retrieving revision 1.5 |
47 |
diff -u -r1.4 -r1.5 |
48 |
--- golang-build.eclass 6 Jul 2015 16:48:21 -0000 1.4 |
49 |
+++ golang-build.eclass 23 Jul 2015 15:42:26 -0000 1.5 |
50 |
@@ -1,6 +1,6 @@ |
51 |
# Copyright 1999-2015 Gentoo Foundation |
52 |
# Distributed under the terms of the GNU General Public License v2 |
53 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v 1.4 2015/07/06 16:48:21 williamh Exp $ |
54 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v 1.5 2015/07/23 15:42:26 williamh Exp $ |
55 |
|
56 |
# @ECLASS: golang-build.eclass |
57 |
# @MAINTAINER: |
58 |
@@ -48,11 +48,40 @@ |
59 |
return 0 |
60 |
} |
61 |
|
62 |
+# @FUNCTION: get_golibdir |
63 |
+# @DESCRIPTION: |
64 |
+# Return the non-prefixed library directory where Go packages |
65 |
+# should be installed |
66 |
+get_golibdir() { |
67 |
+ echo /usr/lib/go-gentoo |
68 |
+} |
69 |
+ |
70 |
+# @FUNCTION: get_golibdir |
71 |
+# @DESCRIPTION: |
72 |
+# Return the library directory where Go packages should be installed |
73 |
+# This is the prefixed version which should be included in GOPATH |
74 |
+get_golibdir_gopath() { |
75 |
+ echo "${EPREFIX}$(get_golibdir)" |
76 |
+} |
77 |
+ |
78 |
+# @FUNCTION: golang_install_pkgs |
79 |
+# @DESCRIPTION: |
80 |
+# Install Go packages. |
81 |
+# This function assumes that $cwd is a Go workspace. |
82 |
+golang_install_pkgs() { |
83 |
+ debug-print-function ${FUNCNAME} "$@" |
84 |
+ |
85 |
+ _golang-build_setup |
86 |
+ insinto "$(get_golibdir)" |
87 |
+ insopts -m0644 -p # preserve timestamps for bug 551486 |
88 |
+ doins -r pkg src |
89 |
+} |
90 |
+ |
91 |
golang-build_src_compile() { |
92 |
debug-print-function ${FUNCNAME} "$@" |
93 |
|
94 |
_golang-build_setup |
95 |
- set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \ |
96 |
+ set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \ |
97 |
go build -v -work -x "${EGO_PN}" |
98 |
echo "$@" |
99 |
"$@" || die |
100 |
@@ -62,20 +91,18 @@ |
101 |
debug-print-function ${FUNCNAME} "$@" |
102 |
|
103 |
_golang-build_setup |
104 |
- set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \ |
105 |
+ set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \ |
106 |
go install -v -work -x "${EGO_PN}" |
107 |
echo "$@" |
108 |
"$@" || die |
109 |
- insinto /usr/lib/go-gentoo |
110 |
- insopts -m0644 -p # preserve timestamps for bug 551486 |
111 |
- doins -r pkg src |
112 |
+ golang_install_pkgs |
113 |
} |
114 |
|
115 |
golang-build_src_test() { |
116 |
debug-print-function ${FUNCNAME} "$@" |
117 |
|
118 |
_golang-build_setup |
119 |
- set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \ |
120 |
+ set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \ |
121 |
go test -v -work -x "${EGO_PN}" |
122 |
echo "$@" |
123 |
"$@" || die |