mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-22 15:01:00 +02:00
dev-lang/go: import latest upstream live ebuild
This commit is contained in:
parent
fb9b323483
commit
e8cf09be54
@ -1,25 +1,37 @@
|
||||
# Copyright 1999-2015 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/go/go-9999.ebuild,v 1.30 2015/07/06 16:21:21 williamh Exp $
|
||||
|
||||
EAPI=5
|
||||
|
||||
export CTARGET=${CTARGET:-${CHOST}}
|
||||
|
||||
inherit eutils toolchain-funcs
|
||||
|
||||
EGIT_REPO_URI="git://github.com/golang/go.git"
|
||||
inherit git-r3
|
||||
KEYWORDS="-* ~amd64 arm64"
|
||||
if [[ ${PV} = 9999 ]]; then
|
||||
EGIT_REPO_URI="git://github.com/golang/go.git"
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://storage.googleapis.com/golang/go${PV}.src.tar.gz"
|
||||
# Upstream only supports go on amd64, arm and x86 architectures.
|
||||
KEYWORDS="-* ~amd64 ~arm ~x86 ~amd64-fbsd ~x86-fbsd ~x64-macos ~x86-macos"
|
||||
fi
|
||||
|
||||
DESCRIPTION="A concurrent garbage collected and typesafe programming language"
|
||||
HOMEPAGE="http://www.golang.org"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
SLOT="0/${PV}"
|
||||
IUSE=""
|
||||
|
||||
DEPEND=""
|
||||
DEPEND=">=dev-lang/go-bootstrap-1.4.1"
|
||||
RDEPEND=""
|
||||
|
||||
# These test data objects have writable/executable stacks.
|
||||
QA_EXECSTACK="
|
||||
usr/lib/go/src/debug/elf/testdata/go-relocation-test-gcc482-aarch64.obj
|
||||
usr/lib/go/src/debug/elf/testdata/gcc-amd64-openbsd-debug-with-rela.obj"
|
||||
|
||||
# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
|
||||
QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
|
||||
|
||||
@ -27,33 +39,30 @@ QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
|
||||
# stripped.
|
||||
STRIP_MASK="/usr/lib/go/pkg/linux*/*.a /usr/lib/go/pkg/freebsd*/*.a /usr/lib/go/pkg/darwin*/*.a"
|
||||
|
||||
build_arch()
|
||||
{
|
||||
case "$CBUILD" in
|
||||
aarch64*) echo arm64;;
|
||||
x86_64*) echo amd64;;
|
||||
esac
|
||||
}
|
||||
|
||||
same_arch()
|
||||
{
|
||||
[[ "${ARCH}" = "$(build_arch)" ]]
|
||||
}
|
||||
if [[ ${PV} != 9999 ]]; then
|
||||
S="${WORKDIR}"/go
|
||||
fi
|
||||
|
||||
src_prepare()
|
||||
{
|
||||
|
||||
if [[ ${PV} != 9999 ]]; then
|
||||
sed -i -e 's/"-Werror",//g' src/cmd/dist/build.go ||
|
||||
die 'sed failed'
|
||||
fi
|
||||
epatch_user
|
||||
}
|
||||
|
||||
src_compile()
|
||||
{
|
||||
export GOOS="linux"
|
||||
export GOARCH="${ARCH}"
|
||||
export GOROOT_BOOTSTRAP="/usr/lib/go1.4"
|
||||
export GOROOT_BOOTSTRAP="${EPREFIX}"/usr/lib/go1.4
|
||||
export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
|
||||
export GOROOT="$(pwd)"
|
||||
export GOBIN=${GOROOT}/bin
|
||||
export GOBIN="${GOROOT}/bin"
|
||||
if [[ $CTARGET = armv5* ]]
|
||||
then
|
||||
export GOARM=5
|
||||
fi
|
||||
tc-export CC
|
||||
|
||||
cd src
|
||||
./make.bash || die "build failed"
|
||||
@ -61,8 +70,6 @@ src_compile()
|
||||
|
||||
src_test()
|
||||
{
|
||||
$(same_arch) || return 0;
|
||||
|
||||
cd src
|
||||
PATH="${GOBIN}:${PATH}" \
|
||||
./run.bash --no-rebuild --banner || die "tests failed"
|
||||
@ -70,15 +77,7 @@ src_test()
|
||||
|
||||
src_install()
|
||||
{
|
||||
local bin_path
|
||||
|
||||
if $(same_arch); then
|
||||
bin_path=${GOBIN}
|
||||
else
|
||||
bin_path=${GOBIN}/${GOOS}_${GOARCH}
|
||||
fi
|
||||
|
||||
dobin ${bin_path}/*
|
||||
dobin bin/*
|
||||
dodoc AUTHORS CONTRIBUTORS PATENTS README.md
|
||||
|
||||
dodir /usr/lib/go
|
||||
@ -92,6 +91,13 @@ src_install()
|
||||
fperms -R +x /usr/lib/go/pkg/tool
|
||||
}
|
||||
|
||||
pkg_preinst()
|
||||
{
|
||||
has_version '<dev-lang/go-1.4' &&
|
||||
export had_support_files=true ||
|
||||
export had_support_files=false
|
||||
}
|
||||
|
||||
pkg_postinst()
|
||||
{
|
||||
# If the go tool sees a package file timestamped older than a dependancy it
|
||||
@ -103,4 +109,19 @@ pkg_postinst()
|
||||
find "${EROOT}"usr/lib/go -type f \
|
||||
-exec touch -r "${EROOT}"${tref} {} \;
|
||||
eend $?
|
||||
|
||||
if [[ ${PV} != 9999 && -n ${REPLACING_VERSIONS} &&
|
||||
${REPLACING_VERSIONS} != ${PV} ]]; then
|
||||
elog "Release notes are located at http://golang.org/doc/go${PV}"
|
||||
fi
|
||||
|
||||
if $had_support_files; then
|
||||
ewarn
|
||||
ewarn "All editor support, IDE support, shell completion"
|
||||
ewarn "support, etc has been removed from the go package"
|
||||
ewarn "upstream."
|
||||
ewarn "For more information on which support is available, see"
|
||||
ewarn "the following URL:"
|
||||
ewarn "https://github.com/golang/go/wiki/IDEsAndTextEditorPlugins"
|
||||
fi
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user