diff --git a/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go-depend.eclass b/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go-depend.eclass new file mode 100644 index 0000000000..eb471b5875 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go-depend.eclass @@ -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}*:=" diff --git a/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go.eclass b/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go.eclass index aa22af7077..ea348e80f3 100644 --- a/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go.eclass +++ b/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go.eclass @@ -6,17 +6,31 @@ # @BLURB: utility functions for building Go binaries # @ECLASS-VARIABLE: COREOS_GO_PACKAGE +# @REQUIRED # @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 5|6) ;; *) die "Unsupported EAPI=${EAPI} for ${ECLASS}" esac -inherit coreos-go-utils multiprocessing - -DEPEND="dev-lang/go:=" +inherit coreos-go-depend multiprocessing # @FUNCTION: go_build # @USAGE: [] diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/make.defaults b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/make.defaults index c66eb2699a..880324bd61 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/make.defaults +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/make.defaults @@ -15,6 +15,10 @@ USE_EXPAND_HIDDEN="${USE_EXPAND_HIDDEN} CROS_WORKON_TREE" USE_EXPAND="${USE_EXPAND} ETCD_PROTOCOLS" 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 USE="${USE} cros_host expat -introspection -cups -tcpd -berkdb"