/[gentoo-x86]/eclass/golang-build.eclass
Gentoo

Contents of /eclass/golang-build.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Mon Jul 27 19:11:00 2015 UTC (3 years, 8 months ago) by williamh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +6 -46 lines
Add golang-base.eclass for the basic golang functions and set up the
other go eclasses to use it.

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/golang-build.eclass,v 1.5 2015/07/23 15:42:26 williamh Exp $
4
5 # @ECLASS: golang-build.eclass
6 # @MAINTAINER:
7 # William Hubbs <williamh@gentoo.org>
8 # @BLURB: Eclass for compiling go packages.
9 # @DESCRIPTION:
10 # This eclass provides default src_compile, src_test and src_install
11 # functions for software written in the Go programming language.
12
13 inherit golang-base
14
15 case "${EAPI:-0}" in
16 5)
17 ;;
18 *)
19 die "${ECLASS}: Unsupported eapi (EAPI=${EAPI})"
20 ;;
21 esac
22
23 EXPORT_FUNCTIONS src_compile src_install src_test
24
25 if [[ -z ${_GOLANG_BUILD} ]]; then
26
27 _GOLANG_BUILD=1
28
29 # @ECLASS-VARIABLE: EGO_PN
30 # @REQUIRED
31 # @DESCRIPTION:
32 # This is the import path for the go package(s) to build. Please emerge
33 # dev-lang/go and read "go help importpath" for syntax.
34 #
35 # Example:
36 # @CODE
37 # EGO_PN=github.com/user/package
38 # @CODE
39
40 golang-build_src_compile() {
41 debug-print-function ${FUNCNAME} "$@"
42
43 ego_pn_check
44 set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
45 go build -v -work -x "${EGO_PN}"
46 echo "$@"
47 "$@" || die
48 }
49
50 golang-build_src_install() {
51 debug-print-function ${FUNCNAME} "$@"
52
53 ego_pn_check
54 set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
55 go install -v -work -x "${EGO_PN}"
56 echo "$@"
57 "$@" || die
58 golang_install_pkgs
59 }
60
61 golang-build_src_test() {
62 debug-print-function ${FUNCNAME} "$@"
63
64 ego_pn_check
65 set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
66 go test -v -work -x "${EGO_PN}"
67 echo "$@"
68 "$@" || die
69 }
70
71 fi

  ViewVC Help
Powered by ViewVC 1.1.20