summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-lang/gnat-gpl/gnat-gpl-2017.ebuild36
-rw-r--r--eclass/autotools.eclass19
-rw-r--r--sys-devel/automake-wrapper/automake-wrapper-11.ebuild36
-rw-r--r--sys-devel/automake-wrapper/files/am-wrapper-11.sh186
4 files changed, 259 insertions, 18 deletions
diff --git a/dev-lang/gnat-gpl/gnat-gpl-2017.ebuild b/dev-lang/gnat-gpl/gnat-gpl-2017.ebuild
index 445189b6be88..dde7fbf04a93 100644
--- a/dev-lang/gnat-gpl/gnat-gpl-2017.ebuild
+++ b/dev-lang/gnat-gpl/gnat-gpl-2017.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
@@ -11,6 +11,8 @@ inherit eutils toolchain-funcs toolchain
REL=6
MYP=gcc-${REL}-gpl-${PV}-src
+BTSTRP_X86=gnat-gpl-2014-x86-linux-bin
+BTSTRP_AMD64=gnat-gpl-2014-x86_64-linux-bin
DESCRIPTION="GNAT Ada Compiler - GPL version"
HOMEPAGE="http://libre.adacore.com/"
@@ -22,13 +24,19 @@ SRC_URI+="
http://mirrors.cdn.adacore.com/art/591adbc5c7a4473fcbb153ae
-> gcc-interface-${REL}-gpl-${PV}-src.tar.gz
bootstrap? (
- http://mirrors.cdn.adacore.com/art/564b3ebec8e196b040fbe66c ->
- gnat-gpl-2014-x86_64-linux-bin.tar.gz
+ amd64? (
+ http://mirrors.cdn.adacore.com/art/564b3ebec8e196b040fbe66c ->
+ ${BTSTRP_AMD64}.tar.gz
+ )
+ x86? (
+ http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248 ->
+ ${BTSTRP_X86}.tar.gz
+ )
)"
LICENSE+=" GPL-2 GPL-3"
SLOT="${TOOLCHAIN_GCC_PV}"
-KEYWORDS="amd64"
+KEYWORDS="amd64 ~x86"
IUSE="bootstrap"
RDEPEND="!sys-devel/gcc:${TOOLCHAIN_GCC_PV}"
@@ -42,8 +50,15 @@ FSFGCC=gcc-${TOOLCHAIN_GCC_PV}
pkg_setup() {
toolchain_pkg_setup
+
+ if use amd64; then
+ BTSTRP=${BTSTRP_AMD64}
+ else
+ BTSTRP=${BTSTRP_X86}
+ fi
+
if use bootstrap; then
- GCC="${WORKDIR}"/gnat-gpl-2014-x86_64-linux-bin/bin/gcc
+ GCC="${WORKDIR}"/${BTSTRP}/bin/gcc
else
GCC=${ADA:-$(tc-getCC)}
fi
@@ -70,12 +85,12 @@ src_unpack() {
${MYP}.tar.gz
gcc-interface-${REL}-gpl-${PV}-src.tar.gz"
if use bootstrap; then
- GCC_A_FAKEIT="${GCC_A_FAKEIT} gnat-gpl-2014-x86_64-linux-bin.tar.gz"
+ GCC_A_FAKEIT="${GCC_A_FAKEIT} ${BTSTRP}.tar.gz"
fi
toolchain_src_unpack
if use bootstrap; then
- rm gnat-gpl-2014-x86_64-linux-bin/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/ld || die
+ rm ${BTSTRP}/libexec/gcc/${CHOST}/4.7.4/ld || die
fi
}
@@ -102,7 +117,7 @@ src_prepare() {
echo ${TOOLCHAIN_GCC_PV} > gcc/BASE-VER
cd ..
- mv gnat-gpl-${PV}-src/src/ada ${MYP}/gcc/ || die
+ mv ${P}-src/src/ada ${MYP}/gcc/ || die
mv gcc-interface-${REL}-gpl-${PV}-src ${MYP}/gcc/ada/gcc-interface || die
epatch "${FILESDIR}"/${P}-gentoo.patch
cd -
@@ -129,7 +144,7 @@ src_compile() {
toolchain_src_compile
gcc_do_make "-C gcc gnatlib-shared"
ln -s gcc ../build/prev-gcc || die
- ln -s x86_64-pc-linux-gnu ../build/prev-x86_64-pc-linux-gnu || die
+ ln -s ${CHOST} ../build/prev-${CHOST} || die
gcc_do_make "-C gcc gnattools"
}
@@ -167,8 +182,7 @@ src_install() {
pkg_postinst () {
toolchain_pkg_postinst
einfo "This provide the GNAT compiler with gcc for ada/c/c++ and more"
- einfo "Set the ADA variables to ${CTARGET}-gcc-${TOOLCHAIN_GCC_PV} in"
- einfo "your make.conf"
+ einfo "The compiler binary is ${CTARGET}-gcc-${TOOLCHAIN_GCC_PV}"
einfo "Even if the c/c++ compilers are using almost the same patched"
einfo "source as the sys-devel/gcc package its use is not extensively"
einfo "tested, and not supported for updating your system, except for ada"
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 976644288583..3c55a5c464af 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -46,16 +46,20 @@ inherit libtool
# @INTERNAL
# @DESCRIPTION:
# CONSTANT!
-# The latest major version/slot of automake available on each arch. #312315
-# We should list both the latest stable, and the latest unstable. #465732
-# This way the stable builds will still work, but the unstable are allowed
-# to build & test things for us ahead of time (if they have it installed).
+# The latest major unstable and stable version/slot of automake available
+# on each arch.
+# List latest unstable version first to boost testing adoption rate because
+# most package manager dependency resolver will pick the first suitable
+# version.
# If a newer slot is stable on any arch, and is NOT reflected in this list,
# then circular dependencies may arise during emerge @system bootstraps.
+#
+# See bug 312315 and 465732 for further information and context.
+#
# Do NOT change this variable in your ebuilds!
# If you want to force a newer minor version, you can specify the correct
# WANT value by using a colon: <PV>:<WANT_AUTOMAKE>
-_LATEST_AUTOMAKE=( 1.15.1:1.15 1.16:1.16 )
+_LATEST_AUTOMAKE=( 1.16:1.16 1.15.1:1.15 )
_automake_atom="sys-devel/automake"
_autoconf_atom="sys-devel/autoconf"
@@ -439,8 +443,9 @@ autotools_env_setup() {
local pv
for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do
# has_version respects ROOT, but in this case, we don't want it to,
- # thus "ROOT=/" prefix:
- ROOT=/ has_version "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}"
+ # thus "ROOT=/" prefix;
+ # Break on first hit to respect _LATEST_AUTOMAKE order.
+ ROOT=/ has_version "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
done
[[ ${WANT_AUTOMAKE} == "latest" ]] && \
die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE[*]}"
diff --git a/sys-devel/automake-wrapper/automake-wrapper-11.ebuild b/sys-devel/automake-wrapper/automake-wrapper-11.ebuild
new file mode 100644
index 000000000000..71a6ff489ca4
--- /dev/null
+++ b/sys-devel/automake-wrapper/automake-wrapper-11.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="wrapper for automake to manage multiple automake versions"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${FILESDIR}"/am-wrapper-${PV}.sh "${S}"/ || die
+}
+
+src_prepare() {
+ default
+
+ # usr/bin/aclocal: bad substitution -> /bin/sh != POSIX shell
+ if use prefix ; then
+ sed -i -e '1c\#!'"${EPREFIX}"'/bin/sh' \
+ "${S}"/am-wrapper-${PV}.sh || die
+ fi
+}
+
+src_install() {
+ newbin "${S}"/am-wrapper-${PV}.sh automake
+ dosym automake /usr/bin/aclocal
+
+ keepdir /usr/share/aclocal
+}
diff --git a/sys-devel/automake-wrapper/files/am-wrapper-11.sh b/sys-devel/automake-wrapper/files/am-wrapper-11.sh
new file mode 100644
index 000000000000..290762680d22
--- /dev/null
+++ b/sys-devel/automake-wrapper/files/am-wrapper-11.sh
@@ -0,0 +1,186 @@
+#!/bin/sh
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Executes the correct automake version.
+#
+# If WANT_AUTOMAKE is set (can be a whitespace delimited list of versions):
+# - attempt to find an installed version using those
+# - if magic keyword 'latest' is found, pick the latest version that exists
+# - if nothing found, warn, and proceed as if WANT_AUTOMAKE was not set (below)
+# If WANT_AUTOMAKE is not set:
+# - Try to detect the version of automake used to generate things (look at
+# Makefile.in and aclocal.m4 and any other useful file)
+# - If detected version is not found, warn and proceed as if blank slate
+# - Try to locate the latest version of automake that exists and run it
+
+(set -o posix) 2>/dev/null && set -o posix
+
+_stderr() { printf 'am-wrapper: %s: %b\n' "${argv0}" "$*" 1>&2; }
+warn() { _stderr "warning: $*"; }
+err() { _stderr "error: $*"; exit 1; }
+unset IFS
+which() {
+ local p
+ IFS=: # we don't use IFS anywhere, so don't bother saving/restoring
+ for p in ${PATH} ; do
+ p="${p}/$1"
+ [ -e "${p}" ] && echo "${p}" && return 0
+ done
+ unset IFS
+ return 1
+}
+
+#
+# Sanitize argv[0] since it isn't always a full path #385201
+#
+argv0=${0##*/}
+case $0 in
+ ${argv0})
+ # find it in PATH
+ if ! full_argv0=$(which "${argv0}") ; then
+ err "could not locate ${argv0}; file a bug"
+ fi
+ ;;
+ *)
+ # re-use full/relative paths
+ full_argv0=$0
+ ;;
+esac
+
+if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
+ seq() {
+ local f l i
+ case $# in
+ 1) f=1 i=1 l=$1;;
+ 2) f=$1 i=1 l=$2;;
+ 3) f=$1 i=$2 l=$3;;
+ esac
+ while :; do
+ [ $l -lt $f -a $i -gt 0 ] && break
+ [ $f -lt $l -a $i -lt 0 ] && break
+ echo $f
+ : $(( f += i ))
+ done
+ return 0
+ }
+fi
+
+#
+# Set up bindings between actual version and WANT_AUTOMAKE;
+# Start with last known versions to speed up lookup process.
+#
+LAST_KNOWN_AUTOMAKE_VER="16"
+vers=$(printf '1.%s ' `seq ${LAST_KNOWN_AUTOMAKE_VER} -1 4`)
+
+#
+# Helper to scan for a usable program based on version.
+#
+binary=
+all_vers=
+find_binary() {
+ local v
+ all_vers="${all_vers} $*" # For error messages.
+ for v ; do
+ if [ -x "${full_argv0}-${v}" ] ; then
+ binary="${full_argv0}-${v}"
+ binary_ver=${v}
+ return 0
+ fi
+ done
+ return 1
+}
+
+#
+# Try and find a usable automake version. First check the WANT_AUTOMAKE
+# setting (whitespace delimited list), then fallback to the latest.
+#
+find_latest() {
+ if ! find_binary ${vers} ; then
+ # Brute force it.
+ find_binary $(printf '1.%s ' `seq 99 -1 ${LAST_KNOWN_AUTOMAKE_VER}`)
+ fi
+}
+for wx in ${WANT_AUTOMAKE:-latest} ; do
+ if [ "${wx}" = "latest" ] ; then
+ find_latest && break
+ else
+ find_binary ${wx} && break
+ fi
+done
+
+if [ -z "${binary}" ] && [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "could not locate installed version for WANT_AUTOMAKE='${WANT_AUTOMAKE}'; ignoring"
+ unset WANT_AUTOMAKE
+ find_latest
+fi
+
+if [ -z "${binary}" ] ; then
+ err "Unable to locate any usuable version of automake.\n" \
+ "\tI tried these versions:${all_vers}\n" \
+ "\tWith a base name of '${full_argv0}'."
+fi
+
+#
+# autodetect helpers
+#
+do_awk() {
+ local file=$1 ; shift
+ local v=$(awk -v regex="$*" '{
+ if (ret = match($0, regex)) {
+ s = substr($0, ret, RLENGTH)
+ ret = match(s, "[0-9]\\.[0-9]+")
+ print substr(s, ret, RLENGTH)
+ exit
+ }
+ }' "${file}")
+ case " ${auto_vers} " in
+ *" ${v} "*) ;;
+ *) auto_vers="${auto_vers:+${auto_vers} }${v}" ;;
+ esac
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+ auto_vers=
+ if [ -r "Makefile.in" ] ; then
+ do_awk Makefile.in '^# Makefile.in generated (automatically )?by automake [0-9]\\.[0-9]+'
+ fi
+ if [ -r "aclocal.m4" ] ; then
+ do_awk aclocal.m4 'generated automatically by aclocal [0-9]\\.[0-9]+'
+ do_awk aclocal.m4 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?[0-9]\\.[0-9]+[^)]*\\]?\\)'
+ fi
+ # We don't need to set $binary here as it has already been setup for us
+ # earlier to the latest available version.
+ if [ -n "${auto_vers}" ] ; then
+ if ! find_binary ${auto_vers} ; then
+ warn "auto-detected versions not found (${auto_vers}); falling back to latest available"
+ fi
+ fi
+fi
+
+if [ -n "${WANT_AMWRAPPER_DEBUG}" ] ; then
+ if [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}"
+ fi
+ warn "DEBUG: will execute <${binary}>"
+fi
+
+#
+# for further consistency
+#
+export WANT_AUTOMAKE="${binary_ver}"
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+ # this shouldn't happen
+ err "${binary} is missing or not executable.\n" \
+ "\tPlease try installing the correct version of automake."
+fi
+
+exec "${binary}" "$@"
+# The shell will error out if `exec` failed.