mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-21 14:31:02 +02:00
Merge pull request #1049 from marineam/mantle
Add ebuild for mantle and start generic go eclass
This commit is contained in:
commit
b4e27a9bab
1
sdk_container/src/third_party/coreos-overlay/coreos-devel/mantle/mantle-0.0.1.ebuild
vendored
Symbolic link
1
sdk_container/src/third_party/coreos-overlay/coreos-devel/mantle/mantle-0.0.1.ebuild
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
mantle-9999.ebuild
|
25
sdk_container/src/third_party/coreos-overlay/coreos-devel/mantle/mantle-9999.ebuild
vendored
Normal file
25
sdk_container/src/third_party/coreos-overlay/coreos-devel/mantle/mantle-9999.ebuild
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Copyright 2014 CoreOS, Inc.
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
EAPI=5
|
||||||
|
CROS_WORKON_PROJECT="coreos/mantle"
|
||||||
|
CROS_WORKON_REPO="git://github.com"
|
||||||
|
COREOS_GO_PACKAGE="github.com/coreos/mantle"
|
||||||
|
|
||||||
|
if [[ "${PV}" == 9999 ]]; then
|
||||||
|
KEYWORDS="~amd64"
|
||||||
|
else
|
||||||
|
CROS_WORKON_COMMIT="14c53ce56771da9bc9a3f80a2f05a2aa65780e60"
|
||||||
|
KEYWORDS="amd64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
inherit coreos-go cros-workon
|
||||||
|
|
||||||
|
DESCRIPTION="Mantle: Gluing CoreOS together"
|
||||||
|
HOMEPAGE="https://github.com/coreos/mantle"
|
||||||
|
LICENSE="Apache-2"
|
||||||
|
SLOT="0"
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
go_build "${COREOS_GO_PACKAGE}"/plume
|
||||||
|
}
|
61
sdk_container/src/third_party/coreos-overlay/eclass/coreos-go.eclass
vendored
Normal file
61
sdk_container/src/third_party/coreos-overlay/eclass/coreos-go.eclass
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# Copyright 2014 CoreOS, Inc.
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: $
|
||||||
|
|
||||||
|
# @ECLASS: coreos-go.eclass
|
||||||
|
# @BLURB: utility functions for building Go binaries
|
||||||
|
|
||||||
|
# @ECLASS-VARIABLE: COREOS_GO_PACKAGE
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Name of the Go package unpacked to ${S}, this is required.
|
||||||
|
|
||||||
|
[[ ${EAPI} != "5" ]] && die "Only EAPI=5 is supported"
|
||||||
|
|
||||||
|
inherit multiprocessing
|
||||||
|
|
||||||
|
DEPEND="dev-lang/go"
|
||||||
|
|
||||||
|
# @FUNCTION: go_build
|
||||||
|
# @USAGE: <package-name> [<binary-name>]
|
||||||
|
go_build() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
[[ $# -eq 0 || $# -gt 2 ]] && die "go_install: incorrect # of arguments"
|
||||||
|
local package_name="$1"
|
||||||
|
local binary_name="${package_name##*/}"
|
||||||
|
|
||||||
|
# TODO: handle cgo, cross-compiling, etc etc...
|
||||||
|
CGO_ENABLED=0 go build -x -p "$(makeopts_jobs)" \
|
||||||
|
-o "${GOPATH}/bin/${binary_name}" "${package_name}" \
|
||||||
|
|| die "go build failed"
|
||||||
|
}
|
||||||
|
|
||||||
|
coreos-go_src_prepare() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
export GOPATH="${WORKDIR}/gopath"
|
||||||
|
export GOBIN="${GOPATH}/bin"
|
||||||
|
mkdir -p "${GOBIN}" || die
|
||||||
|
|
||||||
|
if [[ -z "${COREOS_GO_PACKAGE}" ]]; then
|
||||||
|
die "COREOS_GO_PACKAGE must be defined by the ebuild"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local package_path="${GOPATH}/src/${COREOS_GO_PACKAGE}"
|
||||||
|
mkdir -p "${package_path%/*}" || die
|
||||||
|
ln -sT "${S}" "${package_path}" || die
|
||||||
|
}
|
||||||
|
|
||||||
|
coreos-go_src_compile() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
go_build "${COREOS_GO_PACKAGE}"
|
||||||
|
}
|
||||||
|
|
||||||
|
coreos-go_src_install() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
dobin "${GOBIN}"/*
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPORT_FUNCTIONS src_prepare src_compile src_install
|
Loading…
x
Reference in New Issue
Block a user