coreos-go-depend: use flags to indicate what version of Go is used

This commit is contained in:
Michael Marineau 2016-08-31 14:17:18 -07:00
parent b19a21acf1
commit 7b7f712298
3 changed files with 52 additions and 4 deletions

View File

@ -0,0 +1,30 @@
# Copyright 2016 CoreOS, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# @ECLASS: coreos-go-depend.eclass
# @BLURB: Minimal Go eclass for simply depending on Go.
# @ECLASS-VARIABLE: COREOS_GO_VERSION
# @DESCRIPTION:
# This variable specifies the version of Go to use. If ommitted the
# default value below will be used.
#
# Example:
# @CODE
# COREOS_GO_VERSION=go1.5
# @CODE
export COREOS_GO_VERSION="${COREOS_GO_VERSION:-go1.6}"
case "${EAPI:-0}" in
5|6) ;;
*) die "Unsupported EAPI=${EAPI} for ${ECLASS}"
esac
inherit coreos-go-utils
# Set a use flag to indicate what version of Go is being used ensure
# the package gets rebuilt when the version changes.
IUSE="+go_version_${COREOS_GO_VERSION//./_}"
REQUIRED_USE="go_version_${COREOS_GO_VERSION//./_}"
DEPEND="dev-lang/go-${COREOS_GO_VERSION#go}*:="

View File

@ -6,17 +6,31 @@
# @BLURB: utility functions for building Go binaries # @BLURB: utility functions for building Go binaries
# @ECLASS-VARIABLE: COREOS_GO_PACKAGE # @ECLASS-VARIABLE: COREOS_GO_PACKAGE
# @REQUIRED
# @DESCRIPTION: # @DESCRIPTION:
# Name of the Go package unpacked to ${S}, this is required. # Name of the Go package unpacked to ${S}.
#
# Example:
# @CODE
# COREOS_GO_PACKAGE="github.com/coreos/mantle"
# @CODE
# @ECLASS-VARIABLE: COREOS_GO_VERSION
# @DESCRIPTION:
# This variable specifies the version of Go to use. If ommitted the
# default value from coreos-go-depend.eclass will be used.
#
# Example:
# @CODE
# COREOS_GO_VERSION=go1.5
# @CODE
case "${EAPI:-0}" in case "${EAPI:-0}" in
5|6) ;; 5|6) ;;
*) die "Unsupported EAPI=${EAPI} for ${ECLASS}" *) die "Unsupported EAPI=${EAPI} for ${ECLASS}"
esac esac
inherit coreos-go-utils multiprocessing inherit coreos-go-depend multiprocessing
DEPEND="dev-lang/go:="
# @FUNCTION: go_build # @FUNCTION: go_build
# @USAGE: <package-name> [<binary-name>] # @USAGE: <package-name> [<binary-name>]

View File

@ -15,6 +15,10 @@ USE_EXPAND_HIDDEN="${USE_EXPAND_HIDDEN} CROS_WORKON_TREE"
USE_EXPAND="${USE_EXPAND} ETCD_PROTOCOLS" USE_EXPAND="${USE_EXPAND} ETCD_PROTOCOLS"
ETCD_PROTOCOLS="1 2" ETCD_PROTOCOLS="1 2"
# Use go_version_* flags to indicate which major version was used.
# For now this is only informational and set by coreos-go.eclass
USE_EXPAND="${USE_EXPAND} GO_VERSION"
# Extra use flags for CoreOS SDK # Extra use flags for CoreOS SDK
USE="${USE} cros_host expat -introspection -cups -tcpd -berkdb" USE="${USE} cros_host expat -introspection -cups -tcpd -berkdb"