[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2024-01-21 Thread Fabian Groffen
commit: 42766d37044e2479bee6c9e885238bc9703eddd6
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jan 21 13:46:52 2024 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jan 21 13:46:52 2024 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=42766d37

eclass/java-utils-2: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/java-utils-2.eclass | 158 +
 1 file changed, 116 insertions(+), 42 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index fa46b72b3d..a84f7c3002 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2022 Gentoo Authors
+# Copyright 2004-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: java-utils-2.eclass
@@ -6,7 +6,7 @@
 # j...@gentoo.org
 # @AUTHOR:
 # Thomas Matthijs , Karl Trygve Kalleberg 
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: Base eclass for Java packages
 # @DESCRIPTION:
 # This eclass provides functionality which is used by java-pkg-2.eclass,
@@ -17,17 +17,17 @@
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
 
-case ${EAPI:-0} in
-   [5678]) ;;
+case ${EAPI} in
+   6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then
 _JAVA_UTILS_2_ECLASS=1
 
-# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier 
eclasses.
+# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier EAPIs.
 # Keep versionator inheritance in case consumers are using it implicitly.
-[[ ${EAPI} == [56] ]] && inherit eapi7-ver eutils multilib versionator
+[[ ${EAPI} == 6 ]] && inherit eapi7-ver eqawarn multilib versionator
 
 # Make sure we use java-config-2
 export WANT_JAVA_CONFIG="2"
@@ -37,7 +37,7 @@ has test ${JAVA_PKG_IUSE} && RESTRICT+=" !test? ( test )"
 # @VARIABLE: JAVA_PKG_E_DEPEND
 # @INTERNAL
 # @DESCRIPTION:
-# This is a convience variable to be used from the other java eclasses. This is
+# This is a convenience variable to be used from the other java eclasses. This 
is
 # the version of java-config we want to use. Usually the latest stable version
 # so that ebuilds can use new features without depending on specific versions.
 JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.2.0-r3"
@@ -66,6 +66,21 @@ JAVA_PKG_ALLOW_VM_CHANGE=${JAVA_PKG_ALLOW_VM_CHANGE:="yes"}
 #  JAVA_PKG_FORCE_VM=openjdk-11 emerge foo
 # @CODE
 
+# @ECLASS_VARIABLE: JAVA_PKG_NO_CLEAN
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# An array of expressions to match *.class or *.jar files in order to  protect
+# them against deletion by java-pkg_clean.
+#
+# @CODE
+#  JAVA_PKG_NO_CLEAN=(
+#  "*/standard.jar"
+#  "*/launch4j.jar"
+#  "*/apps/jetty/apache-tomcat*"
+#  "*/lib/jetty*"
+#  )
+# @CODE
+
 # @ECLASS_VARIABLE: JAVA_PKG_WANT_BUILD_VM
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -124,7 +139,7 @@ JAVA_PKG_ALLOW_VM_CHANGE=${JAVA_PKG_ALLOW_VM_CHANGE:="yes"}
 #  )
 # @CODE
 
-# @ECLASS-VARIABLE: JAVA_TEST_RUNNER_EXTRA_ARGS
+# @ECLASS_VARIABLE: JAVA_TEST_RUNNER_EXTRA_ARGS
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Array of extra arguments that should be passed to the test runner when 
running tests.
@@ -203,6 +218,46 @@ 
JAVA_PKG_COMPILERS_CONF=${JAVA_PKG_COMPILERS_CONF:="${EPREFIX}/etc/java-config-2
 #  ebuild foo.ebuild compile
 # @CODE
 
+# @ECLASS_VARIABLE: JAVADOC_CLASSPATH
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Comma or space separated list of java packages that are needed for generating
+# javadocs. Can be used to avoid overloading the compile classpath in multi-jar
+# packages if there are jar files which have different dependencies.
+#
+# @CODE
+# Example:
+#  JAVADOC_CLASSPATH="
+#  jna-4
+#  jsch
+#  "
+# @CODE
+
+# @ECLASS_VARIABLE: JAVADOC_SRC_DIRS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# An array of directories relative to ${S} which contain the sources of
+# the application. It needs to sit in global scope; if put in src_compile()
+# it would not work.
+# It is needed by the java-pkg-simple.eclass to decide whether to call ejavadoc
+# or not. If this variable is defined then java-pkg-simple_src_compile will not
+# call ejavadoc automatically. ejavadoc has then to be called explicitly from
+# the ebuild. It is meant for usage in multi-jar packages in order to avoid an
+# extra compilation run only for producing the javadocs.
+#
+# @CODE
+# Example:
+#  JAVADOC_SRC_DIRS=(
+#  "${PN}-core"
+#  "${PN}-jsch"
+#  "${PN}-pageant"
+#  "${PN}-sshagent"
+#  "${PN}-usocket-jna"
+#  "${PN}-usocket-nc"
+#  "${PN}-connector-factory"
+#  )
+# @CODE
+
 # TODO document me
 JAVA_PKG_QA_VIOLATIONS=0
 
@@ -316,7 +371,6 @@ java-pkg_rm_files() {
[[ ! -f 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2024-01-21 Thread Fabian Groffen
commit: e94414618cb776a0d2e3808db5303667a7f007a9
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jan 21 13:43:36 2024 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jan 21 13:43:36 2024 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=e9441461

eclass/python-utils-r1: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 245 +++---
 1 file changed, 180 insertions(+), 65 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index e565a8f752..5abe526b45 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: python-utils-r1.eclass
@@ -114,11 +114,18 @@ _python_verify_patterns() {
 _python_set_impls() {
local i
 
-   if ! declare -p PYTHON_COMPAT &>/dev/null; then
-   die 'PYTHON_COMPAT not declared.'
+   # TODO: drop BASH_VERSINFO check when we require EAPI 8
+   if [[ ${BASH_VERSINFO[0]} -ge 5 ]]; then
+   [[ ${PYTHON_COMPAT@a} == *a* ]]
+   else
+   [[ $(declare -p PYTHON_COMPAT) == "declare -a"* ]]
fi
-   if [[ $(declare -p PYTHON_COMPAT) != "declare -a"* ]]; then
-   die 'PYTHON_COMPAT must be an array.'
+   if [[ ${?} -ne 0 ]]; then
+   if ! declare -p PYTHON_COMPAT &>/dev/null; then
+   die 'PYTHON_COMPAT not declared.'
+   else
+   die 'PYTHON_COMPAT must be an array.'
+   fi
fi
 
local obsolete=()
@@ -146,17 +153,6 @@ _python_set_impls() {
done
fi
 
-   if [[ -n ${obsolete[@]} && ${EBUILD_PHASE} == setup ]]; then
-   # complain if people don't clean up old impls while touching
-   # the ebuilds recently.  use the copyright year to infer last
-   # modification
-   # NB: this check doesn't have to work reliably
-   if [[ $(head -n 1 "${EBUILD}" 2>/dev/null) == *2022* ]]; then
-   eqawarn "Please clean PYTHON_COMPAT of obsolete 
implementations:"
-   eqawarn "  ${obsolete[*]}"
-   fi
-   fi
-
local supp=() unsupp=()
 
for i in "${_PYTHON_ALL_IMPLS[@]}"; do
@@ -231,12 +227,11 @@ _python_impl_matches() {
fi
return 0
;;
-   3.9)
-   # the only unmasked pypy3 version is pypy3.9 atm
+   3.10)
[[ ${impl} == python${pattern/./_} || ${impl} 
== pypy3 ]] &&
return 0
;;
-   3.8|3.1[0-2])
+   3.8|3.9|3.1[1-2])
[[ ${impl} == python${pattern/./_} ]] && return 0
;;
*)
@@ -332,7 +327,9 @@ _python_export() {
debug-print "${FUNCNAME}: EPYTHON = ${EPYTHON}"
;;
PYTHON)
-   export PYTHON=${EPREFIX}/usr/bin/${impl}
+   # Under EAPI 7+, this should just use ${BROOT}, 
but Portage
+   # <3.0.50 was buggy, and prefix users need this 
to update.
+   export 
PYTHON=${BROOT-${EPREFIX}}/usr/bin/${impl}
if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
&& [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
&& { has prefix-stack ${USE} || has 
stacked-prefix ${FEATURES} ;} ; then
@@ -346,9 +343,9 @@ _python_export() {
PYTHON_SITEDIR)
[[ -n ${PYTHON} ]] || die "PYTHON needs to be 
set for ${var} to be exported, or requested before it"
PYTHON_SITEDIR=$(
-   "${PYTHON}" - <<-EOF || die
-   import sysconfig
-   
print(sysconfig.get_path("purelib"))
+   "${PYTHON}" - "${EPREFIX}/usr" <<-EOF 
|| die
+   import sys, sysconfig
+   
print(sysconfig.get_path("purelib", vars={"base": sys.argv[1]}))
EOF
)
export PYTHON_SITEDIR
@@ -357,9 +354,9 @@ _python_export() {
PYTHON_INCLUDEDIR)
[[ -n 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2024-01-21 Thread Fabian Groffen
commit: 0d1ac117b6e0bee5364324c978aee33a76492fe8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jan 21 13:39:58 2024 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jan 21 13:39:58 2024 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=0d1ac117

eclass/toolchain: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain-funcs.eclass | 230 +++---
 eclass/toolchain.eclass   | 167 --
 2 files changed, 241 insertions(+), 156 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 166ea71e7e..5338dc6509 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,10 +1,10 @@
-# Copyright 2002-2022 Gentoo Authors
+# Copyright 2002-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: toolchain-funcs.eclass
 # @MAINTAINER:
 # Toolchain Ninjas 
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: functions to query common info about the toolchain
 # @DESCRIPTION:
 # The toolchain-funcs aims to provide a complete suite of functions
@@ -13,9 +13,8 @@
 # in such a way that you can rely on the function always returning
 # something sane.
 
-case ${EAPI:-0} in
-   # EAPI=0 is still used by crossdev, bug #797367
-   0|5|6|7|8) ;;
+case ${EAPI} in
+   6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
@@ -341,7 +340,7 @@ tc-is-static-only() {
 tc-stack-grows-down() {
# List the few that grow up.
case ${ARCH} in
-   hppa|metag) return 1 ;;
+   hppa|metag) return 1 ;;
esac
 
# Assume all others grow down.
@@ -358,16 +357,16 @@ tc-export_build_env() {
# Some build envs will initialize vars like:
# : ${BUILD_LDFLAGS:-${LDFLAGS}}
# So make sure all variables are non-empty. #526734
-   : ${BUILD_CFLAGS:=-O1 -pipe}
-   : ${BUILD_CXXFLAGS:=-O1 -pipe}
-   : ${BUILD_CPPFLAGS:= }
-   : ${BUILD_LDFLAGS:= }
+   : "${BUILD_CFLAGS:=-O1 -pipe}"
+   : "${BUILD_CXXFLAGS:=-O1 -pipe}"
+   : "${BUILD_CPPFLAGS:= }"
+   : "${BUILD_LDFLAGS:= }"
else
# https://bugs.gentoo.org/654424
-   : ${BUILD_CFLAGS:=${CFLAGS}}
-   : ${BUILD_CXXFLAGS:=${CXXFLAGS}}
-   : ${BUILD_CPPFLAGS:=${CPPFLAGS}}
-   : ${BUILD_LDFLAGS:=${LDFLAGS}}
+   : "${BUILD_CFLAGS:=${CFLAGS}}"
+   : "${BUILD_CXXFLAGS:=${CXXFLAGS}}"
+   : "${BUILD_CPPFLAGS:=${CPPFLAGS}}"
+   : "${BUILD_LDFLAGS:=${LDFLAGS}}"
fi
export BUILD_{C,CXX,CPP,LD}FLAGS
 
@@ -380,7 +379,6 @@ tc-export_build_env() {
 
 # @FUNCTION: tc-env_build
 # @USAGE:  [command args]
-# @INTERNAL
 # @DESCRIPTION:
 # Setup the compile environment to the build tools and then execute the
 # specified command.  We use tc-getBUILD_XX here so that we work with
@@ -426,26 +424,27 @@ tc-env_build() {
 # src_configure() {
 #  ECONF_SOURCE=${S}
 #  if tc-is-cross-compiler ; then
-#  mkdir "${WORKDIR}"/${CBUILD}
-#  pushd "${WORKDIR}"/${CBUILD} >/dev/null
+#  mkdir "${WORKDIR}"/${CBUILD} || die
+#  pushd "${WORKDIR}"/${CBUILD} >/dev/null || die
 #  econf_build --disable-some-unused-stuff
-#  popd >/dev/null
+#  popd >/dev/null || die
 #  fi
 #  ... normal build paths ...
 # }
 # src_compile() {
 #  if tc-is-cross-compiler ; then
-#  pushd "${WORKDIR}"/${CBUILD} >/dev/null
+#  pushd "${WORKDIR}"/${CBUILD} >/dev/null || die
 #  emake one-or-two-build-tools
-#  ln/mv build-tools to normal build paths in ${S}/
-#  popd >/dev/null
+#  ln/mv build-tools to normal build paths in ${S}/ || die
+#  popd >/dev/null || die
 #  fi
 #  ... normal build paths ...
 # }
 # @CODE
 econf_build() {
local CBUILD=${CBUILD:-${CHOST}}
-   tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@"
+   econf_env() { CHOST=${CBUILD} econf "$@"; }
+   tc-env_build econf_env "$@"
 }
 
 # @FUNCTION: tc-ld-is-gold
@@ -455,6 +454,9 @@ econf_build() {
 tc-ld-is-gold() {
local out
 
+   # Ensure ld output is in English.
+   local -x LC_ALL=C
+
# First check the linker directly.
out=$($(tc-getLD "$@") --version 2>&1)
if [[ ${out} == *"GNU gold"* ]] ; then
@@ -466,7 +468,7 @@ tc-ld-is-gold() {
# options and not CFLAGS/CXXFLAGS.
local base="${T}/test-tc-gold"
cat <<-EOF > "${base}.c"
-   int main() { return 0; }
+   int main(void) { return 0; }
EOF
out=$($(tc-getCC "$@") ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -Wl,--version 
"${base}.c" -o "${base}" 2>&1)
 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2023-12-16 Thread Fabian Groffen
commit: 5136685f4f05440d4a47d5dfa19e7d5a7448617c
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Dec 16 15:34:59 2023 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Dec 16 15:34:59 2023 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5136685f

eclass/toolchain-funcs: add arm64-macos detection

Thanks Ryan Qian.

Closes: https://bugs.gentoo.org/920160
Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain-funcs.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 1c7a34bd82..166ea71e7e 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -689,6 +689,7 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
case ${host} in
powerpc-apple-darwin*)echo ppc-macos;;
x86_64-apple-darwin*) echo x64-macos;;
+   arm64-apple-darwin*)  echo arm64-macos;;
sparc-sun-solaris*)   echo sparc-solaris;;
sparcv9-sun-solaris*) echo sparc64-solaris;;
i?86-pc-solaris*) echo x86-solaris;;



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2023-09-11 Thread Sam James
commit: 71b917e9f7a969a319d49ae34be09550f2530139
Author: Alexey Sokolov  asokolov  org>
AuthorDate: Mon Sep 11 22:56:18 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 11 23:33:12 2023 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=71b917e9

eclass/toolchain-funcs.eclass: add missing functions

Copied straight from ::gentoo's version of this file

Bug: https://bugs.gentoo.org/758167
Signed-off-by: Alexey Sokolov  asokolov.org>
Closes: https://github.com/gentoo/prefix/pull/32
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain-funcs.eclass | 64 +++
 1 file changed, 64 insertions(+)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index b86a9682b1..1c7a34bd82 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1186,4 +1186,68 @@ gen_usr_ldscript() {
done
 }
 
+# @FUNCTION: tc-get-cxx-stdlib
+# @DESCRIPTION:
+# Attempt to identify the C++ standard library used by the compiler.
+# If the library is identified, the function returns 0 and prints one
+# of the following:
+#
+# - ``libc++`` for ``sys-libs/libcxx``
+# - ``libstdc++`` for ``sys-devel/gcc``'s libstdc++
+#
+# If the library is not recognized, the function returns 1.
+tc-get-cxx-stdlib() {
+   local code='#include 
+
+#if defined(_LIBCPP_VERSION)
+   HAVE_LIBCXX
+#elif defined(__GLIBCXX__)
+   HAVE_LIBSTDCPP
+#endif
+'
+   local res=$(
+   $(tc-getCXX) ${CPPFLAGS} ${CXXFLAGS} -x c++ -E -P - \
+   <<<"${code}" 2>/dev/null
+   )
+
+   case ${res} in
+   *HAVE_LIBCXX*)
+   echo libc++;;
+   *HAVE_LIBSTDCPP*)
+   echo libstdc++;;
+   *)
+   return 1;;
+   esac
+
+   return 0
+}
+
+# @FUNCTION: tc-get-c-rtlib
+# @DESCRIPTION:
+# Attempt to identify the runtime used by the C/C++ compiler.
+# If the runtime is identifed, the function returns 0 and prints one
+# of the following:
+#
+# - ``compiler-rt`` for ``sys-libs/compiler-rt``
+# - ``libgcc`` for ``sys-devel/gcc``'s libgcc
+#
+# If the runtime is not recognized, the function returns 1.
+tc-get-c-rtlib() {
+   local res=$(
+   $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} \
+   -print-libgcc-file-name 2>/dev/null
+   )
+
+   case ${res} in
+   *libclang_rt*)
+   echo compiler-rt;;
+   *libgcc*)
+   echo libgcc;;
+   *)
+   return 1;;
+   esac
+
+   return 0
+}
+
 fi



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2023-09-04 Thread Fabian Groffen
commit: 19458d996a18e60b9d80d0a8ff94ed49d870e0be
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Sep  4 06:36:16 2023 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Sep  4 06:36:16 2023 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=19458d99

toolchain.eclass: fix merge error

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index ce62b7b81d..4d1d4f0030 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -990,6 +990,7 @@ toolchain_src_configure() {
nvptx*)
# "LTO is not supported for this target"
confgcc+=( --disable-lto )
+   ;;
# Prefix targets
*-apple-darwin*)
confgcc+=( 
--with-sysroot="${EPREFIX}${PREFIX}/${CTARGET}" )



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2023-09-03 Thread Fabian Groffen
commit: cbcf8a9a914d88f8c61f27e1343776159a97d218
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Sep  3 19:39:28 2023 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Sep  3 19:39:28 2023 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=cbcf8a9a

toolchain.eclass: sync from gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 1075 ++-
 1 file changed, 410 insertions(+), 665 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 642bf54a89..ce62b7b81d 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: toolchain.eclass
@@ -6,14 +6,17 @@
 # Toolchain Ninjas 
 # @SUPPORTED_EAPIS: 7 8
 # @BLURB: Common code for sys-devel/gcc ebuilds
+# @DESCRIPTION:
+# Common code for sys-devel/gcc ebuilds (and occasionally GCC forks, like
+# GNAT for Ada). If not building GCC itself, please use toolchain-funcs.eclass
+# instead.
 
 case ${EAPI} in
-   7) inherit eutils ;;
-   8) ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ ! ${_TOOLCHAIN_ECLASS} ]]; then
+if [[ -z ${_TOOLCHAIN_ECLASS} ]]; then
 _TOOLCHAIN_ECLASS=1
 
 DESCRIPTION="The GNU Compiler Collection"
@@ -49,9 +52,9 @@ if [[ ${CTARGET} = ${CHOST} ]] ; then
export CTARGET=${CATEGORY#cross-}
fi
 fi
-: ${TARGET_ABI:=${ABI}}
-: ${TARGET_MULTILIB_ABIS:=${MULTILIB_ABIS}}
-: ${TARGET_DEFAULT_ABI:=${DEFAULT_ABI}}
+: "${TARGET_ABI:=${ABI}}"
+: "${TARGET_MULTILIB_ABIS:=${MULTILIB_ABIS}}"
+: "${TARGET_DEFAULT_ABI:=${DEFAULT_ABI}}"
 
 is_crosscompile() {
[[ ${CHOST} != ${CTARGET} ]]
@@ -141,6 +144,32 @@ GCCMINOR=$(ver_cut 2 ${GCC_PV})
 # GCC micro version.
 GCCMICRO=$(ver_cut 3 ${GCC_PV})
 
+tc_use_major_version_only() {
+   local use_major_version_only=0
+
+   if ! tc_version_is_at_least 10 ; then
+   return 1
+   fi
+
+   if [[ ${GCCMAJOR} -eq 10 ]] && ver_test ${PV} -ge 10.4.1_p20220929 ; 
then
+   use_major_version_only=1
+   elif [[ ${GCCMAJOR} -eq 11 ]] && ver_test ${PV} -ge 11.3.1_p20220930 ; 
then
+   use_major_version_only=1
+   elif [[ ${GCCMAJOR} -eq 12 ]] && ver_test ${PV} -ge 12.2.1_p20221001 ; 
then
+   use_major_version_only=1
+   elif [[ ${GCCMAJOR} -eq 13 ]] && ver_test ${PV} -ge 13.0.0_pre20221002 
; then
+   use_major_version_only=1
+   elif [[ ${GCCMAJOR} -gt 13 ]] ; then
+   use_major_version_only=1
+   fi
+
+   if [[ ${use_major_version_only} -eq 1 ]] ; then
+   return 0
+   fi
+
+   return 1
+}
+
 # @ECLASS_VARIABLE: GCC_CONFIG_VER
 # @INTERNAL
 # @DESCRIPTION:
@@ -148,7 +177,11 @@ GCCMICRO=$(ver_cut 3 ${GCC_PV})
 # of binary and gcc-config names not directly tied to upstream
 # versioning. In practice it's hard to untangle from gcc/BASE-VER
 # (GCC_RELEASE_VER) value.
-GCC_CONFIG_VER=${GCC_RELEASE_VER}
+if tc_use_major_version_only ; then
+   GCC_CONFIG_VER=${GCCMAJOR}
+else
+   GCC_CONFIG_VER=${GCC_RELEASE_VER}
+fi
 
 # Pre-release support. Versioning schema:
 # 1.0.0_pre: live ebuild
@@ -168,7 +201,7 @@ fi
 # Require minimum gcc version to simplify assumptions.
 # Normally we would require gcc-6+ (based on sys-devel/gcc)
 # but we still have sys-devel/gcc-apple-4.2.1_p5666.
-tc_version_is_at_least 4.2.1 || die "${ECLASS}: ${GCC_RELEASE_VER} is too old."
+tc_version_is_at_least 8 || die "${ECLASS}: ${GCC_RELEASE_VER} is too old."
 
 PREFIX=${TOOLCHAIN_PREFIX:-${EPREFIX}/usr}
 
@@ -204,49 +237,46 @@ tc_has_feature() {
 if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ||
[[ ${PN} == "gcc-apple" && $(tc_version_is_at_least 12.1) == 0 ]] ; then
IUSE+=" debug +cxx +nptl" TC_FEATURES+=( nptl )
-   [[ -n ${PIE_VER} ]] && IUSE+=" nopie"
-   [[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
IUSE+=" +fortran" TC_FEATURES+=( fortran )
IUSE+=" doc hardened multilib objc"
-   tc_version_is_between 3 7 && IUSE+=" awt gcj" TC_FEATURES+=( gcj )
IUSE+=" pgo"
IUSE+=" objc-gc" TC_FEATURES+=( objc-gc )
IUSE+=" libssp objc++"
-   IUSE+=" +openmp"
-
-   tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
-   tc_version_is_at_least 4.7 && IUSE+=" go"
-
-   # sanitizer support appeared in gcc-4.8, but https://gcc.gnu.org/pipermail/gcc-patches/2023-April/615944.html
+   # and 
https://rust-gcc.github.io/2023/04/24/gccrs-and-gcc13-release.html for why
+   # it was disabled in 13.
+   tc_version_is_at_least 14.0.0_pre20230423 ${PV} && IUSE+=" rust"
 fi
 
 if tc_version_is_at_least 10; then
@@ -259,24 +289,18 @@ fi
 
 #>> DEPEND <<
 
-RDEPEND="sys-libs/zlib
+RDEPEND="
+   sys-libs/zlib
virtual/libiconv
nls? ( 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2023-05-24 Thread Fabian Groffen
commit: b80146770eaafa7e45d8aa8a6d92977e41dbf5a1
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed May 24 07:55:36 2023 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed May 24 07:55:36 2023 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=b8014677

eclass/python-utils-r1: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 0552c03d16..e565a8f752 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -40,7 +40,7 @@ inherit multiprocessing toolchain-funcs
 # All supported Python implementations, most preferred last.
 _PYTHON_ALL_IMPLS=(
pypy3
-   python3_{10..11}
+   python3_{10..12}
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -80,7 +80,7 @@ _python_verify_patterns() {
local impl pattern
for pattern; do
case ${pattern} in
-   -[23]|3.[89]|3.1[01])
+   -[23]|3.[89]|3.1[012])
continue
;;
esac
@@ -129,7 +129,7 @@ _python_set_impls() {
# please keep them in sync with _PYTHON_ALL_IMPLS
# and _PYTHON_HISTORICAL_IMPLS
case ${i} in
-   pypy3|python3_9|python3_1[01])
+   pypy3|python3_9|python3_1[0-2])
;;

jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-7]|python3_[1-9])
obsolete+=( "${i}" )
@@ -236,7 +236,7 @@ _python_impl_matches() {
[[ ${impl} == python${pattern/./_} || ${impl} 
== pypy3 ]] &&
return 0
;;
-   3.8|3.1[01])
+   3.8|3.1[0-2])
[[ ${impl} == python${pattern/./_} ]] && return 0
;;
*)
@@ -452,6 +452,8 @@ _python_export() {

PYTHON_PKG_DEP=">=dev-lang/python-3.10.9-r1:3.10";;
python3.11)

PYTHON_PKG_DEP=">=dev-lang/python-3.11.1-r1:3.11";;
+   python3.12)
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.12.0_beta1:3.12";;
pypy3)

PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.11-r1:0=';;
*)
@@ -1358,7 +1360,12 @@ eunittest() {
 
_python_check_EPYTHON
 
-   set -- "${EPYTHON}" -m unittest_or_fail discover -v "${@}"
+   # unittest fails with "no tests" correctly since Python 3.12
+   local runner=unittest
+   if _python_impl_matches "${EPYTHON}" 3.{9..11}; then
+   runner=unittest_or_fail
+   fi
+   set -- "${EPYTHON}" -m "${runner}" discover -v "${@}"
 
echo "${@}" >&2
"${@}" || die -n "Tests failed with ${EPYTHON}"



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2023-05-24 Thread Fabian Groffen
commit: cc062a4c49d29c866fc83665bbafaadbb4e332a8
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed May 24 06:18:44 2023 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed May 24 06:18:44 2023 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=cc062a4c

eclass/python-utils-r1: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 140 +++---
 1 file changed, 51 insertions(+), 89 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index c50da71ac8..0552c03d16 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: python-utils-r1.eclass
@@ -7,7 +7,7 @@
 # @AUTHOR:
 # Author: Michał Górny 
 # Based on work of: Krzysztof Pawlik 
-# @SUPPORTED_EAPIS: 6 7 8
+# @SUPPORTED_EAPIS: 7 8
 # @BLURB: Utility functions for packages with Python parts.
 # @DESCRIPTION:
 # A utility eclass providing functions to query Python implementations,
@@ -22,19 +22,16 @@
 # NOTE: When dropping support for EAPIs here, we need to update
 # metadata/install-qa-check.d/60python-pyc
 # See bug #704286, bug #781878
-case "${EAPI:-0}" in
-   [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
-   [6-8]) ;;
-   *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
-esac
 
-if [[ ${_PYTHON_ECLASS_INHERITED} ]]; then
-   die 'python-r1 suite eclasses can not be used with python.eclass.'
-fi
+case ${EAPI} in
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
 
-if [[ ! ${_PYTHON_UTILS_R1} ]]; then
+if [[ ! ${_PYTHON_UTILS_R1_ECLASS} ]]; then
+_PYTHON_UTILS_R1_ECLASS=1
 
-[[ ${EAPI} == [67] ]] && inherit eapi8-dosym
+[[ ${EAPI} == 7 ]] && inherit eapi8-dosym
 inherit multiprocessing toolchain-funcs
 
 # @ECLASS_VARIABLE: _PYTHON_ALL_IMPLS
@@ -43,7 +40,7 @@ inherit multiprocessing toolchain-funcs
 # All supported Python implementations, most preferred last.
 _PYTHON_ALL_IMPLS=(
pypy3
-   python3_{8..11}
+   python3_{10..11}
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -55,7 +52,7 @@ _PYTHON_HISTORICAL_IMPLS=(
jython2_7
pypy pypy1_{8,9} pypy2_0
python2_{5..7}
-   python3_{1..7}
+   python3_{1..9}
 )
 readonly _PYTHON_HISTORICAL_IMPLS
 
@@ -132,9 +129,9 @@ _python_set_impls() {
# please keep them in sync with _PYTHON_ALL_IMPLS
# and _PYTHON_HISTORICAL_IMPLS
case ${i} in
-   pypy3|python2_7|python3_[89]|python3_1[01])
+   pypy3|python3_9|python3_1[01])
;;
-   
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-6]|python3_[1-7])
+   
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-7]|python3_[1-9])
obsolete+=( "${i}" )
;;
*)
@@ -171,13 +168,7 @@ _python_set_impls() {
done
 
if [[ ! ${supp[@]} ]]; then
-   # special-case python2_7 for python-any-r1
-   if [[ ${_PYTHON_ALLOW_PY27} ]] && has python2_7 
"${PYTHON_COMPAT[@]}"
-   then
-   supp+=( python2_7 )
-   else
-   die "No supported implementation in PYTHON_COMPAT."
-   fi
+   die "No supported implementation in PYTHON_COMPAT."
fi
 
if [[ ${_PYTHON_SUPPORTED_IMPLS[@]} ]]; then
@@ -223,7 +214,7 @@ _python_impl_matches() {
for pattern; do
case ${pattern} in
-2|python2*|pypy)
-   if [[ ${EAPI} != [67] ]]; then
+   if [[ ${EAPI} != 7 ]]; then
eerror
eerror "Python 2 is no longer supported 
in Gentoo, please remove Python 2"
eerror "${FUNCNAME[1]} calls."
@@ -232,7 +223,7 @@ _python_impl_matches() {
;;
-3)
# NB: "python3*" is fine, as "not pypy3"
-   if [[ ${EAPI} != [67] ]]; then
+   if [[ ${EAPI} != 7 ]]; then
eerror
eerror "Python 2 is no longer supported 
in Gentoo, please remove Python 2"
eerror "${FUNCNAME[1]} calls."
@@ -419,10 +410,6 @@ _python_export() {
local val
 
case "${impl}" in
-   

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-06-29 Thread Sam James
commit: 831487b972c24579bc03852cef314822c08b
Author: Sam James  gentoo  org>
AuthorDate: Wed Jun 29 14:37:27 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jun 29 14:37:27 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=831487b9

autotools.eclass: drop, now in ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/autotools.eclass | 694 
 1 file changed, 694 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
deleted file mode 100644
index fbe7d837f0..00
--- a/eclass/autotools.eclass
+++ /dev/null
@@ -1,694 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @ECLASS: autotools.eclass
-# @MAINTAINER:
-# base-sys...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7 8
-# @BLURB: Regenerates auto* build scripts
-# @DESCRIPTION:
-# This eclass is for safely handling autotooled software packages that need to
-# regenerate their build scripts.  All functions will abort in case of errors.
-
-# Note: We require GNU m4, as does autoconf.  So feel free to use any features
-# from the GNU version of m4 without worrying about other variants (i.e. BSD).
-
-if [[ ${_AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then
-   # See if we were included already, but someone changed the value
-   # of AUTOTOOLS_AUTO_DEPEND on us.  We could reload the entire
-   # eclass at that point, but that adds overhead, and it's trivial
-   # to re-order inherit in eclasses/ebuilds instead.  #409611
-   if [[ ${_AUTOTOOLS_AUTO_DEPEND} != ${AUTOTOOLS_AUTO_DEPEND} ]] ; then
-   die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; 
please inherit ${ECLASS} first! ${_AUTOTOOLS_AUTO_DEPEND} -> 
${AUTOTOOLS_AUTO_DEPEND}"
-   fi
-fi
-
-if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then
-_AUTOTOOLS_ECLASS=1
-
-case ${EAPI} in
-   5|6)
-   # Needed for eqawarn
-   inherit eutils
-   ;;
-   7|8) ;;
-   *) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
-esac
-
-inherit gnuconfig libtool
-
-# @ECLASS_VARIABLE: WANT_AUTOCONF
-# @PRE_INHERIT
-# @DESCRIPTION:
-# The major version of autoconf your package needs
-: ${WANT_AUTOCONF:=latest}
-
-# @ECLASS_VARIABLE: WANT_AUTOMAKE
-# @PRE_INHERIT
-# @DESCRIPTION:
-# The major version of automake your package needs
-: ${WANT_AUTOMAKE:=latest}
-
-# @ECLASS_VARIABLE: WANT_LIBTOOL
-# @PRE_INHERIT
-# @DESCRIPTION:
-# Do you want libtool?  Valid values here are "latest" and "none".
-: ${WANT_LIBTOOL:=latest}
-
-# @ECLASS_VARIABLE: _LATEST_AUTOMAKE
-# @INTERNAL
-# @DESCRIPTION:
-# CONSTANT!
-# The latest major unstable and stable version/slot of automake available
-# on each arch.
-# Only add unstable version if it is in a different slot than latest stable
-# version.
-# 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 bug #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:  :
-_LATEST_AUTOMAKE=( 1.16.5:1.16 )
-
-_automake_atom="sys-devel/automake"
-_autoconf_atom="sys-devel/autoconf"
-if [[ -n ${WANT_AUTOMAKE} ]] ; then
-   case ${WANT_AUTOMAKE} in
-   # Even if the package doesn't use automake, we still need to 
depend
-   # on it because we run aclocal to process m4 macros.  This 
matches
-   # the autoreconf tool, so this requirement is correct, bug 
#401605.
-   none) ;;
-   latest) _automake_atom="|| ( `printf 
'>=sys-devel/automake-%s:%s ' ${_LATEST_AUTOMAKE[@]/:/ }` )" ;;
-   *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*";;
-   esac
-   export WANT_AUTOMAKE
-fi
-
-if [[ -n ${WANT_AUTOCONF} ]] ; then
-   case ${WANT_AUTOCONF} in
-   none)   _autoconf_atom="" ;; # some packages don't require 
autoconf at all
-   2.1)_autoconf_atom="~sys-devel/autoconf-2.13" ;;
-   # if you change the "latest" version here, change also 
autotools_env_setup
-   latest|2.5) _autoconf_atom=">=sys-devel/autoconf-2.71" ;;
-   *)  die "Invalid WANT_AUTOCONF value 
'${WANT_AUTOCONF}'" ;;
-   esac
-   export WANT_AUTOCONF
-fi
-
-_libtool_atom=">=sys-devel/libtool-2.4"
-if [[ -n ${WANT_LIBTOOL} ]] ; then
-   case ${WANT_LIBTOOL} in
-   none)   _libtool_atom="" ;;
-   latest) ;;
-   *)  die "Invalid WANT_LIBTOOL value '${WANT_LIBTOOL}'" ;;
-   esac
-   export WANT_LIBTOOL
-fi
-
-# @ECLASS_VARIABLE: 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-06-29 Thread Sam James
commit: 34090224b36ba20ec53ba5a1086380130e83bf33
Author: Sam James  gentoo  org>
AuthorDate: Wed Jun 29 14:05:41 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jun 29 14:05:53 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=34090224

autotools.eclass: sync with ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/autotools.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index ecfa3c2cf9..fbe7d837f0 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -527,7 +527,7 @@ autotools_env_setup() {
hv_args="-b"
;;
esac
-   ROOT=/ has_version ${hv_args} 
"=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
+   has_version ${hv_args} "=sys-devel/automake-${pv}*" && 
export WANT_AUTOMAKE="${pv}" && break
done
[[ ${WANT_AUTOMAKE} == "latest" ]] && \
die "Cannot find the latest automake! Tried 
${_LATEST_AUTOMAKE[*]}"



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-06-07 Thread Fabian Groffen
commit: a7c1d9d5107cce52c19f638df5454ece9cbbcfa7
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Jun  7 17:00:40 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Jun  7 17:00:40 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=a7c1d9d5

python-utils-r1.eclass: sync from latest gx86, unbreak python pkgs

Bug: https://bugs.gentoo.org/850406
Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 55 ++-
 1 file changed, 44 insertions(+), 11 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index b9102cd320..c50da71ac8 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -712,6 +712,9 @@ python_scriptinto() {
 python_doexe() {
debug-print-function ${FUNCNAME} "${@}"
 
+   [[ ${EBUILD_PHASE} != install ]] &&
+   die "${FUNCNAME} can only be used in src_install"
+
local f
for f; do
python_newexe "${f}" "${f##*/}"
@@ -730,6 +733,8 @@ python_doexe() {
 python_newexe() {
debug-print-function ${FUNCNAME} "${@}"
 
+   [[ ${EBUILD_PHASE} != install ]] &&
+   die "${FUNCNAME} can only be used in src_install"
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is 
null).'
[[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME}  "
 
@@ -778,6 +783,9 @@ python_newexe() {
 python_doscript() {
debug-print-function ${FUNCNAME} "${@}"
 
+   [[ ${EBUILD_PHASE} != install ]] &&
+   die "${FUNCNAME} can only be used in src_install"
+
local _PYTHON_REWRITE_SHEBANG=1
python_doexe "${@}"
 }
@@ -802,6 +810,9 @@ python_doscript() {
 python_newscript() {
debug-print-function ${FUNCNAME} "${@}"
 
+   [[ ${EBUILD_PHASE} != install ]] &&
+   die "${FUNCNAME} can only be used in src_install"
+
local _PYTHON_REWRITE_SHEBANG=1
python_newexe "${@}"
 }
@@ -821,10 +832,10 @@ python_newscript() {
 # site-packages directory.
 #
 # In the relative case, the exact path is determined directly
-# by each python_doscript/python_newscript function. Therefore,
-# python_moduleinto can be safely called before establishing the Python
-# interpreter and/or a single call can be used to set the path correctly
-# for multiple implementations, as can be seen in the following example.
+# by each python_domodule invocation. Therefore, python_moduleinto
+# can be safely called before establishing the Python interpreter and/or
+# a single call can be used to set the path correctly for multiple
+# implementations, as can be seen in the following example.
 #
 # Example:
 # @CODE
@@ -848,6 +859,10 @@ python_moduleinto() {
 # and packages (directories). All listed files will be installed
 # for all enabled implementations, and compiled afterwards.
 #
+# The files are installed into ${D} when run in src_install() phase.
+# Otherwise, they are installed into ${BUILD_DIR}/install location
+# that is suitable for picking up by distutils-r1 in PEP517 mode.
+#
 # Example:
 # @CODE
 # src_install() {
@@ -870,13 +885,24 @@ python_domodule() {
d=${sitedir#${EPREFIX}}/${_PYTHON_MODULEROOT//.//}
fi
 
-   (
-   insopts -m 0644
-   insinto "${d}"
-   doins -r "${@}" || return ${?}
-   )
-
-   python_optimize "${ED%/}/${d}"
+   if [[ ${EBUILD_PHASE} == install ]]; then
+   (
+   insopts -m 0644
+   insinto "${d}"
+   doins -r "${@}" || return ${?}
+   )
+   python_optimize "${ED%/}/${d}"
+   elif [[ -n ${BUILD_DIR} ]]; then
+   local dest=${BUILD_DIR}/install${EPREFIX}/${d}
+   mkdir -p "${dest}" || die
+   cp -pR "${@}" "${dest}/" || die
+   (
+   cd "${dest}" &&
+   chmod -R a+rX "${@##*/}"
+   ) || die
+   else
+   die "${FUNCNAME} can only be used in src_install or with 
BUILD_DIR set"
+   fi
 }
 
 # @FUNCTION: python_doheader
@@ -895,6 +921,8 @@ python_domodule() {
 python_doheader() {
debug-print-function ${FUNCNAME} "${@}"
 
+   [[ ${EBUILD_PHASE} != install ]] &&
+   die "${FUNCNAME} can only be used in src_install"
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is 
null).'
 
local includedir=$(python_get_includedir)
@@ -1334,6 +1362,11 @@ epytest() {
 
# remove common temporary directories left over by pytest plugins
rm -rf .hypothesis .pytest_cache || die
+   # pytest plugins create additional .pyc files while testing
+   # see e.g. https://bugs.gentoo.org/847235
+   if [[ -n ${BUILD_DIR} && -d ${BUILD_DIR} ]]; then
+   find "${BUILD_DIR}" -name '*-pytest-*.pyc' -delete || die
+   fi
 
return ${ret}
 }



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-06-07 Thread Fabian Groffen
commit: 172f0fbbf621687622ffa0f67a55817470779495
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Jun  7 12:34:59 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Jun  7 12:34:59 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=172f0fbb

eclass: sync with gx86

Closes: https://bugs.gentoo.org/850406
Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/autotools.eclass   |  42 ++---
 eclass/java-utils-2.eclass| 139 +-
 eclass/python-utils-r1.eclass |  15 +
 eclass/toolchain-funcs.eclass |  34 +--
 eclass/toolchain.eclass   | 112 +-
 5 files changed, 195 insertions(+), 147 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index cf1c3461f9..ecfa3c2cf9 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -13,13 +13,13 @@
 # Note: We require GNU m4, as does autoconf.  So feel free to use any features
 # from the GNU version of m4 without worrying about other variants (i.e. BSD).
 
-if [[ ${__AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then
+if [[ ${_AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then
# See if we were included already, but someone changed the value
# of AUTOTOOLS_AUTO_DEPEND on us.  We could reload the entire
# eclass at that point, but that adds overhead, and it's trivial
# to re-order inherit in eclasses/ebuilds instead.  #409611
-   if [[ ${__AUTOTOOLS_AUTO_DEPEND} != ${AUTOTOOLS_AUTO_DEPEND} ]] ; then
-   die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; 
please inherit ${ECLASS} first! ${__AUTOTOOLS_AUTO_DEPEND} -> 
${AUTOTOOLS_AUTO_DEPEND}"
+   if [[ ${_AUTOTOOLS_AUTO_DEPEND} != ${AUTOTOOLS_AUTO_DEPEND} ]] ; then
+   die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; 
please inherit ${ECLASS} first! ${_AUTOTOOLS_AUTO_DEPEND} -> 
${AUTOTOOLS_AUTO_DEPEND}"
fi
 fi
 
@@ -37,25 +37,25 @@ esac
 
 inherit gnuconfig libtool
 
-# @ECLASS-VARIABLE: WANT_AUTOCONF
+# @ECLASS_VARIABLE: WANT_AUTOCONF
 # @PRE_INHERIT
 # @DESCRIPTION:
 # The major version of autoconf your package needs
 : ${WANT_AUTOCONF:=latest}
 
-# @ECLASS-VARIABLE: WANT_AUTOMAKE
+# @ECLASS_VARIABLE: WANT_AUTOMAKE
 # @PRE_INHERIT
 # @DESCRIPTION:
 # The major version of automake your package needs
 : ${WANT_AUTOMAKE:=latest}
 
-# @ECLASS-VARIABLE: WANT_LIBTOOL
+# @ECLASS_VARIABLE: WANT_LIBTOOL
 # @PRE_INHERIT
 # @DESCRIPTION:
 # Do you want libtool?  Valid values here are "latest" and "none".
 : ${WANT_LIBTOOL:=latest}
 
-# @ECLASS-VARIABLE: _LATEST_AUTOMAKE
+# @ECLASS_VARIABLE: _LATEST_AUTOMAKE
 # @INTERNAL
 # @DESCRIPTION:
 # CONSTANT!
@@ -74,7 +74,7 @@ inherit gnuconfig libtool
 # 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:  :
-_LATEST_AUTOMAKE=( 1.16.4:1.16 )
+_LATEST_AUTOMAKE=( 1.16.5:1.16 )
 
 _automake_atom="sys-devel/automake"
 _autoconf_atom="sys-devel/autoconf"
@@ -111,7 +111,7 @@ if [[ -n ${WANT_LIBTOOL} ]] ; then
export WANT_LIBTOOL
 fi
 
-# @ECLASS-VARIABLE: AUTOTOOLS_DEPEND
+# @ECLASS_VARIABLE: AUTOTOOLS_DEPEND
 # @OUTPUT_VARIABLE
 # @DESCRIPTION:
 # Contains the combination of requested automake/autoconf/libtool
@@ -121,7 +121,7 @@ AUTOTOOLS_DEPEND="${_automake_atom}
${_libtool_atom}"
 RDEPEND=""
 
-# @ECLASS-VARIABLE: AUTOTOOLS_AUTO_DEPEND
+# @ECLASS_VARIABLE: AUTOTOOLS_AUTO_DEPEND
 # @PRE_INHERIT
 # @DESCRIPTION:
 # Set to 'no' to disable automatically adding to DEPEND.  This lets
@@ -134,25 +134,25 @@ if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then
*) BDEPEND=${AUTOTOOLS_DEPEND} ;;
esac
 fi
-__AUTOTOOLS_AUTO_DEPEND=${AUTOTOOLS_AUTO_DEPEND} # See top of eclass
+_AUTOTOOLS_AUTO_DEPEND=${AUTOTOOLS_AUTO_DEPEND} # See top of eclass
 
 unset _automake_atom _autoconf_atom
 
-# @ECLASS-VARIABLE: AM_OPTS
+# @ECLASS_VARIABLE: AM_OPTS
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Additional options to pass to automake during
 # eautoreconf call.
 : ${AM_OPTS:=}
 
-# @ECLASS-VARIABLE: AT_NOEAUTOHEADER
+# @ECLASS_VARIABLE: AT_NOEAUTOHEADER
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Don't run eautoheader command if set to 'yes'; only used to work around
 # packages that don't want their headers being modified.
 : ${AT_NOEAUTOHEADER:=}
 
-# @ECLASS-VARIABLE: AT_NOEAUTOMAKE
+# @ECLASS_VARIABLE: AT_NOEAUTOMAKE
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Don't run eautomake command if set to 'yes'; only used to workaround
@@ -160,7 +160,7 @@ unset _automake_atom _autoconf_atom
 # not call AM_INIT_AUTOMAKE if it doesn't actually use automake.
 : ${AT_NOEAUTOMAKE:=}
 
-# @ECLASS-VARIABLE: AT_NOELIBTOOLIZE
+# @ECLASS_VARIABLE: AT_NOELIBTOOLIZE
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Don't run elibtoolize command if set to 'yes',
@@ -168,13 +168,13 @@ unset _automake_atom _autoconf_atom
 # particular options
 : 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-06-06 Thread Fabian Groffen
commit: 1b3e9f1dc1e6fcce61f1ed7e26b93d69c927177a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Jun  6 16:49:49 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Jun  6 16:49:49 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=1b3e9f1d

toolchain.eclass: update Darwin hacks for GCC-12

GCC-12 is completely C++, so patch the appropriate file(s) instead.

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 782cbeebf2..afd81cfc08 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -615,13 +615,17 @@ toolchain_src_prepare() {
make_gcc_hard
fi
 
-   # we use our libtool on Darwin
+   # we use our libtool on Darwin (no longer applies since 12)
sed -i -e "s:/usr/bin/libtool:${EPREFIX}/usr/bin/${CTARGET}-libtool:" \
"${S}"/gcc/config/darwin.h || die "sed gcc/config/darwin.h 
failed"
# add prefixed Frameworks to default search paths (may want to
# change this in a cross-compile)
+   local darwindriver
+   tc_version_is_at_least 12 \
+   && darwindriver=darwin-c.cc \
+   || darwindriver=darwin-c.c
sed -i -e "/\"\/System\/Library\/Frameworks\"\,/i\ \   
\"${EPREFIX}/MacOSX.sdk/System/Library/Frameworks\"\, 
\"${EPREFIX}/Frameworks\"\, " \
-   "${S}"/gcc/config/darwin-c.c || die "sed gcc/config/darwin-c.c 
failed"
+   "${S}"/gcc/config/${darwindriver} || die "sed 
gcc/config/${darwindriver} failed"
 
# Make sure the pkg-config files install into multilib dirs.
# Since we configure with just one --libdir, we can't use that



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-06-06 Thread Fabian Groffen
commit: ca5a684e6be8154d4c4b2b6a2adb0110bfcb5c58
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Jun  6 09:06:58 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Jun  6 09:06:58 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ca5a684e

toolchain.eclass: fix syntax

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index ed8c227c4a..782cbeebf2 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -202,7 +202,7 @@ tc_has_feature() {
 
 # Prefix: allow gcc-apple post 4.2.1
 if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ||
-   [[ ${PN} == "gcc-apple" && tc_version_is_at_least 12.1 ]] ; then
+   [[ ${PN} == "gcc-apple" && $(tc_version_is_at_least 12.1) == 0 ]] ; then
IUSE+=" debug +cxx +nptl" TC_FEATURES+=( nptl )
[[ -n ${PIE_VER} ]] && IUSE+=" nopie"
[[ -n ${SPECS_VER} ]] && IUSE+=" nossp"



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-06-06 Thread Fabian Groffen
commit: 5027081b510a47cbccec3cabd2dc6504b0484821
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Jun  6 08:41:37 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Jun  6 08:41:37 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5027081b

toolchain.eclass: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 1327 +++
 1 file changed, 751 insertions(+), 576 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a07f9b680e..ed8c227c4a 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,23 +1,33 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-# Maintainer: Toolchain Ninjas 
-# @SUPPORTED_EAPIS: 5 6 7
+# @ECLASS: toolchain.eclass
+# @MAINTAINER:
+# Toolchain Ninjas 
+# @SUPPORTED_EAPIS: 7 8
+# @BLURB: Common code for sys-devel/gcc ebuilds
+
+case ${EAPI} in
+   7) inherit eutils ;;
+   8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ ! ${_TOOLCHAIN_ECLASS} ]]; then
+_TOOLCHAIN_ECLASS=1
 
 DESCRIPTION="The GNU Compiler Collection"
 HOMEPAGE="https://gcc.gnu.org/;
 
-# TODO: Please audit this inherit list on future EAPI bumps and ideally
-# conditonalise them where possible.
-inherit eutils flag-o-matic gnuconfig libtool multilib pax-utils 
toolchain-funcs prefix
+inherit edo flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs 
prefix
 
 tc_is_live() {
[[ ${PV} == ** ]]
 }
 
 if tc_is_live ; then
-   EGIT_REPO_URI="https://gcc.gnu.org/git/gcc.git;
-   # naming style:
+   EGIT_REPO_URI="https://gcc.gnu.org/git/gcc.git 
https://github.com/gcc-mirror/gcc;
+   # Naming style:
# gcc-10.1.0_pre -> gcc-10-branch
#  Note that the micro version is required or lots of stuff will break.
#  To checkout master set gcc_LIVE_BRANCH="master" in the ebuild before
@@ -25,20 +35,12 @@ if tc_is_live ; then
EGIT_BRANCH="releases/${PN}-${PV%.?.?_pre}"
EGIT_BRANCH=${EGIT_BRANCH//./_}
inherit git-r3
+elif [[ -n ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+   inherit git-r3
 fi
 
 FEATURES=${FEATURES/multilib-strict/}
 
-case ${EAPI:-0} in
-   0|1|2|3|4*) die "Need to upgrade to at least EAPI=5" ;;
-   5*|6) inherit eapi7-ver ;;
-   7) ;;
-   *) die "I don't speak EAPI ${EAPI}." ;;
-esac
-
-EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure \
-   src_compile src_test src_install pkg_postinst pkg_postrm
-
 #>> globals <<
 
 export CTARGET=${CTARGET:-${CHOST}}
@@ -58,50 +60,116 @@ is_crosscompile() {
 # The target prefix defaults to the host prefix, except for cross compilers, 
which targets the empty prefix by default.
 : ${TPREFIX:=$(is_crosscompile || echo "${EPREFIX}")}
 
-# General purpose version check.  Without a second arg matches up to minor 
version (x.x.x)
+# @FUNCTION: tc_version_is_at_least
+# @USAGE: ver1 [ver2]
+# @DESCRIPTION:
+# General purpose version check. Without a second argument, matches
+# up to minor version (x.x.x).
 tc_version_is_at_least() {
ver_test "${2:-${GCC_RELEASE_VER}}" -ge "$1"
 }
 
-# General purpose version range check
+# @FUNCTION: tc_version_is_between
+# @USAGE: ver1 ver2
+# @DESCRIPTION:
+# General purpose version range check.
 # Note that it matches up to but NOT including the second version
 tc_version_is_between() {
tc_version_is_at_least "${1}" && ! tc_version_is_at_least "${2}"
 }
 
+# @ECLASS_VARIABLE: TOOLCHAIN_GCC_PV
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Used to override GCC version. Useful for e.g. live ebuilds or snapshots.
+# Defaults to ${PV}.
+
+# @ECLASS_VARIABLE: TOOLCHAIN_USE_GIT_PATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Used to force fetching patches from git. Useful for non-released versions
+# of GCC where we don't want to keep creating patchset tarballs for a new
+# release series (e.g. suppose 12.0 just got released, then adding snapshots
+# for 13.0, we don't want to create new patchsets for every single 13.0 
snapshot,
+# so just grab patches from git each time if this variable is set).
+
+# @ECLASS_VARIABLE: TOOLCHAIN_PATCH_DEV
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Indicate the developer who hosts the patchset for an ebuild.
+
+# @ECLASS_VARIABLE: GCC_PV
+# @INTERNAL
+# @DESCRIPTION:
+# Internal variable representing (spoofed) GCC version.
 GCC_PV=${TOOLCHAIN_GCC_PV:-${PV}}
+
+# @ECLASS_VARIABLE: GCC_PVR
+# @INTERNAL
+# @DESCRIPTION:
+# Full GCC version including revision.
 GCC_PVR=${GCC_PV}
 [[ ${PR} != "r0" ]] && GCC_PVR=${GCC_PVR}-${PR}
 
+# @ECLASS_VARIABLE: GCC_RELEASE_VER
+# @INTERNAL
+# @DESCRIPTION:
 # GCC_RELEASE_VER must always match 'gcc/BASE-VER' value.
 # It's an internal representation of gcc version used for:
 # - versioned paths on disk
 # - 'gcc -dumpversion' 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-05-10 Thread Fabian Groffen
commit: 65bd67b167c1f5445f433cb4d62fdf7931d3fb7a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May 10 06:22:06 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May 10 06:22:06 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=65bd67b1

python-utils-r1.eclass: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 211 ++
 1 file changed, 112 insertions(+), 99 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index a96fbc78a7..48b6ea484b 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -37,17 +37,17 @@ if [[ ! ${_PYTHON_UTILS_R1} ]]; then
 [[ ${EAPI} == [67] ]] && inherit eapi8-dosym
 inherit multiprocessing toolchain-funcs
 
-# @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
+# @ECLASS_VARIABLE: _PYTHON_ALL_IMPLS
 # @INTERNAL
 # @DESCRIPTION:
 # All supported Python implementations, most preferred last.
 _PYTHON_ALL_IMPLS=(
pypy3
-   python3_{8..10}
+   python3_{8..11}
 )
 readonly _PYTHON_ALL_IMPLS
 
-# @ECLASS-VARIABLE: _PYTHON_HISTORICAL_IMPLS
+# @ECLASS_VARIABLE: _PYTHON_HISTORICAL_IMPLS
 # @INTERNAL
 # @DESCRIPTION:
 # All historical Python implementations that are no longer supported.
@@ -59,7 +59,7 @@ _PYTHON_HISTORICAL_IMPLS=(
 )
 readonly _PYTHON_HISTORICAL_IMPLS
 
-# @ECLASS-VARIABLE: PYTHON_COMPAT_NO_STRICT
+# @ECLASS_VARIABLE: PYTHON_COMPAT_NO_STRICT
 # @INTERNAL
 # @DESCRIPTION:
 # Set to a non-empty value in order to make eclass tolerate (ignore)
@@ -83,7 +83,7 @@ _python_verify_patterns() {
local impl pattern
for pattern; do
case ${pattern} in
-   -[23]|3.[89]|3.10)
+   -[23]|3.[89]|3.1[01])
continue
;;
esac
@@ -132,7 +132,7 @@ _python_set_impls() {
# please keep them in sync with _PYTHON_ALL_IMPLS
# and _PYTHON_HISTORICAL_IMPLS
case ${i} in
-   pypy3|python2_7|python3_[89]|python3_10)
+   pypy3|python2_7|python3_[89]|python3_1[01])
;;

jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-6]|python3_[1-7])
obsolete+=( "${i}" )
@@ -240,12 +240,12 @@ _python_impl_matches() {
fi
return 0
;;
-   3.8)
-   # the only unmasked pypy3 version is pypy3.8 atm
+   3.9)
+   # the only unmasked pypy3 version is pypy3.9 atm
[[ ${impl} == python${pattern/./_} || ${impl} 
== pypy3 ]] &&
return 0
;;
-   3.9|3.10)
+   3.8|3.1[01])
[[ ${impl} == python${pattern/./_} ]] && return 0
;;
*)
@@ -258,7 +258,7 @@ _python_impl_matches() {
return 1
 }
 
-# @ECLASS-VARIABLE: PYTHON
+# @ECLASS_VARIABLE: PYTHON
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # The absolute path to the current Python interpreter.
@@ -277,7 +277,7 @@ _python_impl_matches() {
 # /usr/bin/python2.7
 # @CODE
 
-# @ECLASS-VARIABLE: EPYTHON
+# @ECLASS_VARIABLE: EPYTHON
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # The executable name of the current Python interpreter.
@@ -476,11 +476,13 @@ _python_export() {
python2.7)

PYTHON_PKG_DEP='>=dev-lang/python-2.7.5-r2:2.7';;
python3.8)
-   
PYTHON_PKG_DEP=">=dev-lang/python-3.8.8_p1-r1:3.8";;
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.8.12_p1-r1:3.8";;
python3.9)
-   
PYTHON_PKG_DEP=">=dev-lang/python-3.9.6_p1-r1:3.9";;
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.9.9-r1:3.9";;
python3.10)

PYTHON_PKG_DEP=">=dev-lang/python-3.10.0_p1-r1:3.10";;
+   python3.11)
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.11.0_beta1-r1:3.11";;
python*)

PYTHON_PKG_DEP="dev-lang/python:${impl#python}";;
pypy)
@@ -659,9 +661,7 @@ python_optimize() {
debug-print "${FUNCNAME}: using sys.path: 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-02-16 Thread Sam James
commit: fe5e2ea127bff7c96b417e9b87233f749870f272
Author: Sam James  gentoo  org>
AuthorDate: Thu Feb 17 00:11:05 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Feb 17 00:11:05 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=fe5e2ea1

python-utils-r1.eclass: fix sync with ::gentoo (adjust Python dependencies)

Our Python (base/actual non-revision versions) are older than ::gentoo,
but I've made the necessary dep adjustments / ebuild changes in them already,
so adjust to the latest versions in ::prefix which should be fine.

Reported-by: tgbugs
Signed-off-by: Sam James  gentoo.org>

 eclass/python-utils-r1.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 8c29a02090..a96fbc78a7 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -476,9 +476,9 @@ _python_export() {
python2.7)

PYTHON_PKG_DEP='>=dev-lang/python-2.7.5-r2:2.7';;
python3.8)
-   
PYTHON_PKG_DEP=">=dev-lang/python-3.8.12_p1-r1:3.8";;
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.8.8_p1-r1:3.8";;
python3.9)
-   
PYTHON_PKG_DEP=">=dev-lang/python-3.9.9-r1:3.9";;
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.9.6_p1-r1:3.9";;
python3.10)

PYTHON_PKG_DEP=">=dev-lang/python-3.10.0_p1-r1:3.10";;
python*)



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-02-10 Thread Fabian Groffen
commit: 7497d1d744af477e3c34862ad9e2c068d66c379d
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Feb 10 08:54:04 2022 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Feb 10 08:54:04 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7497d1d7

eclass/python-utils-r1: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 224 --
 1 file changed, 126 insertions(+), 98 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 53a305f40e..8c29a02090 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -82,7 +82,11 @@ _python_verify_patterns() {
 
local impl pattern
for pattern; do
-   [[ ${pattern} == -[23] ]] && continue
+   case ${pattern} in
+   -[23]|3.[89]|3.10)
+   continue
+   ;;
+   esac
 
for impl in "${_PYTHON_ALL_IMPLS[@]}" 
"${_PYTHON_HISTORICAL_IMPLS[@]}"
do
@@ -119,6 +123,8 @@ _python_set_impls() {
if [[ $(declare -p PYTHON_COMPAT) != "declare -a"* ]]; then
die 'PYTHON_COMPAT must be an array.'
fi
+
+   local obsolete=()
if [[ ! ${PYTHON_COMPAT_NO_STRICT} ]]; then
for i in "${PYTHON_COMPAT[@]}"; do
# check for incorrect implementations
@@ -126,7 +132,10 @@ _python_set_impls() {
# please keep them in sync with _PYTHON_ALL_IMPLS
# and _PYTHON_HISTORICAL_IMPLS
case ${i} in
-   
jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9]|python3_10)
+   pypy3|python2_7|python3_[89]|python3_10)
+   ;;
+   
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-6]|python3_[1-7])
+   obsolete+=( "${i}" )
;;
*)
if has "${i}" "${_PYTHON_ALL_IMPLS[@]}" 
\
@@ -140,6 +149,17 @@ _python_set_impls() {
done
fi
 
+   if [[ -n ${obsolete[@]} && ${EBUILD_PHASE} == setup ]]; then
+   # complain if people don't clean up old impls while touching
+   # the ebuilds recently.  use the copyright year to infer last
+   # modification
+   # NB: this check doesn't have to work reliably
+   if [[ $(head -n 1 "${EBUILD}" 2>/dev/null) == *2022* ]]; then
+   eqawarn "Please clean PYTHON_COMPAT of obsolete 
implementations:"
+   eqawarn "  ${obsolete[*]}"
+   fi
+   fi
+
local supp=() unsupp=()
 
for i in "${_PYTHON_ALL_IMPLS[@]}"; do
@@ -190,12 +210,14 @@ _python_set_impls() {
 # Matches if no patterns are provided.
 #
 #  can be in PYTHON_COMPAT or EPYTHON form. The patterns
-# are fnmatch-style.
+# can either be fnmatch-style or stdlib versions, e.g. "3.8", "3.9".
+# In the latter case, pypy3 will match if there is at least one pypy3
+# version matching the stdlib version.
 _python_impl_matches() {
[[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter"
[[ ${#} -eq 1 ]] && return 0
 
-   local impl=${1} pattern
+   local impl=${1/./_} pattern
shift
 
for pattern; do
@@ -218,9 +240,17 @@ _python_impl_matches() {
fi
return 0
;;
+   3.8)
+   # the only unmasked pypy3 version is pypy3.8 atm
+   [[ ${impl} == python${pattern/./_} || ${impl} 
== pypy3 ]] &&
+   return 0
+   ;;
+   3.9|3.10)
+   [[ ${impl} == python${pattern/./_} ]] && return 0
+   ;;
*)
# unify value style to allow lax matching
-   [[ ${impl/./_} == ${pattern/./_} ]] && return 0
+   [[ ${impl} == ${pattern/./_} ]] && return 0
;;
esac
done
@@ -266,23 +296,6 @@ _python_impl_matches() {
 # python2.7
 # @CODE
 
-# @FUNCTION: python_export
-# @USAGE: [] ...
-# @INTERNAL
-# @DESCRIPTION:
-# Backwards compatibility function.  The relevant API is now considered
-# private, please use python_get* instead.
-python_export() {
-   debug-print-function ${FUNCNAME} "${@}"
-
-   eqawarn "python_export() is part of private eclass API."
-   eqawarn "Please call python_get*() instead."
-
-   [[ ${EAPI} == [67] ]] || die 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-01-30 Thread Sam James
commit: f207c793fd9e0bcb44628813ee5ec1c68dba72b9
Author: Sam James  gentoo  org>
AuthorDate: Mon Jan 31 01:07:08 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jan 31 01:07:08 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f207c793

python-utils-r1.eclass: sync with ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/python-utils-r1.eclass | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 9170229202..53a305f40e 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: python-utils-r1.eclass
@@ -17,7 +17,7 @@
 # functions. It can be inherited safely.
 #
 # For more information, please see the Python Guide:
-# https://dev.gentoo.org/~mgorny/python-guide/
+# https://projects.gentoo.org/python/guide/
 
 # NOTE: When dropping support for EAPIs here, we need to update
 # metadata/install-qa-check.d/60python-pyc
@@ -1350,6 +1350,14 @@ epytest() {
-Wdefault
# override color output
"--color=${color}"
+   # disable the undesirable-dependency plugins by default to
+   # trigger missing argument strips.  strip options that require
+   # them from config files.  enable them explicitly via "-p ..."
+   # if you *really* need them.
+   -p no:cov
+   -p no:flake8
+   -p no:flakes
+   -p no:pylint
)
local x
for x in "${EPYTEST_DESELECT[@]}"; do



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-01-22 Thread Sam James
commit: 33992d50c1a2f182d04182a7213c7247ee10aba6
Author: Sam James  gentoo  org>
AuthorDate: Sun Jan 23 02:27:13 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Jan 23 02:27:13 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=33992d50

autotools.eclass: sync with ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/autotools.eclass | 38 +-
 1 file changed, 25 insertions(+), 13 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 5b4d4457ee..cf1c3461f9 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: autotools.eclass
@@ -74,7 +74,7 @@ inherit gnuconfig libtool
 # 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:  :
-_LATEST_AUTOMAKE=( 1.16.2-r1:1.16 )
+_LATEST_AUTOMAKE=( 1.16.4:1.16 )
 
 _automake_atom="sys-devel/automake"
 _autoconf_atom="sys-devel/autoconf"
@@ -95,7 +95,7 @@ if [[ -n ${WANT_AUTOCONF} ]] ; then
none)   _autoconf_atom="" ;; # some packages don't require 
autoconf at all
2.1)_autoconf_atom="~sys-devel/autoconf-2.13" ;;
# if you change the "latest" version here, change also 
autotools_env_setup
-   latest|2.5) _autoconf_atom=">=sys-devel/autoconf-2.69" ;;
+   latest|2.5) _autoconf_atom=">=sys-devel/autoconf-2.71" ;;
*)  die "Invalid WANT_AUTOCONF value 
'${WANT_AUTOCONF}'" ;;
esac
export WANT_AUTOCONF
@@ -112,7 +112,7 @@ if [[ -n ${WANT_LIBTOOL} ]] ; then
 fi
 
 # @ECLASS-VARIABLE: AUTOTOOLS_DEPEND
-# @INTERNAL
+# @OUTPUT_VARIABLE
 # @DESCRIPTION:
 # Contains the combination of requested automake/autoconf/libtool
 # versions in *DEPEND format.
@@ -131,7 +131,7 @@ RDEPEND=""
 if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then
case ${EAPI} in
5|6) DEPEND=${AUTOTOOLS_DEPEND} ;;
-   7) BDEPEND=${AUTOTOOLS_DEPEND} ;;
+   *) BDEPEND=${AUTOTOOLS_DEPEND} ;;
esac
 fi
 __AUTOTOOLS_AUTO_DEPEND=${AUTOTOOLS_AUTO_DEPEND} # See top of eclass
@@ -332,8 +332,26 @@ eaclocal_amflags() {
 # They also force installing the support files for safety.
 # Respects AT_M4DIR for additional directories to search for macros.
 eaclocal() {
+   # Feed in a list of paths:
+   # - ${BROOT}/usr/share/aclocal
+   # - ${ESYSROOT}/usr/share/aclocal
+   # See bug #677002
+   if [[ ${EAPI} != [56] ]] ; then
+   if [[ ! -f "${T}"/aclocal/dirlist ]] ; then
+   mkdir "${T}"/aclocal || die
+   cat <<- EOF > "${T}"/aclocal/dirlist || die
+   ${BROOT}/usr/share/aclocal
+   ${ESYSROOT}/usr/share/aclocal
+   EOF
+   fi
+
+   local system_acdir=" --system-acdir=${T}/aclocal"
+   else
+   local system_acdir=""
+   fi
+
[[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) 
]] && \
-   autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags)
+   autotools_run_tool --at-m4flags aclocal "$@" 
$(eaclocal_amflags) ${system_acdir}
 }
 
 # @FUNCTION: _elibtoolize
@@ -514,7 +532,7 @@ autotools_env_setup() {
[[ ${WANT_AUTOMAKE} == "latest" ]] && \
die "Cannot find the latest automake! Tried 
${_LATEST_AUTOMAKE[*]}"
fi
-   [[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.5
+   [[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.71
 }
 
 # @FUNCTION: autotools_run_tool
@@ -670,12 +688,6 @@ autotools_m4sysdir_include() {
# First try to use the paths the system integrator has set up.
local paths=( $(eval echo ${AT_SYS_M4DIR}) )
 
-   if [[ ${#paths[@]} -eq 0 && -n ${SYSROOT} ]] ; then
-   # If they didn't give us anything, then default to the SYSROOT.
-   # This helps when cross-compiling.
-   local path="${SYSROOT}/usr/share/aclocal"
-   [[ -d ${path} ]] && paths+=( "${path}" )
-   fi
_autotools_m4dir_include "${paths[@]}"
 }
 



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2022-01-22 Thread Sam James
commit: aabb74b757d604aa524af81c800cb686260aa18c
Author: Sam James  gentoo  org>
AuthorDate: Sun Jan 23 01:16:21 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Jan 23 01:16:21 2022 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=aabb74b7

python-utils-r1.eclass: sync with ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/python-utils-r1.eclass | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 5e035f86a9..9170229202 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -436,6 +436,12 @@ _python_export() {
case ${impl} in
python2.7)

PYTHON_PKG_DEP='>=dev-lang/python-2.7.5-r2:2.7';;
+   python3.8)
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.8.8_p1-r1:3.8";;
+   python3.9)
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.9.6_p1-r1:3.9";;
+   python3.10)
+   
PYTHON_PKG_DEP=">=dev-lang/python-3.10.0_p1-r1:3.10";;
python*)

PYTHON_PKG_DEP="dev-lang/python:${impl#python}";;
pypy)
@@ -1273,7 +1279,8 @@ build_sphinx() {
sed -i -e 's:^intersphinx_mapping:disabled_&:' \
"${dir}"/conf.py || die
# not all packages include the Makefile in pypi tarball
-   sphinx-build -b html -d "${dir}"/_build/doctrees "${dir}" \
+   "${EPYTHON}" -m sphinx.cmd.build \
+   -b html -d "${dir}"/_build/doctrees "${dir}" \
"${dir}"/_build/html || die
 
HTML_DOCS+=( "${dir}/_build/html/." )
@@ -1320,6 +1327,16 @@ epytest() {
 
_python_check_EPYTHON
 
+   local color
+   case ${NOCOLOR} in
+   true|yes)
+   color=no
+   ;;
+   *)
+   color=yes
+   ;;
+   esac
+
local args=(
# verbose progress reporting and tracebacks
-vv
@@ -1331,6 +1348,8 @@ epytest() {
# override filterwarnings=error, we do not really want -Werror
# for end users, as it tends to fail on new warnings from deps
-Wdefault
+   # override color output
+   "--color=${color}"
)
local x
for x in "${EPYTEST_DESELECT[@]}"; do



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-12-03 Thread Fabian Groffen
commit: d0cd35d2637e0d8ecb9ca17836cf42928f179a5a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Dec  3 10:03:22 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Dec  3 10:03:22 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d0cd35d2

eclass/java-utils-2: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/java-utils-2.eclass | 35 +--
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 8a6db80fdb..a778b387b3 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -6,7 +6,7 @@
 # j...@gentoo.org
 # @AUTHOR:
 # Thomas Matthijs , Karl Trygve Kalleberg 
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: Base eclass for Java packages
 # @DESCRIPTION:
 # This eclass provides functionality which is used by java-pkg-2.eclass,
@@ -18,7 +18,7 @@
 # Ant-based packages.
 
 case ${EAPI:-0} in
-   [567]) ;;
+   [5678]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
@@ -118,13 +118,29 @@ 
JAVA_PKG_ALLOW_VM_CHANGE=${JAVA_PKG_ALLOW_VM_CHANGE:="yes"}
 # Normally this is determined from the jre/jdk version specified in RDEPEND.
 # See java-pkg_get-target function below.
 #
-# Should generallyonly be used for testing and debugging.
+# Should generally only be used for testing and debugging.
 #
 # emerge bar to be compatible with 1.3
 # @CODE
 #  JAVA_PKG_WANT_TARGET=1.3 emerge bar
 # @CODE
 
+# @ECLASS-VARIABLE: JAVA_TEST_EXTRA_ARGS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array of extra arguments that should be passed to java command when running 
tests.
+# It is useful when you need to pass a value to a Java program that uses
+# System.getProperty(). If it uses System.getenv(), use `export var=value` 
instead.
+#
+# It is used only when running tests.
+#
+# @CODE
+#  JAVA_TEST_EXTRA_ARGS=(
+#  -Dsome.var=x
+#  "-Dother.var=\"y z\""
+#  )
+# @CODE
+
 # @ECLASS-VARIABLE: JAVA_PKG_DEBUG
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -1549,8 +1565,7 @@ java-pkg_ensure-vm-version-ge() {
 # Parameters:
 # $@ - VM version to compare current VM to
 # @CODE
-# @RETURN: zero - current VM version is greater than checked version;
-#  non-zero - current VM version is not greater than checked version
+# @RETURN: zero - current VM version is greater than checked version; non-zero 
- current VM version is not greater than checked version
 java-pkg_is-vm-version-ge() {
debug-print-function ${FUNCNAME} $*
 
@@ -1801,8 +1816,8 @@ ejunit_() {
if [[ "${junit}" == "junit-4" ]] ; then
runner=org.junit.runner.JUnitCore
fi
-   debug-print "Calling: java -cp \"${cp}\" -Djava.io.tmpdir=\"${T}\" 
-Djava.awt.headless=true ${runner} ${@}"
-   java -cp "${cp}" -Djava.io.tmpdir="${T}/" -Djava.awt.headless=true 
${runner} "${@}" || die "Running junit failed"
+   debug-print "Calling: java -cp \"${cp}\" -Djava.io.tmpdir=\"${T}\" 
-Djava.awt.headless=true ${JAVA_TEST_EXTRA_ARGS[@]} ${runner} ${@}"
+   java -cp "${cp}" -Djava.io.tmpdir="${T}/" -Djava.awt.headless=true 
${JAVA_TEST_EXTRA_ARGS[@]} ${runner} "${@}" || die "Running junit failed"
 }
 
 # @FUNCTION: ejunit
@@ -1881,9 +1896,9 @@ etestng() {
done
 
debug-print "java -cp \"${cp}\" -Djava.io.tmpdir=\"${T}\""\
-   "-Djava.awt.headless=true ${runner}"\
+   "-Djava.awt.headless=true ${JAVA_TEST_EXTRA_ARGS[@]} ${runner}"\
"-usedefaultlisteners false -testclass ${tests}"
-   java -cp "${cp}" -Djava.io.tmpdir=\"${T}\" -Djava.awt.headless=true\
+   java -cp "${cp}" -Djava.io.tmpdir=\"${T}\" -Djava.awt.headless=true 
${JAVA_TEST_EXTRA_ARGS[@]}\
${runner} -usedefaultlisteners false -testclass ${tests}\
|| die "Running TestNG failed."
 }
@@ -1894,7 +1909,7 @@ etestng() {
 # Don't call directly, but via java-pkg-2_src_prepare!
 java-utils-2_src_prepare() {
case ${EAPI:-0} in
-   [0-5])
+   5)
java-pkg_func-exists java_prepare && java_prepare ;;
*)
java-pkg_func-exists java_prepare &&



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-10-21 Thread Fabian Groffen
commit: ce4687a8c9a175ac2b08b42881efead4218a7f58
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Oct 21 06:39:04 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Oct 21 06:39:04 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ce4687a8

python-utils-r1: sync with gx86, bug #818043

Bug: https://bugs.gentoo.org/818043
Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 117 ++
 1 file changed, 62 insertions(+), 55 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 0c173e2308..5e035f86a9 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -35,7 +35,7 @@ fi
 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
 
 [[ ${EAPI} == [67] ]] && inherit eapi8-dosym
-inherit toolchain-funcs
+inherit multiprocessing toolchain-funcs
 
 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
 # @INTERNAL
@@ -353,16 +353,13 @@ _python_export() {
;;
PYTHON_SITEDIR)
[[ -n ${PYTHON} ]] || die "PYTHON needs to be 
set for ${var} to be exported, or requested before it"
-   # sysconfig can't be used because:
-   # 1) pypy doesn't give site-packages but stdlib
-   # 2) jython gives paths with wrong case
-   PYTHON_SITEDIR=$("${PYTHON}" -c 'import 
distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') || die
+   PYTHON_SITEDIR=$("${PYTHON}" -c 'import 
sysconfig; print(sysconfig.get_path("purelib"))') || die
export PYTHON_SITEDIR
debug-print "${FUNCNAME}: PYTHON_SITEDIR = 
${PYTHON_SITEDIR}"
;;
PYTHON_INCLUDEDIR)
[[ -n ${PYTHON} ]] || die "PYTHON needs to be 
set for ${var} to be exported, or requested before it"
-   PYTHON_INCLUDEDIR=$("${PYTHON}" -c 'import 
distutils.sysconfig; print(distutils.sysconfig.get_python_inc())') || die
+   PYTHON_INCLUDEDIR=$("${PYTHON}" -c 'import 
sysconfig; print(sysconfig.get_path("platinclude"))') || die
export PYTHON_INCLUDEDIR
debug-print "${FUNCNAME}: PYTHON_INCLUDEDIR = 
${PYTHON_INCLUDEDIR}"
 
@@ -580,46 +577,6 @@ python_get_scriptdir() {
echo "${PYTHON_SCRIPTDIR}"
 }
 
-# @FUNCTION: _python_ln_rel
-# @USAGE:  
-# @INTERNAL
-# @DESCRIPTION:
-# Create a relative symlink.
-_python_ln_rel() {
-   debug-print-function ${FUNCNAME} "${@}"
-
-   local target=${1}
-   local symname=${2}
-
-   local tgpath=${target%/*}/
-   local sympath=${symname%/*}/
-   local rel_target=
-
-   while [[ ${sympath} ]]; do
-   local tgseg= symseg=
-
-   while [[ ! ${tgseg} && ${tgpath} ]]; do
-   tgseg=${tgpath%%/*}
-   tgpath=${tgpath#${tgseg}/}
-   done
-
-   while [[ ! ${symseg} && ${sympath} ]]; do
-   symseg=${sympath%%/*}
-   sympath=${sympath#${symseg}/}
-   done
-
-   if [[ ${tgseg} != ${symseg} ]]; then
-   rel_target=../${rel_target}${tgseg:+${tgseg}/}
-   fi
-   done
-   rel_target+=${tgpath}${target##*/}
-
-   debug-print "${FUNCNAME}: ${symname} -> ${target}"
-   debug-print "${FUNCNAME}: rel_target = ${rel_target}"
-
-   ln -fs "${rel_target}" "${symname}"
-}
-
 # @FUNCTION: python_optimize
 # @USAGE: [...]
 # @DESCRIPTION:
@@ -661,6 +618,9 @@ python_optimize() {
debug-print "${FUNCNAME}: using sys.path: ${*/%/;}"
fi
 
+   local jobs=$(makeopts_jobs "${MAKEOPTS}" INF)
+   [[ ${jobs} == INF ]] && jobs=$(get_nproc)
+
local d
for d; do
# make sure to get a nice path without //
@@ -672,11 +632,14 @@ python_optimize() {
"${PYTHON}" -m compileall -q -f -d 
"${instpath}" "${d}"
"${PYTHON}" -OO -m compileall -q -f -d 
"${instpath}" "${d}"
;;
-   python*|pypy3)
+   python3.[5678]|pypy3)
# both levels of optimization are separate 
since 3.5
-   "${PYTHON}" -m compileall -q -f -d 
"${instpath}" "${d}"
-   "${PYTHON}" -O -m compileall -q -f -d 
"${instpath}" "${d}"
-   "${PYTHON}" -OO -m compileall -q -f -d 
"${instpath}" "${d}"
+   "${PYTHON}" -m compileall -j "${jobs}" -q -f -d 
"${instpath}" "${d}"
+   "${PYTHON}" -O -m compileall -j 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-10-14 Thread Sam James
commit: 5ac47e9af517a4723bd5381df16d354d3288187e
Author: Sam James  gentoo  org>
AuthorDate: Thu Oct 14 06:15:43 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Oct 14 06:15:46 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5ac47e9a

toolchain.eclass: fix typo in comment

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 2bdc8f5633..a07f9b680e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -261,7 +261,7 @@ fi
 
 if tc_has_feature sanitize ; then
# libsanitizer relies on 'crypt.h' to be present
-   # on target. glibc userdto provide it unconditionally.
+   # on target. glibc used to provide it unconditionally.
# Nowadays it's a standalone library: #802648
DEPEND+=" sanitize? ( virtual/libcrypt )"
 fi



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-10-14 Thread Sam James
commit: 46cb1cb5a5e1f8eeba77ad733d3af149d8a4ce19
Author: Sam James  gentoo  org>
AuthorDate: Thu Oct 14 06:14:08 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Oct 14 06:14:46 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=46cb1cb5

toolchain.eclass: depend on virtual/libcrypt with USE=sanitize

Bug: https://bugs.gentoo.org/802648
Closes: https://bugs.gentoo.org/817974
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index da707d504d..2bdc8f5633 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -259,6 +259,13 @@ if tc_has_feature gcj ; then
DEPEND+=" gcj? ( awt? ( ${GCJ_GTK_DEPS} ) ${GCJ_DEPS} )"
 fi
 
+if tc_has_feature sanitize ; then
+   # libsanitizer relies on 'crypt.h' to be present
+   # on target. glibc userdto provide it unconditionally.
+   # Nowadays it's a standalone library: #802648
+   DEPEND+=" sanitize? ( virtual/libcrypt )"
+fi
+
 if tc_has_feature systemtap ; then
# gcc needs sys/sdt.h headers on target
DEPEND+=" systemtap? ( dev-util/systemtap )"



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-10-12 Thread Sam James
commit: 8c54a32b4cb76ea135c3cdfe2509a3a96f18ddee
Author: Sam James  gentoo  org>
AuthorDate: Wed Oct 13 04:04:27 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Oct 13 04:05:53 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=8c54a32b

toolchain.eclass: add ~sam to distfiles

Mirrored slyfox's distfiles to my devspace.

Closes: https://bugs.gentoo.org/812278
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index ff032dac0b..da707d504d 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -296,7 +296,7 @@ S=$(
 gentoo_urls() {
local devspace="HTTP~vapier/dist/URI HTTP~rhill/dist/URI
HTTP~zorry/patches/gcc/URI HTTP~blueness/dist/URI
-   HTTP~tamiko/distfiles/URI HTTP~slyfox/distfiles/URI"
+   HTTP~tamiko/distfiles/URI HTTP~sam/distfiles/URI 
HTTP~slyfox/distfiles/URI"
devspace=${devspace//HTTP/https:\/\/dev.gentoo.org\/}
echo mirror://gentoo/$1 ${devspace//URI/$1}
 }



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-07-13 Thread Fabian Groffen
commit: 7f1ba932dc75585e05798e171d2ee2324e06b69e
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Jul 13 09:02:31 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Jul 13 09:02:31 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7f1ba932

autotools.eclass: sync for EAPI=8

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/autotools.eclass | 21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 196d5075f4..5b4d4457ee 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: autotools.eclass
 # @MAINTAINER:
 # base-sys...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: Regenerates auto* build scripts
 # @DESCRIPTION:
 # This eclass is for safely handling autotooled software packages that need to
@@ -31,7 +31,7 @@ case ${EAPI} in
# Needed for eqawarn
inherit eutils
;;
-   7) ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
 esac
 
@@ -373,10 +373,21 @@ eautoconf() {
die "No configure.{ac,in} present!"
fi
 
+
if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then
-   eqawarn "This package has a configure.in file which has long 
been deprecated.  Please"
-   eqawarn "update it to use configure.ac instead as newer 
versions of autotools will die"
-   eqawarn "when it finds this file.  See 
https://bugs.gentoo.org/426262 for details."
+   case ${EAPI:-0} in
+   0|1|2|3|4|5|6|7)
+   eqawarn "This package has a configure.in file 
which has long been deprecated.  Please"
+   eqawarn "update it to use configure.ac instead 
as newer versions of autotools will die"
+   eqawarn "when it finds this file.  See 
https://bugs.gentoo.org/426262 for details."
+   ;;
+   *)
+   # Move configure file to the new location only 
on newer EAPIs to ensure
+   # checks are done rather than retroactively 
breaking ebuilds.
+   eqawarn "Moving configure.in to configure.ac 
(bug #426262)"
+   mv configure.{in,ac} || die
+   ;;
+   esac
fi
 
# Install config.guess and config.sub which are required by many macros



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-06-29 Thread Fabian Groffen
commit: 639a46bc1d1b9974c18ef834a82b07f94d809ef4
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Jun 29 06:48:03 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Jun 29 06:48:03 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=639a46bc

eclass/java-utils-2: fix sync error

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/java-utils-2.eclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 1b7fcc295a..8a6db80fdb 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -2945,3 +2945,5 @@ java-pkg_gen-cp() {
fi
done
 }
+
+fi



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-06-29 Thread Fabian Groffen
commit: ae01728421dd36f2c5d669cc1d0edfbdef5cc479
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Jun 29 06:22:14 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Jun 29 06:22:52 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ae017284

eclass/*: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/java-utils-2.eclass|  37 +--
 eclass/python-utils-r1.eclass | 102 --
 eclass/toolchain-funcs.eclass |  29 
 eclass/toolchain.eclass   |   5 ++-
 4 files changed, 81 insertions(+), 92 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index cef79405bf..1b7fcc295a 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -6,6 +6,7 @@
 # j...@gentoo.org
 # @AUTHOR:
 # Thomas Matthijs , Karl Trygve Kalleberg 
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Base eclass for Java packages
 # @DESCRIPTION:
 # This eclass provides functionality which is used by java-pkg-2.eclass,
@@ -16,18 +17,23 @@
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
 
+case ${EAPI:-0} in
+   [567]) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then
+_JAVA_UTILS_2_ECLASS=1
+
 # EAPI 7 has version functions built-in. Use eapi7-ver for all earlier 
eclasses.
 # Keep versionator inheritance in case consumers are using it implicitly.
-[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver eutils multilib versionator
+[[ ${EAPI} == [56] ]] && inherit eapi7-ver eutils multilib versionator
 
 IUSE="elibc_FreeBSD"
 
 # Make sure we use java-config-2
 export WANT_JAVA_CONFIG="2"
 
-# Prefix variables are only available for EAPI>=3
-has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
-
 has test ${JAVA_PKG_IUSE} && RESTRICT+=" !test? ( test )"
 
 # @VARIABLE: JAVA_PKG_E_DEPEND
@@ -975,10 +981,6 @@ java-pkg_jar-from() {
 
[[ -z ${target_pkg} ]] && die "Must specify a package"
 
-   if [[ "${EAPI}" == "1" ]]; then
-   target_pkg="${target_pkg//:/-}"
-   fi
-
# default destjar to the target jar
[[ -z "${destjar}" ]] && destjar="${target_jar}"
 
@@ -1114,10 +1116,6 @@ java-pkg_getjars() {
 
local pkgs="${1}"
 
-   if [[ "${EAPI}" == "1" ]]; then
-   pkgs="${pkgs//:/-}"
-   fi
-
jars="$(java-config ${deep} --classpath=${pkgs})"
[[ $? != 0 ]] && die "java-config --classpath=${pkgs} failed"
debug-print "${pkgs}:${jars}"
@@ -1183,10 +1181,6 @@ java-pkg_getjar() {
 
local pkg="${1}" target_jar="${2}" jar
 
-   if [[ "${EAPI}" == "1" ]]; then
-   pkg="${pkg//:/-}"
-   fi
-
[[ -z ${pkg} ]] && die "Must specify package to get a jar from"
[[ -z ${target_jar} ]] && die "Must specify jar to get"
 
@@ -1272,10 +1266,6 @@ java-pkg_register-dependency() {
 
[[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) 
specified"
 
-   if [[ "${EAPI}" == "1" ]]; then
-   pkgs="${pkgs//:/-}"
-   fi
-
if [[ -z "${jar}" ]]; then
for pkg in ${pkgs//,/ }; do
java-pkg_ensure-dep runtime "${pkg}"
@@ -1329,10 +1319,6 @@ java-pkg_register-optional-dependency() {
 
[[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) 
specified"
 
-   if [[ "${EAPI}" == "1" ]]; then
-   pkgs="${pkgs//:/-}"
-   fi
-
if [[ -z "${jar}" ]]; then
for pkg in ${pkgs//,/ }; do
java-pkg_record-jar_ --optional "${pkg}"
@@ -2195,9 +2181,6 @@ java-pkg_init() {
 
# Don't set up build environment if installing from binary. #206024 
#258423
[[ "${MERGE_TYPE}" == "binary" ]] && return
-   # Also try Portage's nonstandard EMERGE_FROM for old EAPIs, if it 
doesn't
-   # work nothing is lost.
-   has ${EAPI:-0} 0 1 2 3 && [[ "${EMERGE_FROM}" == "binary" ]] && return
 
unset JAVAC
unset JAVA_HOME

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 5023750fd6..0c173e2308 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -7,7 +7,7 @@
 # @AUTHOR:
 # Author: Michał Górny 
 # Based on work of: Krzysztof Pawlik 
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: Utility functions for packages with Python parts.
 # @DESCRIPTION:
 # A utility eclass providing functions to query Python implementations,
@@ -24,7 +24,7 @@
 # See bug #704286, bug #781878
 case "${EAPI:-0}" in
[0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
-   [6-7]) ;;
+   [6-8]) ;;
*) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
 esac
 
@@ -34,6 +34,7 @@ fi
 
 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
 
+[[ ${EAPI} == [67] ]] && inherit eapi8-dosym
 inherit toolchain-funcs
 
 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-05-04 Thread Fabian Groffen
commit: 5983d5a7f7dc72f345af2575639d2f4b1dacd3f6
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May  4 17:12:29 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May  4 17:12:29 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5983d5a7

eclass/autotools: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/autotools.eclass | 110 +++-
 1 file changed, 53 insertions(+), 57 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index ded5436a45..196d5075f4 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: autotools.eclass
 # @MAINTAINER:
 # base-sys...@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Regenerates auto* build scripts
 # @DESCRIPTION:
 # This eclass is for safely handling autotooled software packages that need to
@@ -19,19 +19,23 @@ if [[ ${__AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then
# eclass at that point, but that adds overhead, and it's trivial
# to re-order inherit in eclasses/ebuilds instead.  #409611
if [[ ${__AUTOTOOLS_AUTO_DEPEND} != ${AUTOTOOLS_AUTO_DEPEND} ]] ; then
-   die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; 
please inherit autotools.eclass first! ${__AUTOTOOLS_AUTO_DEPEND} -> 
${AUTOTOOLS_AUTO_DEPEND}"
+   die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; 
please inherit ${ECLASS} first! ${__AUTOTOOLS_AUTO_DEPEND} -> 
${AUTOTOOLS_AUTO_DEPEND}"
fi
 fi
 
-if [[ -z ${_AUTOTOOLS_ECLASS} ]]; then
+if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then
 _AUTOTOOLS_ECLASS=1
 
-case ${EAPI:-0} in
-   0|1|2|3|4|5|6|7) ;;
+case ${EAPI} in
+   5|6)
+   # Needed for eqawarn
+   inherit eutils
+   ;;
+   7) ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
 esac
 
-inherit libtool
+inherit gnuconfig libtool
 
 # @ECLASS-VARIABLE: WANT_AUTOCONF
 # @PRE_INHERIT
@@ -74,21 +78,14 @@ _LATEST_AUTOMAKE=( 1.16.2-r1:1.16 )
 
 _automake_atom="sys-devel/automake"
 _autoconf_atom="sys-devel/autoconf"
-if [[ -n ${WANT_AUTOMAKE} ]]; then
+if [[ -n ${WANT_AUTOMAKE} ]] ; then
case ${WANT_AUTOMAKE} in
# Even if the package doesn't use automake, we still need to 
depend
# on it because we run aclocal to process m4 macros.  This 
matches
# the autoreconf tool, so this requirement is correct, bug 
#401605.
none) ;;
-   latest)
-   # Use SLOT deps if we can.  For EAPI=0, we get pretty 
close.
-   if [[ ${EAPI:-0} != 0 ]] ; then
-   _automake_atom="|| ( `printf 
'>=sys-devel/automake-%s:%s ' ${_LATEST_AUTOMAKE[@]/:/ }` )"
-   else
-   _automake_atom="|| ( `printf 
'>=sys-devel/automake-%s ' ${_LATEST_AUTOMAKE[@]/%:*}` )"
-   fi
-   ;;
-   *)  _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" 
;;
+   latest) _automake_atom="|| ( `printf 
'>=sys-devel/automake-%s:%s ' ${_LATEST_AUTOMAKE[@]/:/ }` )" ;;
+   *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*";;
esac
export WANT_AUTOMAKE
 fi
@@ -114,10 +111,12 @@ if [[ -n ${WANT_LIBTOOL} ]] ; then
export WANT_LIBTOOL
 fi
 
-# Force people (nicely) to upgrade to a newer version of gettext as
-# older ones are known to be crappy.  #496454
-AUTOTOOLS_DEPEND="!
 # @INTERNAL
+# @DESCRIPTION:
 # See if the specified macros are enabled.
 _at_uses_pkg() {
if [[ -n $(autotools_check_macro "$@") ]] ; then
@@ -340,7 +344,7 @@ eaclocal() {
 _elibtoolize() {
local LIBTOOLIZE=${LIBTOOLIZE:-$(type -P glibtoolize > /dev/null && 
echo glibtoolize || echo libtoolize)}
 
-   if [[ $1 == "--auto-ltdl" ]] ; then
+   if [[ ${1} == "--auto-ltdl" ]] ; then
shift
_at_uses_libltdl && set -- "$@" --ltdl
fi
@@ -368,6 +372,7 @@ eautoconf() {
echo
die "No configure.{ac,in} present!"
fi
+
if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then
eqawarn "This package has a configure.in file which has long 
been deprecated.  Please"
eqawarn "update it to use configure.ac instead as newer 
versions of autotools will die"
@@ -376,15 +381,7 @@ eautoconf() {
 
# Install config.guess and config.sub which are required by many macros
# in autoconf >=2.70.
-   local _gnuconfig
-   case ${EAPI:-0} in
-   0|1|2|3|4|5|6)
-   _gnuconfig="${EPREFIX}/usr/share/gnuconfig"
-   ;;
-   *)
-   _gnuconfig="${BROOT}/usr/share/gnuconfig"
-   ;;
-   esac
+   local _gnuconfig=$(gnuconfig_findnewest)
  

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-05-04 Thread Fabian Groffen
commit: d971f4704326c583cb3bc8425997851f9df96579
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May  4 17:13:42 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May  4 17:13:42 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d971f470

eclass/db: drop from prefix

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/db.eclass | 199 ---
 1 file changed, 199 deletions(-)

diff --git a/eclass/db.eclass b/eclass/db.eclass
deleted file mode 100644
index 96a857a196..00
--- a/eclass/db.eclass
+++ /dev/null
@@ -1,199 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @ECLASS: db.eclass
-# @MAINTAINER:
-# base-sys...@gentoo.org
-# @BLURB: Internal eclass used by sys-libs/db ebuilds
-
-inherit eutils multilib multiprocessing
-
-IUSE="doc test examples"
-
-EXPORT_FUNCTIONS src_test
-
-DEPEND="test? ( >=dev-lang/tcl-8.4 )"
-
-RDEPEND=""
-
-db_fix_so() {
-   has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   LIB="${EROOT}/usr/$(get_libdir)"
-
-   cd "${LIB}" || die
-
-   # first clean up old symlinks
-   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname)" 
-delete || die
-   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname 
"[23]")" -delete || die
-   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die
-
-   # now rebuild all the correct ones
-   local ext
-   for ext in so dylib a; do
-   for name in libdb libdb_{cxx,tcl,java,sql,stl}; do
-   target="$(find . -maxdepth 1 -type f -name 
"${name}-*.${ext}" |sort -V |tail -n 1)"
-   [[ -n "${target}" ]] && ln -sf ${target//.\//} 
${name}.${ext}
-   done;
-   done;
-
-   # db[23] gets some extra-special stuff
-   if [[ -f libdb1$(get_libname 2) ]]; then
-   ln -sf libdb1$(get_libname 2) libdb$(get_libname 2)
-   ln -sf libdb1$(get_libname 2) libdb1$(get_libname)
-   ln -sf libdb1$(get_libname 2) libdb-1$(get_libname)
-   fi
-   # what do we do if we ever get 3.3 ?
-   local i
-   for i in libdb libdb_{cxx,tcl,java,sql,stl}; do
-   if [[ -f $i-3.2$(get_libname) ]]; then
-   ln -sf $i-3.2$(get_libname) $i-3$(get_libname)
-   ln -sf $i-3.2$(get_libname) $i$(get_libname 3)
-   fi
-   done
-
-   # do the same for headers now
-   # but since there are only two of them, just overwrite them
-   cd "${EROOT}"/usr/include
-   target="$(find . -maxdepth 1 -type d -name 'db[0-9]*' | sort -V |cut 
-d/ -f2- | tail -n1)"
-   if [[ -n "${target}" ]] && [[ -e "${target}/db.h" ]] && ( ! [[ -e db.h 
]] || [[ -h db.h ]] ); then
-   einfo "Creating db.h symlinks to ${target}"
-   ln -sf "${target}"/db.h .
-   ln -sf "${target}"/db_185.h .
-   elif [[ ! -e "${target}/db.h" ]]; then
-   if [[ -n "${target}" ]]; then
-   ewarn "Could not find ${target}/db.h"
-   elif [[ -h db.h ]]; then
-   einfo "Apparently you just removed the last instance of 
$PN. Removing the symlinks"
-   rm -f db.h db_185.h
-   fi
-   fi
-}
-
-db_src_install_doc() {
-   has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
-   # not everybody wants this wad of documentation as it is primarily API 
docs
-   if use doc; then
-   dodir /usr/share/doc/${PF}/html
-   mv "${ED}"/usr/docs/* "${ED}"/usr/share/doc/${PF}/html/ || die
-   rm -rf "${ED}"/usr/docs
-   else
-   rm -rf "${ED}"/usr/docs
-   fi
-
-   db_src_install_examples
-}
-
-db_src_install_examples() {
-   has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
-   if use examples ; then
-   local langs=( c cxx stl )
-   [[ "${IUSE/java}" != "${IUSE}" ]] \
-   && use java \
-   && langs+=( java )
-   local i
-   for i in ${langs[@]} ; do
-   destdir="/usr/share/doc/${PF}/"
-   src="${S}/../examples_${i}/"
-   if [[ -f "${src}" ]]; then
-   dodir "${destdir}"
-   cp -ra "${src}" "${ED}${destdir}/" || die
-   fi
-   done
-   fi
-}
-
-db_src_install_usrbinslot() {
-   has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
-   # slot all program names to avoid overwriting
-   local fname
-   for fname in "${ED}"/usr/bin/db*
-   do
-   dn="$(dirname "${fname}")"
-   bn="$(basename "${fname}")"
-   bn="${bn/db/db${SLOT}}"
-   mv "${fname}" "${dn}/${bn}" || 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-05-04 Thread Fabian Groffen
commit: eabb513a9e31d0c5f12742fd8183527a6a7cc766
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May  4 17:17:57 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May  4 17:17:57 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=eabb513a

eclass/java-utils-2: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/java-utils-2.eclass | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index c4d980c607..cef79405bf 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2020 Gentoo Authors
+# Copyright 2004-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: java-utils-2.eclass
@@ -1484,7 +1484,6 @@ java-pkg_ensure-vm-version-sufficient() {
 
 # @FUNCTION: java-pkg_is-vm-version-sufficient
 # @INTERNAL
-# @DESCRIPTION:
 # @RETURN: zero - VM is sufficient; non-zero - VM is not sufficient
 java-pkg_is-vm-version-sufficient() {
debug-print-function ${FUNCNAME} $*
@@ -2194,8 +2193,6 @@ use_doc() {
 java-pkg_init() {
debug-print-function ${FUNCNAME} $*
 
-   [[ ${CHOST} == *-winnt* ]] && return
-
# Don't set up build environment if installing from binary. #206024 
#258423
[[ "${MERGE_TYPE}" == "binary" ]] && return
# Also try Portage's nonstandard EMERGE_FROM for old EAPIs, if it 
doesn't
@@ -2600,14 +2597,14 @@ java-pkg_needs-vm() {
 
 # @FUNCTION: java-pkg_get-current-vm
 # @INTERNAL
-# @RETURN - The current VM being used
+# @RETURN: The current VM being used
 java-pkg_get-current-vm() {
java-config -f
 }
 
 # @FUNCTION: java-pkg_get-vm-vendor
 # @INTERNAL
-# @RETURN - The vendor of the current VM
+# @RETURN: The vendor of the current VM
 java-pkg_get-vm-vendor() {
debug-print-function ${FUNCNAME} $*
 
@@ -2618,7 +2615,7 @@ java-pkg_get-vm-vendor() {
 
 # @FUNCTION: java-pkg_get-vm-version
 # @INTERNAL
-# @RETURN - The version of the current VM
+# @RETURN: The version of the current VM
 java-pkg_get-vm-version() {
debug-print-function ${FUNCNAME} $*
 
@@ -2627,12 +2624,12 @@ java-pkg_get-vm-version() {
 
 # @FUNCTION: java-pkg_build-vm-from-handle
 # @INTERNAL
+# @RETURN: VM handle of an available JDK
 # @DESCRIPTION:
 # Selects a build vm from a list of vm handles. First checks for the system-vm
 # beeing usable, then steps through the listed handles till a suitable vm is
 # found.
 #
-# @RETURN - VM handle of an available JDK
 java-pkg_build-vm-from-handle() {
debug-print-function ${FUNCNAME} "$*"
 



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-05-04 Thread Fabian Groffen
commit: 5b4bc212f92575f039a0a39aec988beae66f6701
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May  4 17:15:51 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May  4 17:15:51 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5b4bc212

eclass/flag-o-matic: drop from prefix

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/flag-o-matic.eclass | 776 -
 1 file changed, 776 deletions(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
deleted file mode 100644
index 20ee39d98b..00
--- a/eclass/flag-o-matic.eclass
+++ /dev/null
@@ -1,776 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @ECLASS: flag-o-matic.eclass
-# @MAINTAINER:
-# toolch...@gentoo.org
-# @BLURB: common functions to manipulate and query toolchain flags
-# @DESCRIPTION:
-# This eclass contains a suite of functions to help developers sanely
-# and safely manage toolchain flags in their builds.
-
-if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then
-_FLAG_O_MATIC_ECLASS=1
-
-inherit eutils toolchain-funcs multilib
-
-# Return all the flag variables that our high level funcs operate on.
-all-flag-vars() {
-   echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS
-}
-
-# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
-# Note: shell globs and character lists are allowed
-setup-allowed-flags() {
-   ALLOWED_FLAGS=(
-   -pipe -O '-O[12sg]' -mcpu -march -mtune
-   '-fstack-protector*' '-fsanitize*' '-fstack-check*' 
-fno-stack-check
-   -fbounds-check -fbounds-checking -fno-strict-overflow
-   -fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time
-
-   # debugging symbols should generally be very safe to add
-   -g '-g[0-9]'
-   -ggdb '-ggdb[0-9]'
-   -gdwarf '-gdwarf-*'
-   -gstabs -gstabs+
-   -gz
-
-   -fno-ident -fpermissive -frecord-gcc-switches
-   '-fdiagnostics*' '-fplugin*'
-   '-W*' -w
-
-   # CPPFLAGS and LDFLAGS
-   '-[DUILR]*' '-Wl,*'
-
-   # Linker choice flag
-   '-fuse-ld'
-   )
-
-   # allow a bunch of flags that negate features / control ABI
-   ALLOWED_FLAGS+=(
-   '-fno-stack-protector*' '-fabi-version=*'
-   -fno-strict-aliasing -fno-bounds-check -fno-bounds-checking 
-fstrict-overflow
-   -fno-omit-frame-pointer '-fno-builtin*'
-   )
-   ALLOWED_FLAGS+=(
-   -mregparm -mno-app-regs -mapp-regs -mno-mmx -mno-sse
-   -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2
-   -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt
-   -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 
-mplt
-   -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu
-   -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe 
-mno-spe
-   -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat
-   -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi
-   -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel
-   -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi
-   -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400
-   -mfix-rm7000 -mno-fix-rm7000 -mfix-r1 -mno-fix-r1
-   -mr10k-cache-barrier -mthumb -marm
-
-   # gcc 4.5
-   -mno-fma4 -mno-movbe -mno-xop -mno-lwp
-   # gcc 4.6
-   -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-bmi -mno-tbm
-   # gcc 4.7
-   -mno-avx2 -mno-bmi2 -mno-fma -mno-lzcnt
-   # gcc 4.8
-   -mno-fxsr -mno-hle -mno-rtm -mno-xsave -mno-xsaveopt
-   # gcc 4.9
-   -mno-avx512cd -mno-avx512er -mno-avx512f -mno-avx512pf -mno-sha
-   )
-
-   # Allow some safe individual flags. Should come along with the bug 
reference.
-   ALLOWED_FLAGS+=(
-   # Allow explicit stack realignment to run non-conformant
-   # binaries: bug #677852
-   -mstackrealign
-   )
-}
-
-# inverted filters for hardened compiler.  This is trying to unpick
-# the hardened compiler defaults.
-_filter-hardened() {
-   local f
-   for f in "$@" ; do
-   case "${f}" in
-   # Ideally we should only concern ourselves with PIE 
flags,
-   # not -fPIC or -fpic, but too many places filter -fPIC 
without
-   # thinking about -fPIE.
-   -fPIC|-fpic|-fPIE|-fpie|-Wl,pie|-pie)
-   gcc-specs-pie || continue
-   if ! is-flagq -nopie && ! is-flagq -no-pie ; 
then
-  

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-05-04 Thread Fabian Groffen
commit: 6029c8fcb03f40eba4da6e9d870b91de43670c67
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May  4 17:20:52 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May  4 17:20:52 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6029c8fc

eclass/toolchain: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 6e7411559a..e85900934f 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -173,7 +173,16 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
tc_version_is_at_least 6.5 &&
IUSE+=" graphite" TC_FEATURES+=(graphite)
tc_version_is_between 4.9 8 && IUSE+=" cilk"
-   tc_version_is_at_least 4.9 && IUSE+=" ada +vtv"
+   tc_version_is_at_least 4.9 && IUSE+=" ada"
+
+   # Don't enable USE=vtv starting from gcc-10. Once gcc-10
+   # stable everywhere disable by default on older versions
+   # as well.
+   if tc_version_is_at_least 10; then
+   IUSE+=" vtv"
+   elif tc_version_is_at_least 4.9; then
+   IUSE+=" +vtv"
+   fi
tc_version_is_at_least 5.0 && IUSE+=" jit"
tc_version_is_between 5.0 9 && IUSE+=" mpx"
tc_version_is_at_least 6.0 && IUSE+=" +pie +ssp +pch"



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-05-04 Thread Fabian Groffen
commit: 811aed4f00904b87f49ade8e75a1f00683dc9904
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May  4 17:09:11 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May  4 17:09:11 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=811aed4f

eclass/python-utils-r1: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 88b258a7f6..5023750fd6 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -42,7 +42,7 @@ inherit toolchain-funcs
 # All supported Python implementations, most preferred last.
 _PYTHON_ALL_IMPLS=(
pypy3
-   python3_7 python3_8 python3_9
+   python3_{7..10}
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -125,7 +125,7 @@ _python_set_impls() {
# please keep them in sync with _PYTHON_ALL_IMPLS
# and _PYTHON_HISTORICAL_IMPLS
case ${i} in
-   
jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9])
+   
jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9]|python3_10)
;;
*)
if has "${i}" "${_PYTHON_ALL_IMPLS[@]}" 
\



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-04-10 Thread Sam James
commit: 00e19f7ec43cd9d94d894f87114fbfab0b405df3
Author: Sam James  gentoo  org>
AuthorDate: Sat Apr 10 07:12:24 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Apr 10 07:13:14 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=00e19f7e

autotools.eclass: sync with ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/autotools.eclass | 78 -
 1 file changed, 57 insertions(+), 21 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 5a59c8d2d5..ded5436a45 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: autotools.eclass
@@ -34,16 +34,19 @@ esac
 inherit libtool
 
 # @ECLASS-VARIABLE: WANT_AUTOCONF
+# @PRE_INHERIT
 # @DESCRIPTION:
 # The major version of autoconf your package needs
 : ${WANT_AUTOCONF:=latest}
 
 # @ECLASS-VARIABLE: WANT_AUTOMAKE
+# @PRE_INHERIT
 # @DESCRIPTION:
 # The major version of automake your package needs
 : ${WANT_AUTOMAKE:=latest}
 
 # @ECLASS-VARIABLE: WANT_LIBTOOL
+# @PRE_INHERIT
 # @DESCRIPTION:
 # Do you want libtool?  Valid values here are "latest" and "none".
 : ${WANT_LIBTOOL:=latest}
@@ -54,18 +57,20 @@ inherit libtool
 # CONSTANT!
 # The latest major unstable and stable version/slot of automake available
 # on each arch.
+# Only add unstable version if it is in a different slot than latest stable
+# version.
 # 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.
-# 
+#
+# See bug #312315 and bug #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:  :
-_LATEST_AUTOMAKE=( 1.16.1:1.16 1.15.1:1.15 )
+_LATEST_AUTOMAKE=( 1.16.2-r1:1.16 )
 
 _automake_atom="sys-devel/automake"
 _autoconf_atom="sys-devel/autoconf"
@@ -73,7 +78,7 @@ if [[ -n ${WANT_AUTOMAKE} ]]; then
case ${WANT_AUTOMAKE} in
# Even if the package doesn't use automake, we still need to 
depend
# on it because we run aclocal to process m4 macros.  This 
matches
-   # the autoreconf tool, so this requirement is correct.  #401605
+   # the autoreconf tool, so this requirement is correct, bug 
#401605.
none) ;;
latest)
# Use SLOT deps if we can.  For EAPI=0, we get pretty 
close.
@@ -118,6 +123,7 @@ AUTOTOOLS_DEPEND="!https://bugs.gentoo.org/426262 for details."
fi
 
+   # Install config.guess and config.sub which are required by many macros
+   # in autoconf >=2.70.
+   local _gnuconfig
+   case ${EAPI:-0} in
+   0|1|2|3|4|5|6)
+   _gnuconfig="${EPREFIX}/usr/share/gnuconfig"
+   ;;
+   *)
+   _gnuconfig="${BROOT}/usr/share/gnuconfig"
+   ;;
+   esac
+   cp "${_gnuconfig}"/config.{guess,sub} . || die
+
autotools_run_tool --at-m4flags autoconf "$@"
 }
 
@@ -406,7 +433,7 @@ eautomake() {
|| extra_opts+=( --foreign )
 
# Older versions of automake do not support --force-missing.  But we 
want
-   # to use this whenever possible to update random bundled files #133489.
+   # to use this whenever possible to update random bundled files, bug 
#133489.
case $(_automake_version) in
1.4|1.4[.-]*) ;;
*) extra_opts+=( --force-missing ) ;;
@@ -429,7 +456,16 @@ eautopoint() {
 # use gettext directly.  So we have to copy it in manually since
 # we can't let `autopoint` do it for us.
 config_rpath_update() {
-   local dst src=$(type -P gettext | sed 
's:bin/gettext:share/gettext/config.rpath:')
+   local dst src
+
+   case ${EAPI:-0} in
+   0|1|2|3|4|5|6)
+   src="${EPREFIX}/usr/share/gettext/config.rpath"
+   ;;
+   *)
+   src="${BROOT}/usr/share/gettext/config.rpath"
+   ;;
+   esac
 
[[ $# -eq 0 ]] && set -- $(find -name config.rpath)
[[ $# -eq 0 ]] && return 0
@@ -496,17 +532,17 @@ autotools_run_tool() {
done
 
if [[ ${EBUILD_PHASE} != "unpack" && ${EBUILD_PHASE} != "prepare" ]]; 
then
-   ewarn "QA Warning: running $1 in ${EBUILD_PHASE} phase"
+   ewarn "QA Warning: running '$1' in ${EBUILD_PHASE} phase"
fi
 
if ${missing_ok} && ! type -P ${1} >/dev/null 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-04-10 Thread Sam James
commit: 3a1668e93a4b74fc147f3664d890ece129446067
Author: Sam James  gentoo  org>
AuthorDate: Sat Apr 10 07:15:01 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Apr 10 07:15:01 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=3a1668e9

toolchain-funcs.eclass: sync with ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain-funcs.eclass | 44 ++-
 1 file changed, 35 insertions(+), 9 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index d591c9574e..70709b96d6 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,4 +1,4 @@
-# Copyright 2002-2019 Gentoo Authors
+# Copyright 2002-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: toolchain-funcs.eclass
@@ -73,6 +73,10 @@ tc-getCXX() { tc-getPROG CXX g++ "$@"; }
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the linker
 tc-getLD() { tc-getPROG LD ld "$@"; }
+# @FUNCTION: tc-getSTRINGS
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the strings program
+tc-getSTRINGS() { tc-getPROG STRINGS strings "$@"; }
 # @FUNCTION: tc-getSTRIP
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the strip program
@@ -83,8 +87,12 @@ tc-getSTRIP() { tc-getPROG STRIP strip "$@"; }
 tc-getNM() { tc-getPROG NM nm "$@"; }
 # @FUNCTION: tc-getRANLIB
 # @USAGE: [toolchain prefix]
-# @RETURN: name of the archiver indexer
+# @RETURN: name of the archive indexer
 tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; }
+# @FUNCTION: tc-getREADELF
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the ELF reader
+tc-getREADELF() { tc-getPROG READELF readelf "$@"; }
 # @FUNCTION: tc-getOBJCOPY
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the object copier
@@ -146,6 +154,10 @@ tc-getBUILD_CXX() { tc-getBUILD_PROG CXX g++ "$@"; }
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the linker for building binaries to run on the build machine
 tc-getBUILD_LD() { tc-getBUILD_PROG LD ld "$@"; }
+# @FUNCTION: tc-getBUILD_STRINGS
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the strings program for building binaries to run on the 
build machine
+tc-getBUILD_STRINGS() { tc-getBUILD_PROG STRINGS strings "$@"; }
 # @FUNCTION: tc-getBUILD_STRIP
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the strip program for building binaries to run on the build 
machine
@@ -156,8 +168,12 @@ tc-getBUILD_STRIP() { tc-getBUILD_PROG STRIP strip "$@"; }
 tc-getBUILD_NM() { tc-getBUILD_PROG NM nm "$@"; }
 # @FUNCTION: tc-getBUILD_RANLIB
 # @USAGE: [toolchain prefix]
-# @RETURN: name of the archiver indexer for building binaries to run on the 
build machine
+# @RETURN: name of the archive indexer for building binaries to run on the 
build machine
 tc-getBUILD_RANLIB() { tc-getBUILD_PROG RANLIB ranlib "$@"; }
+# @FUNCTION: tc-getBUILD_READELF
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the ELF reader for building binaries to run on the build 
machine
+tc-getBUILD_READELF() { tc-getBUILD_PROG READELF readelf "$@"; }
 # @FUNCTION: tc-getBUILD_OBJCOPY
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the object copier for building binaries to run on the build 
machine
@@ -378,6 +394,7 @@ tc-env_build() {
NM=$(tc-getBUILD_NM) \
PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG) \
RANLIB=$(tc-getBUILD_RANLIB) \
+   READELF=$(tc-getBUILD_READELF) \
"$@"
 }
 
@@ -490,12 +507,21 @@ tc-ld-is-lld() {
 # If the gold linker is currently selected, configure the compilation
 # settings so that we use the older bfd linker instead.
 tc-ld-disable-gold() {
-   if ! tc-ld-is-gold "$@" ; then
-   # They aren't using gold, so nothing to do!
+   tc-ld-is-gold "$@" && tc-ld-force-bfd "$@"
+}
+
+# @FUNCTION: tc-ld-force-bfd
+# @USAGE: [toolchain prefix]
+# @DESCRIPTION:
+# If the gold or lld linker is currently selected, configure the compilation
+# settings so that we use the bfd linker instead.
+tc-ld-force-bfd() {
+   if ! tc-ld-is-gold "$@" && ! tc-ld-is-lld "$@" ; then
+   # They aren't using gold or lld, so nothing to do!
return
fi
 
-   ewarn "Forcing usage of the BFD linker instead of GOLD"
+   ewarn "Forcing usage of the BFD linker"
 
# Set up LD to point directly to bfd if it's available.
# We need to extract the first word in case there are flags appended
@@ -505,7 +531,7 @@ tc-ld-disable-gold() {
local path_ld=$(which "${bfd_ld}" 2>/dev/null)
[[ -e ${path_ld} ]] && export LD=${bfd_ld}
 
-   # Set up LDFLAGS to select gold based on the gcc / clang version.
+   # Set up LDFLAGS to select bfd based on the gcc / clang version.
local fallback="true"
if tc-is-gcc; then
local major=$(gcc-major-version "$@")
@@ -533,7 +559,7 @@ tc-ld-disable-gold() {
ln -sf "${path_ld}" "${d}"/ld
export 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-04-10 Thread Sam James
commit: f5a6979fe1a87f55b485b5d20e7989330e1a
Author: Sam James  gentoo  org>
AuthorDate: Sat Apr 10 07:14:00 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Apr 10 07:14:00 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f5a6979f

flag-o-matic.eclass: sync with ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/flag-o-matic.eclass | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index f75a975a08..20ee39d98b 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -234,10 +234,7 @@ append-fflags() {
 append-lfs-flags() {
[[ $# -ne 0 ]] && die "append-lfs-flags takes no arguments"
# see comments in filter-lfs-flags func for meaning of these
-   case ${CHOST} in
-   *-aix*) append-cppflags -D_LARGE_FILES -D_LARGE_FILE_API ;;
-   *) append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-D_LARGEFILE64_SOURCE ;;
-   esac
+   append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-D_LARGEFILE64_SOURCE
 }
 
 # @FUNCTION: append-ldflags
@@ -522,13 +519,13 @@ test-flag-PROG() {
"${test_in}" -o "${test_out}"
)
 
-   if ! "${cmdline[@]}" /dev/null; then
+   if ! "${cmdline[@]}" &>/dev/null; then
# -Werror makes clang bail out on unused arguments as well;
# try to add -Qunused-arguments to work-around that
# other compilers don't support it but then, it's failure like
# any other
cmdline+=( -Qunused-arguments )
-   "${cmdline[@]}" /dev/null
+   "${cmdline[@]}" &>/dev/null
fi
 }
 
@@ -573,7 +570,8 @@ test-flags-PROG() {
 
while (( $# )); do
case "$1" in
-   --param)
+   # '-B /foo': bug # 687198
+   --param|-B)
if test-flag-${comp} "$1" "$2"; then
flags+=( "$1" "$2" )
fi



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-04-10 Thread Sam James
commit: 576b06627578c9846b2b265085c13509692ea49f
Author: Sam James  gentoo  org>
AuthorDate: Sat Apr 10 07:08:52 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Apr 10 07:08:52 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=576b0662

python-utils-r1.eclass: sync with ::gentoo

Signed-off-by: Sam James  gentoo.org>

 eclass/python-utils-r1.eclass | 304 +++---
 1 file changed, 81 insertions(+), 223 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 1b1f6b4d4b..88b258a7f6 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: python-utils-r1.eclass
@@ -7,7 +7,7 @@
 # @AUTHOR:
 # Author: Michał Górny 
 # Based on work of: Krzysztof Pawlik 
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: Utility functions for packages with Python parts.
 # @DESCRIPTION:
 # A utility eclass providing functions to query Python implementations,
@@ -19,9 +19,12 @@
 # For more information, please see the Python Guide:
 # https://dev.gentoo.org/~mgorny/python-guide/
 
+# NOTE: When dropping support for EAPIs here, we need to update
+# metadata/install-qa-check.d/60python-pyc
+# See bug #704286, bug #781878
 case "${EAPI:-0}" in
-   [0-4]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
-   [5-7]) ;;
+   [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
+   [6-7]) ;;
*) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
 esac
 
@@ -31,7 +34,6 @@ fi
 
 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
 
-[[ ${EAPI} == 5 ]] && inherit eutils multilib
 inherit toolchain-funcs
 
 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
@@ -40,8 +42,7 @@ inherit toolchain-funcs
 # All supported Python implementations, most preferred last.
 _PYTHON_ALL_IMPLS=(
pypy3
-   python2_7
-   python3_6 python3_7 python3_8 python3_9
+   python3_7 python3_8 python3_9
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -52,8 +53,8 @@ readonly _PYTHON_ALL_IMPLS
 _PYTHON_HISTORICAL_IMPLS=(
jython2_7
pypy pypy1_{8,9} pypy2_0
-   python2_{5,6}
-   python3_{1,2,3,4,5}
+   python2_{5..7}
+   python3_{1..6}
 )
 readonly _PYTHON_HISTORICAL_IMPLS
 
@@ -69,38 +70,6 @@ readonly _PYTHON_HISTORICAL_IMPLS
 # which can involve revisions of this eclass that support a different
 # set of Python implementations.
 
-# @FUNCTION: _python_impl_supported
-# @USAGE: 
-# @INTERNAL
-# @DESCRIPTION:
-# Check whether the implementation  (PYTHON_COMPAT-form)
-# is still supported.
-#
-# Returns 0 if the implementation is valid and supported. If it is
-# unsupported, returns 1 -- and the caller should ignore the entry.
-# If it is invalid, dies with an appopriate error messages.
-_python_impl_supported() {
-   debug-print-function ${FUNCNAME} "${@}"
-
-   [[ ${#} -eq 1 ]] || die "${FUNCNAME}: takes exactly 1 argument (impl)."
-
-   local impl=${1}
-
-   # keep in sync with _PYTHON_ALL_IMPLS!
-   # (not using that list because inline patterns shall be faster)
-   case "${impl}" in
-   python2_7|python3_[6789]|pypy3)
-   return 0
-   ;;
-   jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[56]|python3_[12345])
-   return 1
-   ;;
-   *)
-   [[ ${PYTHON_COMPAT_NO_STRICT} ]] && return 1
-   die "Invalid implementation in PYTHON_COMPAT: ${impl}"
-   esac
-}
-
 # @FUNCTION: _python_verify_patterns
 # @USAGE: ...
 # @INTERNAL
@@ -149,10 +118,26 @@ _python_set_impls() {
if [[ $(declare -p PYTHON_COMPAT) != "declare -a"* ]]; then
die 'PYTHON_COMPAT must be an array.'
fi
-   for i in "${PYTHON_COMPAT[@]}"; do
-   # trigger validity checks
-   _python_impl_supported "${i}"
-   done
+   if [[ ! ${PYTHON_COMPAT_NO_STRICT} ]]; then
+   for i in "${PYTHON_COMPAT[@]}"; do
+   # check for incorrect implementations
+   # we're using pattern matching as an optimization
+   # please keep them in sync with _PYTHON_ALL_IMPLS
+   # and _PYTHON_HISTORICAL_IMPLS
+   case ${i} in
+   
jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9])
+   ;;
+   *)
+   if has "${i}" "${_PYTHON_ALL_IMPLS[@]}" 
\
+   "${_PYTHON_HISTORICAL_IMPLS[@]}"
+   then
+   die "Mis-synced patterns in 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-03-13 Thread Fabian Groffen
commit: 1cff42d8e2a83f810aba7f77eb3f5128d8074a4b
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Mar 13 09:52:32 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Mar 13 09:53:54 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=1cff42d8

java-utils-2.eclass: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/java-utils-2.eclass | 55 +-
 1 file changed, 49 insertions(+), 6 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index e8e8575eda..c4d980c607 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2018 Gentoo Authors
+# Copyright 2004-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: java-utils-2.eclass
@@ -28,6 +28,8 @@ export WANT_JAVA_CONFIG="2"
 # Prefix variables are only available for EAPI>=3
 has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
 
+has test ${JAVA_PKG_IUSE} && RESTRICT+=" !test? ( test )"
+
 # @VARIABLE: JAVA_PKG_E_DEPEND
 # @INTERNAL
 # @DESCRIPTION:
@@ -264,7 +266,7 @@ java-pkg_addres() {
 }
 
 # @FUNCTION: java-pkg_rm_files
-# @USAGE: java-pkg_rm_files File1.java File2.java ...
+# @USAGE:  [File2.java] ...
 # @DESCRIPTION:
 # Remove unneeded files in ${S}.
 #
@@ -416,7 +418,7 @@ java-pkg_regjar() {
#java-pkg_regjar ${ED}/opt/java/*.jar
# such call will fall into this case (-e ${jar}) and 
will
# record paths with ${D} in package.env
-   java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D%/}}"
+   java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
else
if [[ ${jar} = *\** ]]; then
eerror "The argument ${jar} to ${FUNCNAME}"
@@ -1863,6 +1865,44 @@ ejunit4() {
ejunit_ "junit-4" "${@}"
 }
 
+# @FUNCTION: etestng
+# @USAGE: etestng_ [-cp $classpath] 
+# @INTERNAL
+# @DESCRIPTION:
+# Testng wrapper function. Makes it easier to run the tests.
+# Launches the tests using org.testng.TestNG.
+#
+# @CODE
+# $1 - -cp or -classpath
+# $2 - the classpath passed to it
+# $@ - test classes for testng to run.
+# @CODE
+etestng() {
+   debug-print-function ${FUNCNAME} $*
+
+   local runner=org.testng.TestNG
+   local cp=$(java-pkg_getjars --with-dependencies testng)
+   local tests
+
+   if [[ ${1} = -cp || ${1} = -classpath ]]; then
+   cp="${cp}:${2}"
+   shift 2
+   else
+   cp="${cp}:."
+   fi
+
+   for test in ${@}; do
+   tests+="${test},"
+   done
+
+   debug-print "java -cp \"${cp}\" -Djava.io.tmpdir=\"${T}\""\
+   "-Djava.awt.headless=true ${runner}"\
+   "-usedefaultlisteners false -testclass ${tests}"
+   java -cp "${cp}" -Djava.io.tmpdir=\"${T}\" -Djava.awt.headless=true\
+   ${runner} -usedefaultlisteners false -testclass ${tests}\
+   || die "Running TestNG failed."
+}
+
 # @FUNCTION: java-utils-2_src_prepare
 # @DESCRIPTION:
 # src_prepare Searches for bundled jars
@@ -2737,10 +2777,13 @@ java-pkg_jar-list() {
 java-pkg_verify-classes() {
#$(find ${ED} -type f -name '*.jar' -o -name '*.class')
 
-   local version_verify="${EPREFIX}/usr/bin/class-version-verify.py"
+   local 
version_verify_1="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/class-version-verify.py"
+   local 
version_verify_2="${EPREFIX}/usr/libexec/javatoolkit/class-version-verify.py"
 
-   if [[ ! -x "${version_verify}" ]]; then
-   
version_verify="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/class-version-verify.py"
+   if [[ -x "${version_verify_1}" ]]; then
+   local version_verify=${version_verify_1}
+   else
+   local version_verify=${version_verify_2}
fi
 
if [[ ! -x "${version_verify}" ]]; then



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-02-07 Thread Fabian Groffen
commit: 6cc6d48909ec277399f170bf5bcbe56fe337f1ad
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Feb  7 19:22:13 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Feb  7 19:22:13 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6cc6d489

toolchain-funcs.eclass: forcefully disable softfloat for arm64-macos

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain-funcs.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index c2ac4a5d15..d591c9574e 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -229,7 +229,7 @@ tc-detect-is-softfloat() {
 
case ${CTARGET:-${CHOST}} in
# Avoid autodetection for bare-metal targets. bug #666896
-   *-newlib|*-elf|*-eabi)
+   *-newlib|*-elf|*-eabi|arm64-apple-darwin*)
return 1 ;;
 
# arm-unknown-linux-gnueabi is ambiguous. We used to treat it as



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-01-24 Thread Fabian Groffen
commit: 378beb67f9a4c08e2ad3ffdb0b62af01ceddcf06
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Jan 24 09:44:58 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Jan 24 09:44:58 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=378beb67

toolchain-funcs.eclass: drop long gone targets from ninj()

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain-funcs.eclass | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index a491b75522..e8541f25b2 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -629,26 +629,11 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
 
case ${host} in
powerpc-apple-darwin*)echo ppc-macos;;
-   powerpc64-apple-darwin*)  echo ppc64-macos;;
-   i?86-apple-darwin*)   echo x86-macos;;
x86_64-apple-darwin*) echo x64-macos;;
sparc-sun-solaris*)   echo sparc-solaris;;
sparcv9-sun-solaris*) echo sparc64-solaris;;
i?86-pc-solaris*) echo x86-solaris;;
x86_64-pc-solaris*)   echo x64-solaris;;
-   powerpc-ibm-aix*) echo ppc-aix;;
-   mips-sgi-irix*)   echo mips-irix;;
-   ia64w-hp-hpux*)   echo ia64w-hpux;;
-   ia64-hp-hpux*)echo ia64-hpux;;
-   hppa*64*-hp-hpux*)echo hppa64-hpux;;
-   hppa*-hp-hpux*)   echo hppa-hpux;;
-   i?86-pc-freebsd*) echo x86-freebsd;;
-   x86_64-pc-freebsd*)   echo x64-freebsd;;
-   powerpc-unknown-openbsd*) echo ppc-openbsd;;
-   i?86-pc-openbsd*) echo x86-openbsd;;
-   x86_64-pc-openbsd*)   echo x64-openbsd;;
-   i?86-pc-netbsd*)  echo x86-netbsd;;
-   i?86-pc-interix*) echo x86-interix;;
i?86-pc-winnt*)   echo x86-winnt;;
 
aarch64*)   echo arm64;;



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-01-14 Thread Fabian Groffen
commit: d689573d4e6f4a21922de047db82e8a716f6c633
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Jan 14 08:02:08 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Jan 14 08:02:08 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d689573d

eclass/toolchain.eclass: set DYLD_LIBRARY_PATH for Darwin9 libstdc++

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 13 +
 1 file changed, 13 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index e5d4dd6ca9..6e7411559a 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2080,6 +2080,19 @@ create_gcc_env_entry() {
GCC_SPECS="${gcc_specs_file}"
MULTIOSDIRS="${mosdirs}"
EOF
+
+   # crude hack, but necessary :(
+   # Darwin9's libstdc++ is incompatible with later GCC's libstdc++
+   # causing ugly malloc warnings about non-aligned pointers, but in
+   # cmake's case, also crashes, unfortunately.  See also:
+   #   https://trac.macports.org/ticket/59832
+   # our only way out here is to set DYLD_LIBRARY_PATH to replace the
+   # libstdc++ used by the Frameworks that cmake links in
+   if [[ ${CHOST} == *-darwin9 ]] ; then
+   cat <<-EOF >> ${gcc_envd_file}
+   DYLD_LIBRARY_PATH="${LIBPATH}"
+   EOF
+   fi
 }
 
 create_revdep_rebuild_entry() {



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-01-12 Thread Fabian Groffen
commit: 2b77d5b1db1d723f8ce576a58a0b2dd6a1ce9806
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Jan 12 13:32:35 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Jan 12 13:32:35 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=2b77d5b1

eclass/db: remove AIX stuff

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/db.eclass | 18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/eclass/db.eclass b/eclass/db.eclass
index df1e361e9b..96a857a196 100644
--- a/eclass/db.eclass
+++ b/eclass/db.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: db.eclass
@@ -29,22 +29,10 @@ db_fix_so() {
 
# now rebuild all the correct ones
local ext
-   for ext in so a dylib sl; do
+   for ext in so dylib a; do
for name in libdb libdb_{cxx,tcl,java,sql,stl}; do
target="$(find . -maxdepth 1 -type f -name 
"${name}-*.${ext}" |sort -V |tail -n 1)"
-   [[ -n "${target}" ]] || continue;
-   case ${CHOST} in 
-   *-aix*)
-   aixdll --merge-runtime \
-   --keepdir=false \
-   --target="${name}.${ext}" \
-   --current="${target}" \
-   `find . -maxdepth 1 -type f -name 
"${name}-*.${ext}"`
-   ;;
-   *)
-   ln -sf ${target//.\//} ${name}.${ext}
-   ;;
-   esac;
+   [[ -n "${target}" ]] && ln -sf ${target//.\//} 
${name}.${ext}
done;
done;
 



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2021-01-11 Thread Fabian Groffen
commit: a55104775503512dd6d735dd0132bd6f13735212
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Jan 11 19:53:40 2021 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Jan 11 19:53:40 2021 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=a5510477

eclass/db: fix incorrect db 3.2 handling

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/db.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/db.eclass b/eclass/db.eclass
index 8d905c9c4e..df1e361e9b 100644
--- a/eclass/db.eclass
+++ b/eclass/db.eclass
@@ -57,9 +57,9 @@ db_fix_so() {
# what do we do if we ever get 3.3 ?
local i
for i in libdb libdb_{cxx,tcl,java,sql,stl}; do
-   if [[ -f $i-3$(get_libname 2) ]]; then
-   ln -sf $i-3$(get_libname 2) $i-3$(get_libname)
-   ln -sf $i-3$(get_libname 2) $i$(get_libname 3)
+   if [[ -f $i-3.2$(get_libname) ]]; then
+   ln -sf $i-3.2$(get_libname) $i-3$(get_libname)
+   ln -sf $i-3.2$(get_libname) $i$(get_libname 3)
fi
done
 



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-12-14 Thread Fabian Groffen
commit: a788e4c0792d7b6cd70747d75c01da9cd97df54e
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Dec 15 07:47:24 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Dec 15 07:47:24 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=a788e4c0

eclass/db.eclass: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/db.eclass | 66 ++--
 1 file changed, 35 insertions(+), 31 deletions(-)

diff --git a/eclass/db.eclass b/eclass/db.eclass
index 7f80f13823..8d905c9c4e 100644
--- a/eclass/db.eclass
+++ b/eclass/db.eclass
@@ -20,18 +20,19 @@ db_fix_so() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
LIB="${EROOT}/usr/$(get_libdir)"
 
-   cd "${LIB}"
+   cd "${LIB}" || die
 
# first clean up old symlinks
-   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname)" 
-exec rm \{} \;
-   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname 
"[23]")" -exec rm \{} \;
-   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -exec rm \{} \;
+   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname)" 
-delete || die
+   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname 
"[23]")" -delete || die
+   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die
 
# now rebuild all the correct ones
+   local ext
for ext in so a dylib sl; do
for name in libdb libdb_{cxx,tcl,java,sql,stl}; do
-   target=`find . -maxdepth 1 -type f -name 
"${name}-*.${ext}" |sort -n |tail -n 1`
-   [ -n "${target}" ] || continue;
+   target="$(find . -maxdepth 1 -type f -name 
"${name}-*.${ext}" |sort -V |tail -n 1)"
+   [[ -n "${target}" ]] || continue;
case ${CHOST} in 
*-aix*)
aixdll --merge-runtime \
@@ -48,14 +49,15 @@ db_fix_so() {
done;
 
# db[23] gets some extra-special stuff
-   if [ -f libdb1$(get_libname 2) ]; then
+   if [[ -f libdb1$(get_libname 2) ]]; then
ln -sf libdb1$(get_libname 2) libdb$(get_libname 2)
ln -sf libdb1$(get_libname 2) libdb1$(get_libname)
ln -sf libdb1$(get_libname 2) libdb-1$(get_libname)
fi
# what do we do if we ever get 3.3 ?
+   local i
for i in libdb libdb_{cxx,tcl,java,sql,stl}; do
-   if [ -f $i-3$(get_libname 2) ]; then
+   if [[ -f $i-3$(get_libname 2) ]]; then
ln -sf $i-3$(get_libname 2) $i-3$(get_libname)
ln -sf $i-3$(get_libname 2) $i$(get_libname 3)
fi
@@ -64,15 +66,15 @@ db_fix_so() {
# do the same for headers now
# but since there are only two of them, just overwrite them
cd "${EROOT}"/usr/include
-   target=`find . -maxdepth 1 -type d -name 'db[0-9]*' | sort -n |cut -d/ 
-f2- | tail -n1`
-   if [ -n "${target}" ] && [ -e "${target}/db.h" ] && ( ! [[ -e db.h ]] 
|| [[ -h db.h ]] ); then
+   target="$(find . -maxdepth 1 -type d -name 'db[0-9]*' | sort -V |cut 
-d/ -f2- | tail -n1)"
+   if [[ -n "${target}" ]] && [[ -e "${target}/db.h" ]] && ( ! [[ -e db.h 
]] || [[ -h db.h ]] ); then
einfo "Creating db.h symlinks to ${target}"
ln -sf "${target}"/db.h .
ln -sf "${target}"/db_185.h .
-   elif [ ! -e "${target}/db.h" ]; then
-   if [ -n "${target}" ]; then
+   elif [[ ! -e "${target}/db.h" ]]; then
+   if [[ -n "${target}" ]]; then
ewarn "Could not find ${target}/db.h"
-   elif [ -h db.h ]; then
+   elif [[ -h db.h ]]; then
einfo "Apparently you just removed the last instance of 
$PN. Removing the symlinks"
rm -f db.h db_185.h
fi
@@ -84,7 +86,7 @@ db_src_install_doc() {
# not everybody wants this wad of documentation as it is primarily API 
docs
if use doc; then
dodir /usr/share/doc/${PF}/html
-   mv "${ED}"/usr/docs/* "${ED}"/usr/share/doc/${PF}/html/
+   mv "${ED}"/usr/docs/* "${ED}"/usr/share/doc/${PF}/html/ || die
rm -rf "${ED}"/usr/docs
else
rm -rf "${ED}"/usr/docs
@@ -96,16 +98,17 @@ db_src_install_doc() {
 db_src_install_examples() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
if use examples ; then
-   local langs="c cxx stl"
+   local langs=( c cxx stl )
[[ "${IUSE/java}" != "${IUSE}" ]] \
&& use java \
-   && langs="${langs} java"
-   for i in $langs ; do
+   && langs+=( java )
+   

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-11-29 Thread Fabian Groffen
commit: 10f753d0678eced907b182c0b15b1dde6901f676
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Nov 29 14:23:40 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Nov 29 14:23:40 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=10f753d0

eclass/toolchain: sync with gx86

this should in particular fix the dangling symlinks for the versioned
tooling variants and the numerous warnings about use_if_iuse

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 306 +++-
 1 file changed, 97 insertions(+), 209 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 293158b91e..e5d4dd6ca9 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -7,7 +7,7 @@
 DESCRIPTION="The GNU Compiler Collection"
 HOMEPAGE="https://gcc.gnu.org/;
 
-inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils 
toolchain-funcs prefix
+inherit eutils flag-o-matic gnuconfig libtool multilib pax-utils 
toolchain-funcs prefix
 
 tc_is_live() {
[[ ${PV} == ** ]]
@@ -102,11 +102,7 @@ fi
 
 PREFIX=${TOOLCHAIN_PREFIX:-${EPREFIX}/usr}
 
-if tc_version_is_at_least 3.4.0 ; then
-   
LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}}
-else
-   
LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc-lib/${CTARGET}/${GCC_CONFIG_VER}}
-fi
+LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}}
 INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${LIBPATH}/include}
 
 if is_crosscompile ; then
@@ -124,20 +120,7 @@ 
STDCXX_INCDIR=${TOOLCHAIN_STDCXX_INCDIR:-${LIBPATH}/include/g++-v${GCC_BRANCH_VE
 
 #>> LICENSE+SLOT+IUSE logic <<
 
-if tc_version_is_at_least 4.6 ; then
-   LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ 
gcc-runtime-library-exception-3.1 ) FDL-1.3+"
-elif tc_version_is_at_least 4.4 ; then
-   LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ 
gcc-runtime-library-exception-3.1 ) FDL-1.2+"
-elif tc_version_is_at_least 4.3 ; then
-   LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+"
-elif tc_version_is_at_least 4.2 ; then
-   LICENSE="GPL-3+ LGPL-2.1+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+"
-elif tc_version_is_at_least 3.3 ; then
-   LICENSE="GPL-2+ LGPL-2.1+ FDL-1.2+"
-else
-   LICENSE="GPL-2+ LGPL-2.1+ FDL-1.1+"
-fi
-
+LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ 
gcc-runtime-library-exception-3.1 ) FDL-1.3+"
 IUSE="test vanilla +nls"
 RESTRICT="!test? ( test )"
 
@@ -166,8 +149,6 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
fi
IUSE+=" debug +cxx +nptl" TC_FEATURES+=(nptl)
[[ -n ${PIE_VER} ]] && IUSE+=" nopie"
-   [[ -n ${HTB_VER} ]] && IUSE+=" boundschecking"
-   [[ -n ${D_VER}   ]] && IUSE+=" d"
[[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
# fortran support appeared in 4.1, but 4.1 needs outdated mpfr
tc_version_is_at_least 4.2 && IUSE+=" +fortran" TC_FEATURES+=(fortran)
@@ -176,7 +157,6 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
tc_version_is_at_least 3.3 && IUSE+=" pgo"
tc_version_is_at_least 4.0 &&
IUSE+=" objc-gc" TC_FEATURES+=(objc-gc)
-   tc_version_is_between 4.0 4.9 && IUSE+=" mudflap"
tc_version_is_at_least 4.1 && IUSE+=" libssp objc++"
tc_version_is_at_least 4.2 && IUSE+=" +openmp"
tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
@@ -203,6 +183,8 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
tc_version_is_at_least 9.0 && IUSE+=" d"
tc_version_is_at_least 9.1 && IUSE+=" lto"
tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=(zstd)
+   tc_version_is_at_least 11 && IUSE+=" valgrind" TC_FEATURES+=(valgrind)
+   tc_version_is_at_least 11 && IUSE+=" custom-cflags"
 fi
 
 if tc_version_is_at_least 10; then
@@ -275,10 +257,15 @@ if tc_has_feature zstd ; then
DEPEND+=" zstd? ( app-arch/zstd )"
 fi
 
+if tc_has_feature valgrind; then
+   BDEPEND+=" valgrind? ( dev-util/valgrind )"
+fi
+
 case ${EAPI:-0} in
5*|6) DEPEND+=" ${BDEPEND}" ;;
 esac
 
+# Prefix: our version is 1.9, so can't go with gx86's 2.3
 PDEPEND=">=sys-devel/gcc-config-1.7"
 
 #>> S + SRC_URI essentials <<
@@ -351,13 +338,6 @@ gentoo_urls() {
 #  The resulting filename of this tarball will be:
 #  
gcc-${SPECS_GCC_VER:-${GCC_RELEASE_VER}}-specs-${SPECS_VER}.tar.bz2
 #
-#  HTB_VER
-#  HTB_GCC_VER
-#  These variables control whether or not an ebuild 
supports Herman
-#  ten Brugge's bounds-checking patches. If you want to 
use a patch
-#  for an older gcc version with a new gcc, make sure you 
set
-#  HTB_GCC_VER to that version of gcc.
-#
 #  CYGWINPORTS_GITREV
 #  If set, this variable signals that we should apply 
additional 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-11-29 Thread Fabian Groffen
commit: 22340228f5dbbfcbb63f05b3b848616d6892f245
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Nov 29 13:41:04 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Nov 29 13:41:04 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=22340228

eclass/flag-o-matic: sync with gx86, bug #757258

Closes: https://bugs.gentoo.org/757258
Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/flag-o-matic.eclass | 129 ++---
 1 file changed, 99 insertions(+), 30 deletions(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 1a5d1e8099..f75a975a08 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: flag-o-matic.eclass
@@ -27,7 +27,14 @@ setup-allowed-flags() {
'-fstack-protector*' '-fsanitize*' '-fstack-check*' 
-fno-stack-check
-fbounds-check -fbounds-checking -fno-strict-overflow
-fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time
-   -g '-g[0-9]' -ggdb '-ggdb[0-9]' '-gdwarf-*' gstabs -gstabs+ -gz
+
+   # debugging symbols should generally be very safe to add
+   -g '-g[0-9]'
+   -ggdb '-ggdb[0-9]'
+   -gdwarf '-gdwarf-*'
+   -gstabs -gstabs+
+   -gz
+
-fno-ident -fpermissive -frecord-gcc-switches
'-fdiagnostics*' '-fplugin*'
'-W*' -w
@@ -56,7 +63,9 @@ setup-allowed-flags() {
-mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi
-mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel
-mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi
-   -mfix-r1 -mno-fix-r1 -mthumb -marm
+   -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400
+   -mfix-rm7000 -mno-fix-rm7000 -mfix-r1 -mno-fix-r1
+   -mr10k-cache-barrier -mthumb -marm
 
# gcc 4.5
-mno-fma4 -mno-movbe -mno-xop -mno-lwp
@@ -395,6 +404,7 @@ filter-mfpmath() {
 # Strip *FLAGS of everything except known good/safe flags.  This runs over all
 # flags returned by all_flag_vars().
 strip-flags() {
+   [[ $# -ne 0 ]] && die "strip-flags takes no arguments"
local x y var
 
local ALLOWED_FLAGS
@@ -436,25 +446,81 @@ test-flag-PROG() {
local lang=$2
shift 2
 
-   [[ -z ${comp} || -z $1 ]] && return 1
+   if [[ -z ${comp} ]]; then
+   return 1
+   fi
+   if [[ -z $1 ]]; then
+   return 1
+   fi
 
-   local src=${T}/tf-${comp}-${SECONDS}.${lang}
+   # verify selected compiler exists before using it
+   comp=($(tc-get${comp}))
+   # 'comp' can already contain compiler options.
+   # 'type' needs a binary name
+   if ! type -p ${comp[0]} >/dev/null; then
+   return 1
+   fi
+
+   # Set up test file.
+   local in_src in_ext cmdline_extra=()
+   case "${lang}" in
+   # compiler/assembler only
+   c)
+   in_ext='c'
+   in_src='int main(void) { return 0; }'
+   cmdline_extra+=(-xc -c)
+   ;;
+   c++)
+   in_ext='cc'
+   in_src='int main(void) { return 0; }'
+   cmdline_extra+=(-xc++ -c)
+   ;;
+   f77)
+   in_ext='f'
+   # fixed source form
+   in_src='  end'
+   cmdline_extra+=(-xf77 -c)
+   ;;
+   f95)
+   in_ext='f90'
+   in_src='end'
+   cmdline_extra+=(-xf95 -c)
+   ;;
+
+   # C compiler/assembler/linker
+   c+ld)
+   in_ext='c'
+   in_src='int main(void) { return 0; }'
+   cmdline_extra+=(-xc)
+   ;;
+   esac
+   local test_in=${T}/test-flag.${in_ext}
+   local test_out=${T}/test-flag.exe
+
+   printf "%s\n" "${in_src}" > "${test_in}" || die "Failed to create 
'${test_in}'"
+
+   # Currently we rely on warning-free output of a compiler
+   # before the flag to see if a flag prduces any warnings.
+   # This has a few drawbacks:
+   # - if compiler already generates warnings we filter out
+   #   every single flag: bug #712488
+   # - if user actually wants to see warnings we just strip
+   #   them regardless of warnings type.
+   #
+   # We can add more selective detection of no-op flags via
+   # '-Werror=ignored-optimization-argument' and 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-08-09 Thread Fabian Groffen
commit: fad409ec352330b9ad88e82dc67bca029c866531
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Aug  9 08:14:04 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Aug  9 08:14:04 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=fad409ec

eclass/python-utils-r1.eclass: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 36 +++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 0caece1344..1b1f6b4d4b 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -45,6 +45,18 @@ _PYTHON_ALL_IMPLS=(
 )
 readonly _PYTHON_ALL_IMPLS
 
+# @ECLASS-VARIABLE: _PYTHON_HISTORICAL_IMPLS
+# @INTERNAL
+# @DESCRIPTION:
+# All historical Python implementations that are no longer supported.
+_PYTHON_HISTORICAL_IMPLS=(
+   jython2_7
+   pypy pypy1_{8,9} pypy2_0
+   python2_{5,6}
+   python3_{1,2,3,4,5}
+)
+readonly _PYTHON_HISTORICAL_IMPLS
+
 # @ECLASS-VARIABLE: PYTHON_COMPAT_NO_STRICT
 # @INTERNAL
 # @DESCRIPTION:
@@ -89,6 +101,28 @@ _python_impl_supported() {
esac
 }
 
+# @FUNCTION: _python_verify_patterns
+# @USAGE: ...
+# @INTERNAL
+# @DESCRIPTION:
+# Verify whether the patterns passed to the eclass function are correct
+# (i.e. can match any valid implementation).  Dies on wrong pattern.
+_python_verify_patterns() {
+   debug-print-function ${FUNCNAME} "${@}"
+
+   local impl pattern
+   for pattern; do
+   [[ ${pattern} == -[23] ]] && continue
+
+   for impl in "${_PYTHON_ALL_IMPLS[@]}" 
"${_PYTHON_HISTORICAL_IMPLS[@]}"
+   do
+   [[ ${impl} == ${pattern/./_} ]] && continue 2
+   done
+
+   die "Invalid implementation pattern: ${pattern}"
+   done
+}
+
 # @FUNCTION: _python_set_impls
 # @INTERNAL
 # @DESCRIPTION:
@@ -1197,8 +1231,8 @@ python_fix_shebang() {
 
 # @FUNCTION: _python_check_locale_sanity
 # @USAGE: 
-# @INTERNAL
 # @RETURN: 0 if sane, 1 otherwise
+# @INTERNAL
 # @DESCRIPTION:
 # Check whether the specified locale sanely maps between lowercase
 # and uppercase ASCII characters.



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-06-22 Thread Fabian Groffen
commit: cf750927d63e81bed003dd2d4aab7ca34be12b1f
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Jun 22 18:27:51 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Jun 22 18:27:51 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=cf750927

eclass/toolchain: fix SDK Framework path on Darwin

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 744d68853f..293158b91e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -538,7 +538,7 @@ toolchain_src_prepare() {
"${S}"/gcc/config/darwin.h || die "sed gcc/config/darwin.h 
failed"
# add prefixed Frameworks to default search paths (may want to
# change this in a cross-compile)
-   sed -i -e "/\"\/System\/Library\/Frameworks\"\,/i\ \   
\"${EPREFIX}/MacOSX.sdk/Frameworks\"\, \"${EPREFIX}/Frameworks\"\, " \
+   sed -i -e "/\"\/System\/Library\/Frameworks\"\,/i\ \   
\"${EPREFIX}/MacOSX.sdk/System/Library/Frameworks\"\, 
\"${EPREFIX}/Frameworks\"\, " \
"${S}"/gcc/config/darwin-c.c || die "sed gcc/config/darwin-c.c 
failed"
 
# make sure the pkg config files install into multilib dirs.



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-06-22 Thread Fabian Groffen
commit: ca4ff31ddc211a1313d8868e04bed57d50c04c2f
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Jun 22 13:55:36 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Jun 22 13:55:36 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ca4ff31d

eclass/toolchain: sync with gx86 and add Darwin support

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain.eclass | 134 
 1 file changed, 68 insertions(+), 66 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 57c4177d70..744d68853f 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -14,7 +14,7 @@ tc_is_live() {
 }
 
 if tc_is_live ; then
-   EGIT_REPO_URI="git://gcc.gnu.org/git/gcc.git"
+   EGIT_REPO_URI="https://gcc.gnu.org/git/gcc.git;
# naming style:
# gcc-10.1.0_pre -> gcc-10-branch
#  Note that the micro version is required or lots of stuff will break.
@@ -158,7 +158,13 @@ tc_has_feature() {
 }
 
 if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
-   IUSE+=" altivec debug +cxx +nptl" TC_FEATURES+=(nptl)
+   # --enable-altivec was dropped before gcc-4. We don't set it.
+   # We drop USE=altivec for newer gccs only to avoid rebuilds
+   # for most stable users. Once gcc-10 is stable we can drop it.
+   if ! tc_version_is_at_least 10; then
+   IUSE+=" altivec"
+   fi
+   IUSE+=" debug +cxx +nptl" TC_FEATURES+=(nptl)
[[ -n ${PIE_VER} ]] && IUSE+=" nopie"
[[ -n ${HTB_VER} ]] && IUSE+=" boundschecking"
[[ -n ${D_VER}   ]] && IUSE+=" d"
@@ -175,8 +181,9 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
tc_version_is_at_least 4.2 && IUSE+=" +openmp"
tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
tc_version_is_at_least 4.7 && IUSE+=" go"
-   tc_version_is_at_least 4.8 &&
-   IUSE+=" +sanitize"
+   # sanitizer support appeared in gcc-4.8, but > pkg_pretend <<
 
-toolchain_is_unsupported() {
-   [[ -n ${SNAPSHOT} ]] || tc_is_live
-}
-
 toolchain_pkg_pretend() {
-   if toolchain_is_unsupported &&
-  [[ -z ${I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS} ]] ; then
-   die "Please \`export I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1\` 
or define it" \
-   "in your make.conf if you want to use this version."
-   fi
-
if ! use_if_iuse cxx ; then
use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled 
due to USE="-cxx"'
use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, 
disabled due to USE="-cxx"'
@@ -541,7 +538,7 @@ toolchain_src_prepare() {
"${S}"/gcc/config/darwin.h || die "sed gcc/config/darwin.h 
failed"
# add prefixed Frameworks to default search paths (may want to
# change this in a cross-compile)
-   sed -i -e "/\"\/System\/Library\/Frameworks\"\,/i\ \
\"${EPREFIX}/Frameworks\"\, " \
+   sed -i -e "/\"\/System\/Library\/Frameworks\"\,/i\ \   
\"${EPREFIX}/MacOSX.sdk/Frameworks\"\, \"${EPREFIX}/Frameworks\"\, " \
"${S}"/gcc/config/darwin-c.c || die "sed gcc/config/darwin-c.c 
failed"
 
# make sure the pkg config files install into multilib dirs.
@@ -666,9 +663,13 @@ do_gcc_CYGWINPORTS_patches() {
 
local p d="${WORKDIR}/gcc-${CYGWINPORTS_GITREV}"
# readarray -t is available since bash-4.4 only, #690686
-   local patches=( $(for p in $(
-   sed -e '1,/PATCH_URI="/d;/"/,$d' < "${d}"/gcc.cygport
-   ); do echo "${d}/${p}"; done) )
+   local patches=( $(
+   for p in $(
+   sed -e '1,/PATCH_URI="/d;/"/,$d' < "${d}"/gcc.cygport
+   ); do
+   echo "${d}/${p}"
+   done
+   ) )
tc_apply_patches "Applying cygwin port patches ..." ${patches[*]}
 }
 
@@ -924,8 +925,7 @@ toolchain_src_configure() {
is_f77 && GCC_LANG+=",f77"
is_f95 && GCC_LANG+=",f95"
 
-   # We do NOT want 'ADA support' in here!
-   # is_ada && GCC_LANG+=",ada"
+   is_ada && GCC_LANG+=",ada"
 
confgcc+=( --enable-languages=${GCC_LANG} )
 
@@ -1087,6 +1087,13 @@ toolchain_src_configure() {
# for, which is unrelated to TOOLCHAIN_PREFIX, a.k.a.
# PREFIX
confgcc+=( --with-local-prefix="${TPREFIX}/usr" )
+
+   # enable the CommandLine SDK, Apple no longer installs 
stuff
+   # into /usr
+   if [[ ${CTARGET} == *-darwin* && ${CTARGET##*-darwin} 
-gt 9 ]]
+   then
+   confgcc+=( 
--with-native-system-header-dir="${EPREFIX}/MacOSX.sdk/usr/include" )
+   fi
fi
fi
 
@@ -1132,9 +1139,6 @@ toolchain_src_configure() {
 
gcc-multilib-configure
 
-   # 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-05-26 Thread Fabian Groffen
commit: c9c2e1e4cd1cc1306c3ab8f533cea6bbccf90f94
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue May 26 06:43:45 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue May 26 06:43:45 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=c9c2e1e4

eclass/python-utils-r1: sync with gx86

this is mostly for python3_9 support

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 87f0821b68..0caece1344 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -41,7 +41,7 @@ inherit toolchain-funcs
 _PYTHON_ALL_IMPLS=(
pypy3
python2_7
-   python3_6 python3_7 python3_8
+   python3_6 python3_7 python3_8 python3_9
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -77,7 +77,7 @@ _python_impl_supported() {
# keep in sync with _PYTHON_ALL_IMPLS!
# (not using that list because inline patterns shall be faster)
case "${impl}" in
-   python2_7|python3_[678]|pypy3)
+   python2_7|python3_[6789]|pypy3)
return 0
;;
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[56]|python3_[12345])
@@ -361,10 +361,14 @@ _python_export() {
local val
 
case "${impl}" in
-   python*)
-   # python-2.7, python-3.2, etc.
+   python2*|python3.6|python3.7*)
+   # python* up to 3.7
val=$($(tc-getPKG_CONFIG) 
--libs ${impl/n/n-}) || die
;;
+   python*)
+   # python3.8+
+   val=$($(tc-getPKG_CONFIG) 
--libs ${impl/n/n-}-embed) || die
+   ;;
*)
die "${impl}: obtaining ${var} 
not supported"
;;
@@ -395,16 +399,12 @@ _python_export() {
case ${impl} in
python2.7)

PYTHON_PKG_DEP='>=dev-lang/python-2.7.5-r2:2.7';;
-   python3.3)
-   
PYTHON_PKG_DEP='>=dev-lang/python-3.3.2-r2:3.3';;
python*)

PYTHON_PKG_DEP="dev-lang/python:${impl#python}";;
pypy)
-   
PYTHON_PKG_DEP='>=dev-python/pypy-5:0=';;
+   
PYTHON_PKG_DEP='>=dev-python/pypy-7.3.0:0=';;
pypy3)
-   
PYTHON_PKG_DEP='>=dev-python/pypy3-5:0=';;
-   jython2.7)
-   
PYTHON_PKG_DEP='dev-java/jython:2.7';;
+   
PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.0:0=';;
*)
die "Invalid implementation: 
${impl}"
esac



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-03-26 Thread Fabian Groffen
commit: f7c81bea327aa909e26cca3519c157a5e4cb92e7
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Mar 26 07:55:34 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Mar 26 07:55:34 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f7c81bea

eclass/python-utils-r1: sync with x86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 173 +++---
 1 file changed, 45 insertions(+), 128 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 294efe6f66..87f0821b68 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -228,116 +228,24 @@ _python_impl_matches() {
 # python2.7
 # @CODE
 
-# @ECLASS-VARIABLE: PYTHON_SITEDIR
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The path to Python site-packages directory.
-#
-# Set and exported on request using python_export().
-# Requires a proper build-time dependency on the Python implementation.
-#
-# Example value:
-# @CODE
-# /usr/lib64/python2.7/site-packages
-# @CODE
-
-# @ECLASS-VARIABLE: PYTHON_INCLUDEDIR
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The path to Python include directory.
-#
-# Set and exported on request using python_export().
-# Requires a proper build-time dependency on the Python implementation.
-#
-# Example value:
-# @CODE
-# /usr/include/python2.7
-# @CODE
-
-# @ECLASS-VARIABLE: PYTHON_LIBPATH
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The path to Python library.
-#
-# Set and exported on request using python_export().
-# Valid only for CPython. Requires a proper build-time dependency
-# on the Python implementation.
-#
-# Example value:
-# @CODE
-# /usr/lib64/libpython2.7.so
-# @CODE
-
-# @ECLASS-VARIABLE: PYTHON_CFLAGS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Proper C compiler flags for building against Python. Obtained from
-# pkg-config or python-config.
-#
-# Set and exported on request using python_export().
-# Valid only for CPython. Requires a proper build-time dependency
-# on the Python implementation and on pkg-config.
-#
-# Example value:
-# @CODE
-# -I/usr/include/python2.7
-# @CODE
-
-# @ECLASS-VARIABLE: PYTHON_LIBS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Proper C compiler flags for linking against Python. Obtained from
-# pkg-config or python-config.
-#
-# Set and exported on request using python_export().
-# Valid only for CPython. Requires a proper build-time dependency
-# on the Python implementation and on pkg-config.
-#
-# Example value:
-# @CODE
-# -lpython2.7
-# @CODE
-
-# @ECLASS-VARIABLE: PYTHON_CONFIG
-# @DEFAULT_UNSET
+# @FUNCTION: python_export
+# @USAGE: [] ...
+# @INTERNAL
 # @DESCRIPTION:
-# Path to the python-config executable.
-#
-# Set and exported on request using python_export().
-# Valid only for CPython. Requires a proper build-time dependency
-# on the Python implementation and on pkg-config.
-#
-# Example value:
-# @CODE
-# /usr/bin/python2.7-config
-# @CODE
+# Backwards compatibility function.  The relevant API is now considered
+# private, please use python_get* instead.
+python_export() {
+   debug-print-function ${FUNCNAME} "${@}"
 
-# @ECLASS-VARIABLE: PYTHON_PKG_DEP
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The complete dependency on a particular Python package as a string.
-#
-# Set and exported on request using python_export().
-#
-# Example value:
-# @CODE
-# dev-lang/python:2.7[xml]
-# @CODE
+   eqawarn "python_export() is part of private eclass API."
+   eqawarn "Please call python_get*() instead."
 
-# @ECLASS-VARIABLE: PYTHON_SCRIPTDIR
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The location where Python scripts must be installed for current impl.
-#
-# Set and exported on request using python_export().
-#
-# Example value:
-# @CODE
-# /usr/lib/python-exec/python2.7
-# @CODE
+   _python_export "${@}"
+}
 
-# @FUNCTION: python_export
+# @FUNCTION: _python_export
 # @USAGE: [] ...
+# @INTERNAL
 # @DESCRIPTION:
 # Set and export the Python implementation-relevant variables passed
 # as parameters.
@@ -350,7 +258,7 @@ _python_impl_matches() {
 # The variables which can be exported are: PYTHON, EPYTHON,
 # PYTHON_SITEDIR. They are described more completely in the eclass
 # variable documentation.
-python_export() {
+_python_export() {
debug-print-function ${FUNCNAME} "${@}"
 
local impl var
@@ -367,7 +275,7 @@ python_export() {
*)
impl=${EPYTHON}
if [[ -z ${impl} ]]; then
-   die "python_export called without a python 
implementation and EPYTHON is unset"
+   die "_python_export called without a python 
implementation and EPYTHON is unset"
fi
;;
esac
@@ -523,7 +431,7 @@ python_export() {
debug-print "${FUNCNAME}: PYTHON_SCRIPTDIR = 
${PYTHON_SCRIPTDIR}"
;;
*)

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-03-22 Thread Fabian Groffen
commit: e8d7c88ec7af706a1b37c3c282cafd042b15aff3
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Mar 22 09:25:06 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Mar 22 09:25:06 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=e8d7c88e

eclass/python-utils-r1: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 88 +++
 1 file changed, 30 insertions(+), 58 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 7d1f577534..294efe6f66 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: python-utils-r1.eclass
@@ -7,7 +7,7 @@
 # @AUTHOR:
 # Author: Michał Górny 
 # Based on work of: Krzysztof Pawlik 
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Utility functions for packages with Python parts.
 # @DESCRIPTION:
 # A utility eclass providing functions to query Python implementations,
@@ -16,15 +16,13 @@
 # This eclass does not set any metadata variables nor export any phase
 # functions. It can be inherited safely.
 #
-# For more information, please see the wiki:
-# https://wiki.gentoo.org/wiki/Project:Python/python-utils-r1
+# For more information, please see the Python Guide:
+# https://dev.gentoo.org/~mgorny/python-guide/
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6|7)
-   ;;
-   *)
-   die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
-   ;;
+   [0-4]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
+   [5-7]) ;;
+   *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
 esac
 
 if [[ ${_PYTHON_ECLASS_INHERITED} ]]; then
@@ -33,7 +31,7 @@ fi
 
 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
 
-[[ ${EAPI:-0} == [012345] ]] && inherit eutils multilib
+[[ ${EAPI} == 5 ]] && inherit eutils multilib
 inherit toolchain-funcs
 
 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
@@ -41,10 +39,9 @@ inherit toolchain-funcs
 # @DESCRIPTION:
 # All supported Python implementations, most preferred last.
 _PYTHON_ALL_IMPLS=(
-   jython2_7
-   pypy pypy3
+   pypy3
python2_7
-   python3_5 python3_6 python3_7 python3_8
+   python3_6 python3_7 python3_8
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -80,17 +77,12 @@ _python_impl_supported() {
# keep in sync with _PYTHON_ALL_IMPLS!
# (not using that list because inline patterns shall be faster)
case "${impl}" in
-   python2_7|python3_[5678]|jython2_7)
+   python2_7|python3_[678]|pypy3)
return 0
;;
-   pypy1_[89]|pypy2_0|python2_[56]|python3_[1234])
+   jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[56]|python3_[12345])
return 1
;;
-   pypy|pypy3)
-   if [[ ${EAPI:-0} == [01234] ]]; then
-   die "PyPy is supported in EAPI 5 and newer 
only."
-   fi
-   ;;
*)
[[ ${PYTHON_COMPAT_NO_STRICT} ]] && return 1
die "Invalid implementation in PYTHON_COMPAT: ${impl}"
@@ -206,7 +198,7 @@ _python_impl_matches() {
 # This variable is set automatically in the following contexts:
 #
 # python-r1: Set in functions called by python_foreach_impl() or after
-# calling python_export_best().
+# calling python_setup().
 #
 # python-single-r1: Set after calling python-single-r1_pkg_setup().
 #
@@ -225,7 +217,7 @@ _python_impl_matches() {
 # This variable is set automatically in the following contexts:
 #
 # python-r1: Set in functions called by python_foreach_impl() or after
-# calling python_export_best().
+# calling python_setup().
 #
 # python-single-r1: Set after calling python-single-r1_pkg_setup().
 #
@@ -500,9 +492,9 @@ python_export() {
python*)

PYTHON_PKG_DEP="dev-lang/python:${impl#python}";;
pypy)
-   
PYTHON_PKG_DEP='>=virtual/pypy-5:0=';;
+   
PYTHON_PKG_DEP='>=dev-python/pypy-5:0=';;
pypy3)
-   
PYTHON_PKG_DEP='>=virtual/pypy3-5:0=';;
+   
PYTHON_PKG_DEP='>=dev-python/pypy3-5:0=';;
jython2.7)

PYTHON_PKG_DEP='dev-java/jython:2.7';;
*)
@@ -804,9 +796,6 @@ python_newexe() {
 
[[ ${EPYTHON} ]] || die 'No Python 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-03-16 Thread Michael Haubenwallner
commit: f3cec249275ed4e00f1a9b465f44012a90dc6aff
Author: Michael Haubenwallner  gentoo  org>
AuthorDate: Mon Mar 16 17:20:03 2020 +
Commit: Michael Haubenwallner  gentoo  org>
CommitDate: Mon Mar 16 17:23:16 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f3cec249

toolchain.eclass: fix applying cygwinports patches

This commit in gentoo repo broke it (after sync into overlay):

commit bd758f25a82460f6e7011314f9fb7923864e9e1e
Author: Sergei Trofimovich  gentoo.org>
Date:   Sat Oct 19 13:54:48 2019 +0100

toolchain.eclass: isolate 'epatch' into 'tc_apply_patches'

Signed-off-by: Michael Haubenwallner  gentoo.org>

 eclass/toolchain.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 89a522f9cf..57c4177d70 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -666,7 +666,9 @@ do_gcc_CYGWINPORTS_patches() {
 
local p d="${WORKDIR}/gcc-${CYGWINPORTS_GITREV}"
# readarray -t is available since bash-4.4 only, #690686
-   local patches=( $(sed -e '1,/PATCH_URI="/d;/"/,$d' < 
"${d}"/gcc.cygport) )
+   local patches=( $(for p in $(
+   sed -e '1,/PATCH_URI="/d;/"/,$d' < "${d}"/gcc.cygport
+   ); do echo "${d}/${p}"; done) )
tc_apply_patches "Applying cygwin port patches ..." ${patches[*]}
 }
 



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2020-03-13 Thread Fabian Groffen
commit: 5b99beb42d0df33eda54d61e712f310311b730dc
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Mar 13 07:51:01 2020 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Mar 13 07:51:01 2020 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5b99beb4

eclass/toolchain-*: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain-binutils.eclass | 504 -
 eclass/toolchain-funcs.eclass|  60 +++--
 eclass/toolchain.eclass  | 522 +++
 3 files changed, 292 insertions(+), 794 deletions(-)

diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass
deleted file mode 100644
index 6e3a60f357..00
--- a/eclass/toolchain-binutils.eclass
+++ /dev/null
@@ -1,504 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-#
-# Maintainer: Toolchain Ninjas 
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5
-#
-# We install binutils into CTARGET-VERSION specific directories.  This lets
-# us easily merge multiple versions for multiple targets (if we wish) and
-# then switch the versions on the fly (with `binutils-config`).
-#
-# binutils-   -> live git
-# binutils-_preYYMMDD -> nightly snapshot date YYMMDD
-# binutils-#  -> normal release
-
-if [[ -n ${BINUTILS_TYPE} ]] ; then
-   BTYPE=${BINUTILS_TYPE}
-else
-   case ${PV} in
-   _pre*) BTYPE="snap";;
-   *.*.90)BTYPE="snap";;
-   *.*.*.*.*) BTYPE="hjlu";;
-   *) BTYPE="rel";;
-   esac
-fi
-
-case ${BTYPE} in
-snap)
-   BVER=${PV/_pre}
-   ;;
-*)
-   BVER=${BINUTILS_VER:-${PV}}
-   ;;
-esac
-
-inherit eutils libtool flag-o-matic gnuconfig multilib versionator unpacker
-case ${EAPI:-0} in
-0|1)
-   EXPORT_FUNCTIONS src_unpack src_compile src_test src_install 
pkg_postinst pkg_postrm ;;
-2|3|4|5)
-   EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile 
src_test src_install pkg_postinst pkg_postrm ;;
-*) die "unsupported EAPI ${EAPI}" ;;
-esac
-
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
-   if [[ ${CATEGORY} == cross-* ]] ; then
-   export CTARGET=${CATEGORY#cross-}
-   fi
-fi
-is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-
-DESCRIPTION="Tools necessary to build programs"
-HOMEPAGE="https://sourceware.org/binutils/;
-
-case ${BTYPE} in
-   snap)
-   
SRC_URI="ftp://gcc.gnu.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2
-   
ftp://sourceware.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2; ;;
-   hjlu)
-   
SRC_URI="mirror://kernel/linux/devel/binutils/binutils-${BVER}.tar."
-   version_is_at_least 2.21.51.0.5 && SRC_URI+="xz" || 
SRC_URI+="bz2" ;;
-   rel) SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.bz2" ;;
-esac
-add_src_uri() {
-   [[ -z $2 ]] && return
-   local a=$1
-   if version_is_at_least 2.22.52.0.2 ; then
-   a+=".xz"
-   else
-   a+=".bz2"
-   fi
-   set -- mirror://gentoo https://dev.gentoo.org/~vapier/dist 
https://dev.gentoo.org/~tamiko/distfiles 
https://dev.gentoo.org/~dilfridge/distfiles
-   SRC_URI="${SRC_URI} ${@/%//${a}}"
-}
-PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${BVER}}
-add_src_uri binutils-${PATCH_BINUTILS_VER}-patches-${PATCHVER}.tar ${PATCHVER}
-add_src_uri 
binutils-${PATCH_BINUTILS_VER}-uclibc-patches-${UCLIBC_PATCHVER}.tar 
${UCLIBC_PATCHVER}
-add_src_uri elf2flt-${ELF2FLT_VER}.tar ${ELF2FLT_VER}
-
-if version_is_at_least 2.18 ; then
-   LICENSE="|| ( GPL-3 LGPL-3 )"
-else
-   LICENSE="|| ( GPL-2 LGPL-2 )"
-fi
-IUSE="cxx multitarget nls static-libs test vanilla"
-if version_is_at_least 2.19 && ! version_is_at_least 2.26 ; then
-   IUSE+=" zlib"
-fi
-SLOT="${BVER}"
-
-RDEPEND=">=sys-devel/binutils-config-3"
-if in_iuse zlib ; then
-   RDEPEND+=" zlib? ( sys-libs/zlib )"
-elif version_is_at_least 2.26 ; then
-   RDEPEND+=" sys-libs/zlib"
-fi
-DEPEND="${RDEPEND}
-   test? ( dev-util/dejagnu )
-   nls? ( sys-devel/gettext )
-   sys-devel/flex
-   virtual/yacc"
-if is_cross ; then
-   # The build assumes the host has libiberty and such when cross-compiling
-   # its build tools.  We should probably make binutils itself build a 
local
-   # copy to use, but until then, be lazy.
-   DEPEND+=" >=sys-libs/binutils-libs-${PV}"
-fi
-
-S=${WORKDIR}/binutils-${BVER}
-
-LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
-INCPATH=${LIBPATH}/include
-DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER}
-MY_BUILDDIR=${WORKDIR}/build
-if is_cross ; then
-   BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER}
-else
-   BINPATH=/usr/${CTARGET}/binutils-bin/${BVER}
-fi
-
-tc-binutils_unpack() {
-   unpacker ${A}
-   mkdir -p "${MY_BUILDDIR}"
-   [[ -d ${WORKDIR}/patch 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2019-12-11 Thread Fabian Groffen
commit: 8ae66dc29cd269a487cd96e293a6ed1315fa6f7a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Dec 11 09:47:15 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Dec 11 09:47:15 2019 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=8ae66dc2

eclass/python-utils-r1: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 36 +++-
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 2ea5bab356..7d1f577534 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -164,11 +164,12 @@ _python_set_impls() {
 }
 
 # @FUNCTION: _python_impl_matches
-# @USAGE:  ...
+# @USAGE:  [...]
 # @INTERNAL
 # @DESCRIPTION:
 # Check whether the specified  matches at least one
 # of the patterns following it. Return 0 if it does, 1 otherwise.
+# Matches if no patterns are provided.
 #
 #  can be in PYTHON_COMPAT or EPYTHON form. The patterns can be
 # either:
@@ -176,17 +177,17 @@ _python_set_impls() {
 # b) '-2' to indicate all Python 2 variants (= !python_is_python3)
 # c) '-3' to indicate all Python 3 variants (= python_is_python3)
 _python_impl_matches() {
-   [[ ${#} -ge 2 ]] || die "${FUNCNAME}: takes at least 2 parameters"
+   [[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter"
+   [[ ${#} -eq 1 ]] && return 0
 
local impl=${1} pattern
shift
 
for pattern; do
if [[ ${pattern} == -2 ]]; then
-   ! python_is_python3 "${impl}"
-   return
+   python_is_python3 "${impl}" || return 0
elif [[ ${pattern} == -3 ]]; then
-   python_is_python3 "${impl}"
+   python_is_python3 "${impl}" && return 0
return
# unify value style to allow lax matching
elif [[ ${impl/./_} == ${pattern/./_} ]]; then
@@ -1372,6 +1373,31 @@ python_export_utf8_locale() {
return 0
 }
 
+# @FUNCTION: build_sphinx
+# @USAGE: 
+# @DESCRIPTION:
+# Build HTML documentation using dev-python/sphinx in the specified
+# .  Takes care of disabling Intersphinx and appending
+# to HTML_DOCS.
+#
+# If  is relative to the current directory, care needs
+# to be taken to run einstalldocs from the same directory
+# (usually ${S}).
+build_sphinx() {
+   debug-print-function ${FUNCNAME} "${@}"
+   [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes 1 arg: "
+
+   local dir=${1}
+
+   sed -i -e 's:^intersphinx_mapping:disabled_&:' \
+   "${dir}"/conf.py || die
+   # not all packages include the Makefile in pypi tarball
+   sphinx-build -b html -d "${dir}"/_build/doctrees "${dir}" \
+   "${dir}"/_build/html || die
+
+   HTML_DOCS+=( "${dir}/_build/html/." )
+}
+
 # -- python.eclass functions --
 
 _python_check_dead_variables() {



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2019-11-13 Thread Fabian Groffen
commit: c9047396875b04faa35fc808554535b48c0cd482
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu Nov 14 06:35:51 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu Nov 14 06:35:51 2019 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=c9047396

eclass/python-utils-r1: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/python-utils-r1.eclass | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 859f4daf4a..2ea5bab356 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -44,7 +44,7 @@ _PYTHON_ALL_IMPLS=(
jython2_7
pypy pypy3
python2_7
-   python3_5 python3_6 python3_7
+   python3_5 python3_6 python3_7 python3_8
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -80,7 +80,7 @@ _python_impl_supported() {
# keep in sync with _PYTHON_ALL_IMPLS!
# (not using that list because inline patterns shall be faster)
case "${impl}" in
-   python2_7|python3_[567]|jython2_7)
+   python2_7|python3_[5678]|jython2_7)
return 0
;;
pypy1_[89]|pypy2_0|python2_[56]|python3_[1234])
@@ -720,7 +720,7 @@ python_optimize() {
if [[ ${f} == /* && -d ${D%/}${f} ]]; then
set -- "${D%/}${f}" "${@}"
fi
-   done < <("${PYTHON}" -c 'import sys; 
print("\0".join(sys.path))' || die)
+   done < <("${PYTHON}" -c 'import sys; print("".join(x + "\0" for 
x in sys.path))' || die)
 
debug-print "${FUNCNAME}: using sys.path: ${*/%/;}"
fi
@@ -1024,7 +1024,7 @@ python_wrapper_setup() {
rm -f "${workdir}"/bin/2to3 || die
rm -f "${workdir}"/pkgconfig/python{,2,3}.pc || die
 
-   local EPYTHON PYTHON PYTHON_CONFIG
+   local EPYTHON PYTHON
python_export "${impl}" EPYTHON PYTHON
 
local pyver pyother



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2019-05-30 Thread Fabian Groffen
commit: f5b4e670e0d7a5686f67b5bcfe4c323d6f4fe050
Author: Fabian Groffen  gentoo  org>
AuthorDate: Thu May 30 08:24:51 2019 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Thu May 30 08:24:51 2019 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f5b4e670

eclass: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/flag-o-matic.eclass|   7 ++
 eclass/java-utils-2.eclass|  17 ++--
 eclass/python-utils-r1.eclass |   6 +-
 eclass/toolchain-funcs.eclass |  11 +--
 eclass/toolchain.eclass   | 211 +-
 5 files changed, 172 insertions(+), 80 deletions(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index cdd63219de..1a5d1e8099 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -69,6 +69,13 @@ setup-allowed-flags() {
# gcc 4.9
-mno-avx512cd -mno-avx512er -mno-avx512f -mno-avx512pf -mno-sha
)
+
+   # Allow some safe individual flags. Should come along with the bug 
reference.
+   ALLOWED_FLAGS+=(
+   # Allow explicit stack realignment to run non-conformant
+   # binaries: bug #677852
+   -mstackrealign
+   )
 }
 
 # inverted filters for hardened compiler.  This is trying to unpick

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index da96e04c14..e8e8575eda 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2018 Gentoo Foundation
+# Copyright 2004-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: java-utils-2.eclass
@@ -15,7 +15,10 @@
 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
packages
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
-inherit eutils versionator multilib
+
+# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier 
eclasses.
+# Keep versionator inheritance in case consumers are using it implicitly.
+[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver eutils multilib versionator
 
 IUSE="elibc_FreeBSD"
 
@@ -1518,8 +1521,8 @@ java-pkg_is-vm-version-eq() {
 
local vm_version="$(java-pkg_get-vm-version)"
 
-   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
-   needed_version="$(get_version_component_range 1-2 "${needed_version}")"
+   vm_version="$(ver_cut 1-2 "${vm_version}")"
+   needed_version="$(ver_cut 1-2 "${needed_version}")"
 
if [[ -z "${vm_version}" ]]; then
debug-print "Could not get JDK version from DEPEND"
@@ -1570,7 +1573,7 @@ java-pkg_is-vm-version-ge() {
debug-print "Could not get JDK version from DEPEND"
return 1
else
-   if version_is_at_least "${needed_version}" "${vm_version}"; then
+   if ver_test "${vm_version}" -ge "${needed_version}"; then
debug-print "Detected a JDK(${vm_version}) >= 
${needed_version}"
return 0
else
@@ -2033,7 +2036,9 @@ eant() {
 
if [[ ${cp#:} ]]; then
# It seems ant does not like single quotes around ${cp}
-   antflags="${antflags} -Dgentoo.classpath=\"${cp#:}\""
+   # And ant 1.9.13+ also does not like double quotes around ${cp}
+   # https://bz.apache.org/bugzilla/show_bug.cgi?id=58898
+   antflags="${antflags} -Dgentoo.classpath=${cp#:}"
fi
 
[[ -n ${JAVA_PKG_DEBUG} ]] && echo ant ${antflags} "${@}"

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 6e9cab5360..859f4daf4a 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -44,7 +44,7 @@ _PYTHON_ALL_IMPLS=(
jython2_7
pypy pypy3
python2_7
-   python3_4 python3_5 python3_6 python3_7
+   python3_5 python3_6 python3_7
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -80,10 +80,10 @@ _python_impl_supported() {
# keep in sync with _PYTHON_ALL_IMPLS!
# (not using that list because inline patterns shall be faster)
case "${impl}" in
-   python2_7|python3_[4567]|jython2_7)
+   python2_7|python3_[567]|jython2_7)
return 0
;;
-   pypy1_[89]|pypy2_0|python2_[56]|python3_[123])
+   pypy1_[89]|pypy2_0|python2_[56]|python3_[1234])
return 1
;;
pypy|pypy3)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 392cf02e27..99aac55dea 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 2002-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2019-03-25 Thread Michael Haubenwallner
commit: 954efef84a53cdbd10393fd71a37bd9cc3286ac9
Author: Michael Haubenwallner  gentoo  org>
AuthorDate: Mon Mar 25 11:36:26 2019 +
Commit: Michael Haubenwallner  gentoo  org>
CommitDate: Mon Mar 25 12:01:32 2019 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=954efef8

python-utils-r1.eclass: support USE=prefix-stack

Need to support FEATURES=stacked-prefix for some transition period.
Better not test with 'use prefix-stack' but 'has prefix-stack ${USE}',
for when the user's profile does not set IUSE_IMPLICIT=prefix-stack yet.
Bug: https://bugs.gentoo.org/658572
Signed-off-by: Michael Haubenwallner  gentoo.org>

 eclass/python-utils-r1.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index d72329b30a..6e9cab5360 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -390,7 +390,7 @@ python_export() {
export PYTHON=${EPREFIX}/usr/bin/${impl}
if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
&& [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
-   && has stacked-prefix ${FEATURES}; then
+   && { has prefix-stack ${USE} || has 
stacked-prefix ${FEATURES} ;} ; then
# Need to look in build prefix
if [[ -x 
${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl} ]]; then

PYTHON=${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl}
@@ -402,7 +402,7 @@ python_export() {
export PYTHON_EPREFIX=${EPREFIX}
if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
&& [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
-   && has stacked-prefix ${FEATURES}; then
+   && { has prefix-stack ${USE} || has 
stacked-prefix ${FEATURES} ;} ; then
# Need to look in build prefix
if [[ -x 
${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl} ]]; then

PYTHON_EPREFIX=${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}
@@ -521,7 +521,7 @@ python_export() {
export 
PYTHON_SCRIPTDIR=${EPREFIX}/usr/lib/python-exec/${impl}
if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
&& [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
-   && has stacked-prefix ${FEATURES}; then
+   && { has prefix-stack ${USE} || has 
stacked-prefix ${FEATURES} ;} ; then
# Need to look in build prefix
if [[ -x 
${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl} ]]; then

PYTHON_SCRIPTDIR=${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/lib/python-exec/${impl}



[gentoo-commits] repo/proj/prefix:master commit in: eclass/, scripts/

2018-12-29 Thread Fabian Groffen
commit: 7bde6813090d05e2158b6eadca2f759e38630a07
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sat Dec 29 13:54:54 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sat Dec 29 13:54:54 2018 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7bde6813

PREFIX_DISABLE_GEN_USR_LDSCRIPT: remove

The migration path should long be no longer necessary, and the existance
of any non-migrated installs is disputable.  (None exist to the best of
knowledge of all consulted.)

Closes: https://bugs.gentoo.org/673324
Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/toolchain-funcs.eclass |  9 +---
 scripts/bootstrap-prefix.sh   | 48 ---
 2 files changed, 14 insertions(+), 43 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 7b82db8e40..392cf02e27 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -997,14 +997,7 @@ gen_usr_ldscript() {
[[ -z ${ED+set} ]] && local ED=${D%/}${EPREFIX}/
 
tc-is-static-only && return
-
-   # In Prefix we like to avoid people moving over, while we do want to get
-   # rid of this, like toolchain (see below).  We implement it differently,
-   # that is, we allow new bootstraps to disable this function, while 
existing
-   # installs just remain doing what they did to avoid breakage.  Due to 
this,
-   # the case below is modified and emptied, because for known Prefix 
targets
-   # we keep on using gen_usr_ldscript.
-   [[ -n ${PREFIX_DISABLE_GEN_USR_LDSCRIPT} ]] && return
+   use prefix && return
 
# We only care about stuffing / for the native ABI. #479448
if [[ $(type -t multilib_is_native_abi) == "function" ]] ; then

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index f79751b135..ea6bc9313f 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -339,11 +339,6 @@ bootstrap_setup() {
echo "# sandbox does not work well on Prefix, 
bug 490246"
echo 'FEATURES="${FEATURES} -usersandbox 
-sandbox"'
fi
-   if [[ !is-rap && -n ${PREFIX_DISABLE_USR_SPLIT} ]] ; 
then
-   echo
-   echo "# This disables /usr-split, removing this 
will break"
-   echo "PREFIX_DISABLE_GEN_USR_LDSCRIPT=yes"
-   fi
if [[ ${FS_INSENSITIVE} == 1 ]] ; then
echo
echo "# Avoid problems due to 
case-insensitivity, bug #524236"
@@ -508,22 +503,14 @@ do_tree() {
do
[[ -d ${ROOT}/${x} ]] || mkdir -p "${ROOT}/${x}"
done
-   if [[ ${PREFIX_DISABLE_USR_SPLIT} == "yes" ]] ; then
-   # note to self: since coreutils now listens to
-   # PREFIX_DISABLE_GEN_USR_LDSCRIPT to avoid symlinks
-   # from usr/bin to bin, we can make bin a symlink as well
-   # This is necessary for Cygwin, as there is no such thing
-   # like an embedded runpath. Instead we put all the dlls
-   # next to the exes, to get them working even without the
-   # PATH environment variable being set up.
-   for x in lib sbin bin; do
-   [[ -e ${ROOT}/${x} ]] || ( cd "${ROOT}" && ln -s 
usr/${x} )
-   done
-   else
-   for x in $(rapx "" lib) sbin ; do
-   [[ -d ${ROOT}/${x} ]] || mkdir -p "${ROOT}/${x}"
-   done
-   fi
+   # We can make bin a symlink because /usr is never split, this is
+   # necessary for Cygwin, as there is no such thing like an
+   # embedded runpath. Instead we put all the dlls next to the
+   # exes, to get them working even without the PATH environment
+   # variable being set up.
+   for x in lib sbin bin; do
+   [[ -e ${ROOT}/${x} ]] || ( cd "${ROOT}" && ln -s usr/${x} )
+   done
mkdir -p "${PORTDIR}"
if [[ ! -e ${PORTDIR}/.unpacked ]]; then
efetch "$1/$2" || return 1
@@ -1263,13 +1250,11 @@ bootstrap_stage1() {
# whatever the native toolchain is here, is what in general works
# best.
 
-   if [[ ${PREFIX_DISABLE_USR_SPLIT} == "yes" ]] ; then
-   # See comments in do_tree().
-   for x in lib sbin bin; do
-   mkdir -p "${ROOT}"/tmp/usr/${x}
-   [[ -e ${ROOT}/tmp/${x} ]] || ( cd "${ROOT}"/tmp && ln 
-s usr/${x} )
-   done
-   fi
+   # See comments in do_tree().
+   for x in lib sbin bin; do
+   mkdir -p "${ROOT}"/tmp/usr/${x}
+   [[ -e ${ROOT}/tmp/${x} ]] || ( cd "${ROOT}"/tmp && ln -s 
usr/${x} )
+   done
 
configure_toolchain
export CC CXX
@@ 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2018-12-17 Thread Fabian Groffen
commit: d6ffd48fbde60f371dd8b763b9ab9a4beecf282a
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Dec 17 09:55:25 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Dec 17 09:55:25 2018 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d6ffd48f

eclass: sync with gx86

Signed-off-by: Fabian Groffen  gentoo.org>

 eclass/autotools.eclass  |  11 +-
 eclass/flag-o-matic.eclass   |   8 +-
 eclass/gnuconfig.eclass  |  99 -
 eclass/java-utils-2.eclass   |  23 +-
 eclass/python-utils-r1.eclass|   1 +
 eclass/toolchain-binutils.eclass |  19 +-
 eclass/toolchain-funcs.eclass| 145 
 eclass/user.eclass   | 469 ---
 8 files changed, 127 insertions(+), 648 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index f30ac7414f..5a59c8d2d5 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -4,6 +4,7 @@
 # @ECLASS: autotools.eclass
 # @MAINTAINER:
 # base-sys...@gentoo.org
+# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
 # @BLURB: Regenerates auto* build scripts
 # @DESCRIPTION:
 # This eclass is for safely handling autotooled software packages that need to
@@ -25,6 +26,11 @@ fi
 if [[ -z ${_AUTOTOOLS_ECLASS} ]]; then
 _AUTOTOOLS_ECLASS=1
 
+case ${EAPI:-0} in
+   0|1|2|3|4|5|6|7) ;;
+   *) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
+esac
+
 inherit libtool
 
 # @ECLASS-VARIABLE: WANT_AUTOCONF
@@ -118,7 +124,10 @@ RDEPEND=""
 # their own DEPEND string.
 : ${AUTOTOOLS_AUTO_DEPEND:=yes}
 if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then
-   DEPEND=${AUTOTOOLS_DEPEND}
+   case ${EAPI:-0} in
+   0|1|2|3|4|5|6) DEPEND=${AUTOTOOLS_DEPEND} ;;
+   7) BDEPEND=${AUTOTOOLS_DEPEND} ;;
+   esac
 fi
 __AUTOTOOLS_AUTO_DEPEND=${AUTOTOOLS_AUTO_DEPEND} # See top of eclass
 

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 3f9fd205c4..cdd63219de 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -34,6 +34,9 @@ setup-allowed-flags() {
 
# CPPFLAGS and LDFLAGS
'-[DUILR]*' '-Wl,*'
+
+   # Linker choice flag
+   '-fuse-ld'
)
 
# allow a bunch of flags that negate features / control ABI
@@ -595,11 +598,6 @@ get-flag() {
return 1
 }
 
-# @FUNCTION: has_m64
-# @DESCRIPTION:
-# This doesn't test if the flag is accepted, it tests if the flag actually
-# WORKS. Non-multilib gcc will take both -m32 and -m64. If the flag works
-# return code is 0, else the return code is 1.
 has_m64() {
die "${FUNCNAME}: don't use this anymore"
 }

diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass
deleted file mode 100644
index 3c8d98d6a9..00
--- a/eclass/gnuconfig.eclass
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-#
-# THIS ECLASS IS DEAD: It has been integrated into portage
-#
-# Author: Will Woods 
-#
-# This eclass is used to automatically update files that typically come with
-# automake to the newest version available on the system. The most common use
-# of this is to update config.guess and config.sub when configure dies from
-# misguessing your canonical system name (CHOST). It can also be used to update
-# other files that come with automake, e.g. depcomp, mkinstalldirs, etc.
-#
-# usage: gnuconfig_update [file1 file2 ...]
-# if called without arguments, config.guess and config.sub will be updated.
-# All files in the source tree ($S) with the given name(s) will be replaced
-# with the newest available versions chosen from the list of locations in
-# gnuconfig_findnewest(), below.
-#
-# gnuconfig_update should generally be called from src_unpack()
-
-
-DEPEND="sys-devel/gnuconfig"
-
-# Wrapper function for gnuconfig_do_update. If no arguments are given, update
-# config.sub and config.guess (old default behavior), otherwise update the
-# named files.
-gnuconfig_update() {
-
-# hmm some packages (like binutils gcc glibc) still use this ...
-#  echo
-#  ewarn "QA Notice: Please stop using me, portage updates files for you."
-#  echo
-
-   local startdir  # declared here ... used in gnuconfig_do_update
-
-   if [[ $1 == /* ]] ; then
-   startdir=$1
-   shift
-   else
-   startdir=${S}
-   fi
-
-   if [[ $# -gt 0 ]] ; then
-   gnuconfig_do_update "$@"
-   else
-   gnuconfig_do_update config.sub config.guess
-   fi
-
-   return $?
-}
-
-# Copy the newest available version of specified files over any old ones in the
-# source dir. This function shouldn't be called directly - use gnuconfig_update
-#
-# Note that since bash using dynamic scoping, startdir is available here from
-# the gnuconfig_update function
-gnuconfig_do_update() {
-   local configsubs_dir target targetlist 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2018-07-17 Thread Fabian Groffen
commit: d0a61b2661153267fb43637a745f1ba0a104cb60
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Jul 17 08:45:27 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Jul 17 08:45:27 2018 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d0a61b26

eclass/python-utils-r1: sync for PYTHON_TARGETS=python3_7

 eclass/python-utils-r1.eclass | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 6a70453cbe..ebcced39bf 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -43,7 +43,7 @@ _PYTHON_ALL_IMPLS=(
jython2_7
pypy pypy3
python2_7
-   python3_4 python3_5 python3_6
+   python3_4 python3_5 python3_6 python3_7
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -79,7 +79,7 @@ _python_impl_supported() {
# keep in sync with _PYTHON_ALL_IMPLS!
# (not using that list because inline patterns shall be faster)
case "${impl}" in
-   python2_7|python3_[456]|jython2_7)
+   python2_7|python3_[4567]|jython2_7)
return 0
;;
pypy1_[89]|pypy2_0|python2_[56]|python3_[123])
@@ -817,6 +817,7 @@ python_newexe() {
 
(
dodir "${wrapd}"
+   exeopts -m 0755
exeinto "${d}"
newexe "${f}" "${newfn}" || return ${?}
)
@@ -948,6 +949,7 @@ python_domodule() {
fi
 
(
+   insopts -m 0644
insinto "${d}"
doins -r "${@}" || return ${?}
)
@@ -982,6 +984,7 @@ python_doheader() {
d=${PYTHON_INCLUDEDIR#${PYTHON_EPREFIX:-${EPREFIX}}}
 
(
+   insopts -m 0644
insinto "${d}"
doins -r "${@}" || return ${?}
)



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2018-07-03 Thread Michael Haubenwallner
commit: 96b0650dfe6ec38d1c02541d20b0adaf492032d9
Author: Michael Haubenwallner  gentoo  org>
AuthorDate: Tue Jul  3 08:49:01 2018 +
Commit: Michael Haubenwallner  gentoo  org>
CommitDate: Tue Jul  3 08:49:01 2018 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=96b0650d

python-utils-r1.eclass: switch to stacked-prefix feature

USE=prefix-chain now is FEATURES=stacked-prefix
Bug: https://bugs.gentoo.org/658572

 eclass/python-utils-r1.eclass | 54 +++
 1 file changed, 18 insertions(+), 36 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index ed84c2680c..6a70453cbe 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -388,36 +388,24 @@ python_export() {
PYTHON)
export PYTHON=${EPREFIX}/usr/bin/${impl}
if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
-   && [[ ! -x ${PYTHON} ]] \
-   && use prefix-chain; then
-   # Need to search in parent prefixes
-   local parent
-   local parents=()
-   IFS=: eval 
'parents=(${PORTAGE_READONLY_EPREFIXES})'
-   for parent in "${parents[@]}"; do
-   if [[ -x 
${parent}/usr/bin/${impl} ]]; then
-   
PYTHON=${parent}/usr/bin/${impl}
-   break
-   fi
-   done
+   && [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
+   && has stacked-prefix ${FEATURES}; then
+   # Need to look in build prefix
+   if [[ -x 
${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl} ]]; then
+   
PYTHON=${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl}
+   fi
fi
debug-print "${FUNCNAME}: PYTHON = ${PYTHON}"
;;
PYTHON_EPREFIX)
export PYTHON_EPREFIX=${EPREFIX}
if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
-   && [[ ! -x ${PYTHON_EPREFIX}/usr/bin/${impl} ]] 
\
-   && use prefix-chain; then
-   # Need to search in parent prefixes
-   local parent
-   local parents=()
-   IFS=: eval 
'parents=(${PORTAGE_READONLY_EPREFIXES})'
-   for parent in "${parents[@]}"; do
-   if [[ -x 
${parent}/usr/bin/${impl} ]]; then
-   PYTHON_EPREFIX=${parent}
-   break
-   fi
-   done
+   && [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
+   && has stacked-prefix ${FEATURES}; then
+   # Need to look in build prefix
+   if [[ -x 
${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl} ]]; then
+   
PYTHON_EPREFIX=${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}
+   fi
fi
debug-print "${FUNCNAME}: PYTHON_EPREFIX = 
${PYTHON_EPREFIX}"
;;
@@ -531,18 +519,12 @@ python_export() {
local dir
export 
PYTHON_SCRIPTDIR=${EPREFIX}/usr/lib/python-exec/${impl}
if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
-   && [[ ! -d ${PYTHON_SCRIPTDIR} ]] \
-   && use prefix-chain; then
-   # Need to search in parent prefixes
-   local parent
-   local parents=()
-   IFS=: eval 
'parents=(${PORTAGE_READONLY_EPREFIXES})'
-   for parent in "${parents[@]}"; do
-   if [[ -e 
${parent}/usr/lib/python-exec/${impl} ]]; then
- 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2018-06-22 Thread Michael Haubenwallner
commit: 6f2711db74877064b9be3c3ef6b515f720c2
Author: Michael Haubenwallner  gentoo  org>
AuthorDate: Fri Jun 22 13:14:01 2018 +
Commit: Michael Haubenwallner  gentoo  org>
CommitDate: Fri Jun 22 13:14:01 2018 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6f2711db

toolchain.eclass: support EAPI 7 paths, update cygwin patching

 eclass/toolchain.eclass | 58 -
 1 file changed, 33 insertions(+), 25 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 097cf772ed..560fe96139 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -312,6 +312,14 @@ gentoo_urls() {
 #  ten Brugge's bounds-checking patches. If you want to 
use a patch
 #  for an older gcc version with a new gcc, make sure you 
set
 #  HTB_GCC_VER to that version of gcc.
+#
+#  CYGWINPORTS_GITREV
+#  If set, this variable signals that we should apply 
additional patches
+#  maintained by upstream Cygwin developers at 
github/cygwinports/gcc,
+#  using the specified git commit id there.  The list of 
patches to
+#  apply is extracted from gcc.cygport, maintained there 
as well.
+#  This is done for compilers running on Cygwin, not for 
cross compilers
+#  with a Cygwin target.
 get_gcc_src_uri() {
export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}}
export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}}
@@ -380,7 +388,8 @@ get_gcc_src_uri() {
 
# Cygwin patches from https://github.com/cygwinports/gcc
[[ -n ${CYGWINPORTS_GITREV} ]] && \
-   GCC_SRC_URI+=" elibc_Cygwin? ( 
https://github.com/cygwinports/gcc/archive/${CYGWINPORTS_GITREV}.zip )"
+   GCC_SRC_URI+=" elibc_Cygwin? ( 
https://github.com/cygwinports/gcc/archive/${CYGWINPORTS_GITREV}.tar.gz
+   -> gcc-cygwinports-${CYGWINPORTS_GITREV}.tar.gz )"
 
echo "${GCC_SRC_URI}"
 }
@@ -497,7 +506,7 @@ gcc_quick_unpack() {
 
use_if_iuse boundschecking && unpack 
"bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2"
 
-   [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin && unpack 
"${CYGWINPORTS_GITREV}.zip"
+   [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin && unpack 
"gcc-cygwinports-${CYGWINPORTS_GITREV}.tar.gz"
 
popd > /dev/null
 }
@@ -682,11 +691,10 @@ do_gcc_CYGWINPORTS_patches() {
[[ -n ${CYGWINPORTS_GITREV} ]] || return 0
use elibc_Cygwin || return 0
 
+   local -a patches
local p d="${WORKDIR}/gcc-${CYGWINPORTS_GITREV}"
-   for p in $(
-   eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/gcc.cygport)"
-   echo ${PATCH_URI}
-   ); do
+   readarray -t patches < <(sed -e '1,/PATCH_URI="/d;/"/,$d' < 
"${d}"/gcc.cygport)
+   for p in ${patches[*]}; do
epatch "${d}/${p}"
done
 }
@@ -1864,13 +1872,13 @@ toolchain_src_install() {
 
cd "${S}"
if is_crosscompile; then
-   rm -rf "${ED}"usr/share/{man,info}
+   rm -rf "${ED}"/usr/share/{man,info}
rm -rf "${D}"${DATAPATH}/{man,info}
else
if tc_version_is_at_least 3.0 ; then
local cxx_mandir=$(find 
"${WORKDIR}/build/${CTARGET}/libstdc++-v3" -name man)
if [[ -d ${cxx_mandir} ]] ; then
-   cp -r "${cxx_mandir}"/man? 
"${D}/${DATAPATH}"/man/
+   cp -r "${cxx_mandir}"/man? 
"${D}${DATAPATH}"/man/
fi
fi
has noinfo ${FEATURES} \
@@ -1921,7 +1929,7 @@ toolchain_src_install() {
# libvtv.la: gcc itself handles linkage correctly.
# lib*san.la: Sanitizer linkage is handled internally by gcc, and they
# do not support static linking. #487550 #546700
-   find "${D}/${LIBPATH}" \
+   find "${D}${LIBPATH}" \
'(' \
-name libstdc++.la -o \
-name libstdc++fs.la -o \
@@ -1943,7 +1951,7 @@ toolchain_src_install() {
# Use gid of 0 because some stupid ports don't have
# the group 'root' set to gid 0.  Send to /dev/null
# for people who are testing as non-root.
-   chown -R ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} 
"${ED}"${LIBPATH} 2>/dev/null
+   chown -R ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${D}${LIBPATH}" 
2>/dev/null
 
# Move pretty-printers to gdb datadir to shut ldconfig up
local py 
gdbdir=/usr/share/gdb/auto-load${LIBPATH/\/lib\//\/$(get_libdir)\/}
@@ -1987,7 +1995,7 @@ gcc_movelibs() {
# code to run on the target.
if tc_version_is_at_least 5 && is_crosscompile ; then
dodir "${HOSTLIBPATH#${EPREFIX}}"
-   

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2018-06-20 Thread Fabian Groffen
commit: d3e19786b5813d6ce3d3ee80ca4a8163054d97af
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Jun 20 07:30:33 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Jun 20 07:30:33 2018 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d3e19786

eclass/toolchain: stop adding EPREFIX/Frameworks to searchpath on Darwin

The path isn't used at all, and compilation with gcc-7 yields lots of
warnings by default about the dir not existing.  In combination with
-Werror (like gcc build process does) this results in a failure.

 eclass/toolchain.eclass | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 4235583495..097cf772ed 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -543,8 +543,14 @@ toolchain_src_prepare() {
"${S}"/gcc/config/darwin.h || die "sed gcc/config/darwin.h 
failed"
# add prefixed Frameworks to default search paths (may want to
# change this in a cross-compile)
-   sed -i -e "/\"\/System\/Library\/Frameworks\"\,/i\ \
\"${EPREFIX}/Frameworks\"\, " \
-   "${S}"/gcc/config/darwin-c.c || die "sed gcc/config/darwin-c.c 
failed"
+   # 2018-06-20 (grobian): disabled this because
+   #   1. no packages seem to use this
+   #   2. absence of this dir causes
+   #  warnings->errors with gcc-7
+   #   3. after 2. would need to create the dir
+   #  somewhere, but 1. still applies
+   #sed -i -e "/\"\/System\/Library\/Frameworks\"\,/i\ \
\"${EPREFIX}/Frameworks\"\, " \
+   #   "${S}"/gcc/config/darwin-c.c || die "sed gcc/config/darwin-c.c 
failed"
 
# make sure the pkg config files install into multilib dirs.
# since we configure with just one --libdir, we can't use that



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2018-06-06 Thread Fabian Groffen
commit: a0a7ca1dc65b9d19def3e3c5f7010540449c9dd5
Author: Fabian Groffen  gentoo  org>
AuthorDate: Wed Jun  6 12:48:14 2018 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Wed Jun  6 12:48:14 2018 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=a0a7ca1d

eclass: sync with gx86

 eclass/autotools.eclass  |  34 +---
 eclass/db.eclass |  29 +++
 eclass/flag-o-matic.eclass   |  83 ++-
 eclass/gnuconfig.eclass  |   1 -
 eclass/python-utils-r1.eclass|  49 +++
 eclass/toolchain-binutils.eclass |  12 +--
 eclass/toolchain-funcs.eclass|  62 ++
 eclass/toolchain.eclass  | 174 ---
 eclass/user.eclass   |  31 ++-
 9 files changed, 279 insertions(+), 196 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index b6efa541de..f30ac7414f 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @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:  :
-_LATEST_AUTOMAKE=( 1.15:1.15 )
+_LATEST_AUTOMAKE=( 1.16.1:1.16 1.15.1:1.15 )
 
 _automake_atom="sys-devel/automake"
 _autoconf_atom="sys-devel/autoconf"
@@ -110,7 +114,7 @@ RDEPEND=""
 # @ECLASS-VARIABLE: AUTOTOOLS_AUTO_DEPEND
 # @DESCRIPTION:
 # Set to 'no' to disable automatically adding to DEPEND.  This lets
-# ebuilds former conditional depends by using ${AUTOTOOLS_DEPEND} in
+# ebuilds form conditional depends by using ${AUTOTOOLS_DEPEND} in
 # their own DEPEND string.
 : ${AUTOTOOLS_AUTO_DEPEND:=yes}
 if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then
@@ -433,7 +437,7 @@ config_rpath_update() {
 # @DESCRIPTION:
 # Process the WANT_AUTO{CONF,MAKE} flags.
 autotools_env_setup() {
-   # We do the "latest" → version switch here because it solves
+   # We do the "latest" → version switch here because it solves
# possible order problems, see bug #270010 as an example.
# During bootstrap in prefix there might be no automake merged yet
# due to --nodeps, but still available somewhere in PATH.
@@ -442,9 +446,17 @@ autotools_env_setup() {
ROOT=/ has_version "sys-devel/automake"; then
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}"
+   # Break on first hit to respect _LATEST_AUTOMAKE order.
+   local hv_args=""
+   case ${EAPI:-0} in
+   5|6)
+   hv_args="--host-root"
+   ;;
+   7)
+   hv_args="-b"
+   ;;
+   esac
+   ROOT=/ has_version ${hv_args} 
"=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/eclass/db.eclass b/eclass/db.eclass
index 8973031ba9..7f80f13823 100644
--- a/eclass/db.eclass
+++ b/eclass/db.eclass
@@ -1,11 +1,12 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/db.eclass,v 1.49 2013/07/21 09:23:45 
pacho Exp $
-# This is a common location for functions used in the sys-libs/db ebuilds
-#
-# Bugs: maintainer-nee...@gentoo.org
 
-inherit eutils 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2017-12-12 Thread Fabian Groffen
commit: 64e9b736c728fc62da48ea290441e0048f515dad
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Dec 12 18:44:27 2017 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Dec 12 18:44:27 2017 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=64e9b736

eclass: sync toolchain-funcs.eclass by hsk17, bug #639882

 eclass/toolchain-funcs.eclass | 69 ++-
 1 file changed, 68 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index bf70ab979e..d9450c3584 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -602,7 +602,7 @@ tc-endian() {
case ${host} in
aarch64*be) echo big;;
aarch64)echo little;;
-   alpha*) echo big;;
+   alpha*) echo little;;
arm*b*) echo big;;
arm*)   echo little;;
cris*)  echo little;;
@@ -822,6 +822,73 @@ gcc-specs-stack-check() {
 }
 
 
+# @FUNCTION: tc-enables-pie
+# @RETURN: Truth if the current compiler generates position-independent code 
(PIC) which can be linked into executables
+# @DESCRIPTION:
+# Return truth if the current compiler generates position-independent code 
(PIC)
+# which can be linked into executables.
+tc-enables-pie() {
+   local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> 
/dev/null | grep '^true$'
+   #if defined(__PIE__)
+   true
+   #endif
+   EOF
+   )"
+   [[ ${ret} == true ]]
+}
+
+# @FUNCTION: tc-enables-ssp
+# @RETURN: Truth if the current compiler enables stack smashing protection 
(SSP) on at least minimal level
+# @DESCRIPTION:
+# Return truth if the current compiler enables stack smashing protection (SSP)
+# on level corresponding to any of the following options:
+#  -fstack-protector
+#  -fstack-protector-strong
+#  -fstack-protector-all
+tc-enables-ssp() {
+   local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> 
/dev/null | grep '^true$'
+   #if defined(__SSP__) || defined(__SSP_STRONG__) || 
defined(__SSP_ALL__)
+   true
+   #endif
+   EOF
+   )"
+   [[ ${ret} == true ]]
+}
+
+# @FUNCTION: tc-enables-ssp-strong
+# @RETURN: Truth if the current compiler enables stack smashing protection 
(SSP) on at least middle level
+# @DESCRIPTION:
+# Return truth if the current compiler enables stack smashing protection (SSP)
+# on level corresponding to any of the following options:
+#  -fstack-protector-strong
+#  -fstack-protector-all
+tc-enables-ssp-strong() {
+   local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> 
/dev/null | grep '^true$'
+   #if defined(__SSP_STRONG__) || defined(__SSP_ALL__)
+   true
+   #endif
+   EOF
+   )"
+   [[ ${ret} == true ]]
+}
+
+# @FUNCTION: tc-enables-ssp-all
+# @RETURN: Truth if the current compiler enables stack smashing protection 
(SSP) on maximal level
+# @DESCRIPTION:
+# Return truth if the current compiler enables stack smashing protection (SSP)
+# on level corresponding to any of the following options:
+#  -fstack-protector-all
+tc-enables-ssp-all() {
+   local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> 
/dev/null | grep '^true$'
+   #if defined(__SSP_ALL__)
+   true
+   #endif
+   EOF
+   )"
+   [[ ${ret} == true ]]
+}
+
+
 # @FUNCTION: gen_usr_ldscript
 # @USAGE: [-a] 
 # @DESCRIPTION:



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2017-12-12 Thread Fabian Groffen
commit: 890fb26a2be03155a494ee32d5ad10642f478864
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Dec 12 18:43:30 2017 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Dec 12 18:43:30 2017 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=890fb26a

eclass: sync toolchain.eclass by hsk17, bug #639882

 eclass/toolchain.eclass | 67 ++---
 1 file changed, 53 insertions(+), 14 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 130feea359..9dcfcf1d88 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,5 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id$
 
 # Maintainer: Toolchain Ninjas 
 
@@ -94,8 +93,6 @@ if [[ ${SNAPSHOT} == [56789].0-* ]] ; then
SNAPSHOT=${SNAPSHOT/.0}
 fi
 
-export GCC_FILESDIR=${GCC_FILESDIR:-${FILESDIR}}
-
 PREFIX=${TOOLCHAIN_PREFIX:-${EPREFIX}/usr}
 
 if tc_version_is_at_least 3.4.0 ; then
@@ -145,6 +142,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
[[ -n ${D_VER}   ]] && IUSE+=" d"
[[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
tc_version_is_at_least 3 && IUSE+=" doc gcj awt hardened multilib objc"
+   tc_version_is_at_least 3.3 && IUSE+=" pgo"
tc_version_is_at_least 4.0 && IUSE+=" objc-gc"
tc_version_is_between 4.0 4.9 && IUSE+=" mudflap"
tc_version_is_at_least 4.1 && IUSE+=" libssp objc++"
@@ -157,7 +155,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
tc_version_is_at_least 4.8 && IUSE+=" graphite" IUSE_DEF+=( sanitize )
tc_version_is_at_least 4.9 && IUSE+=" cilk +vtv"
tc_version_is_at_least 5.0 && IUSE+=" jit mpx"
-   tc_version_is_at_least 6.0 && IUSE+=" pie ssp +pch"
+   tc_version_is_at_least 6.0 && IUSE+=" +pie +ssp +pch"
 fi
 
 IUSE+=" ${IUSE_DEF[*]/#/+}"
@@ -182,6 +180,12 @@ fi
 
 tc_version_is_at_least 4.5 && RDEPEND+=" >=dev-libs/mpc-0.8.1:0"
 
+if in_iuse objc-gc ; then
+   if tc_version_is_at_least 7 ; then
+   RDEPEND+=" objc-gc? ( >=dev-libs/boehm-gc-7.4.2 )"
+   fi
+fi
+
 if in_iuse graphite ; then
if tc_version_is_at_least 5.0 ; then
RDEPEND+=" graphite? ( >=dev-libs/isl-0.14 )"
@@ -237,7 +241,8 @@ S=$(
 
 gentoo_urls() {
local devspace="HTTP~vapier/dist/URI HTTP~rhill/dist/URI
-   HTTP~zorry/patches/gcc/URI HTTP~blueness/dist/URI"
+   HTTP~zorry/patches/gcc/URI HTTP~blueness/dist/URI
+   HTTP~tamiko/distfiles/URI HTTP~slyfox/distfiles/URI"
devspace=${devspace//HTTP/https:\/\/dev.gentoo.org\/}
echo mirror://gentoo/$1 ${devspace//URI/$1}
 }
@@ -317,7 +322,11 @@ get_gcc_src_uri() {
elif [[ -n ${SNAPSHOT} ]] ; then

GCC_SRC_URI="ftp://gcc.gnu.org/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT}.tar.bz2;
else
-   
GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2"
+   if tc_version_is_between 5.5 6 || tc_version_is_between 6.4 7 
|| tc_version_is_at_least 7.2 ; then
+   
GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.xz"
+   else
+   
GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2"
+   fi
# we want all branch updates to be against the main release
[[ -n ${BRANCH_UPDATE} ]] && \
GCC_SRC_URI+=" $(gentoo_urls 
gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2)"
@@ -434,7 +443,11 @@ gcc_quick_unpack() {
elif [[ -n ${SNAPSHOT} ]] ; then
unpack gcc-${SNAPSHOT}.tar.bz2
elif [[ ${PV} != ** ]] ; then
-   unpack gcc-${GCC_RELEASE_VER}.tar.bz2
+   if tc_version_is_between 5.5 6 || tc_version_is_between 6.4 7 
|| tc_version_is_at_least 7.2 ; then
+   unpack gcc-${GCC_RELEASE_VER}.tar.xz
+   else
+   unpack gcc-${GCC_RELEASE_VER}.tar.bz2
+   fi
# We want branch updates to be against a release tarball
if [[ -n ${BRANCH_UPDATE} ]] ; then
pushd "${S}" > /dev/null
@@ -594,14 +607,14 @@ toolchain_src_prepare() {
einfo "Fixing misc issues in configure files"
for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name 
configure)) ; do
ebegin "  Updating ${f/${S}\/} [LANG]"
-   patch "${f}" "${GCC_FILESDIR}"/gcc-configure-LANG.patch >& 
"${T}"/configure-patch.log \
+   patch "${f}" "${FILESDIR}"/gcc-configure-LANG.patch >& 
"${T}"/configure-patch.log \
|| eerror "Please file a bug about this"
eend $?
done
sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828
 
# Prevent new texinfo from breaking old versions 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2017-10-17 Thread Fabian Groffen
commit: f5d555884c130733f2deb74a6bd3afda5ac99f83
Author: Fabian Groffen  gentoo  org>
AuthorDate: Tue Oct 17 08:39:42 2017 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Tue Oct 17 08:39:42 2017 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f5d55588

eclass/java-utils-2: ensure EPREFIX is set for depend-java-query

 eclass/java-utils-2.eclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 1ec878b96c..31ba721003 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -23,7 +23,8 @@ IUSE="elibc_FreeBSD"
 export WANT_JAVA_CONFIG="2"
 
 # Prefix variables are only available for EAPI>=3
-has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
+# PREFIX: we always need EPREFIX, as there's still old ebuilds
+#has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
 
 # @VARIABLE: JAVA_PKG_PORTAGE_DEP
 # @INTERNAL



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2017-10-16 Thread Fabian Groffen
commit: d014d46e64b29ad5c8caf7461b78f8221b18a963
Author: Fabian Groffen  gentoo  org>
AuthorDate: Mon Oct 16 13:54:15 2017 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Mon Oct 16 13:54:15 2017 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d014d46e

eclass: sync java eclasses

 eclass/java-ant-2.eclass   | 524 ---
 eclass/java-utils-2.eclass | 597 +
 2 files changed, 380 insertions(+), 741 deletions(-)

diff --git a/eclass/java-ant-2.eclass b/eclass/java-ant-2.eclass
deleted file mode 100644
index ddfbc3a29e..00
--- a/eclass/java-ant-2.eclass
+++ /dev/null
@@ -1,524 +0,0 @@
-# eclass for ant based Java packages
-#
-# Copyright (c) 2004-2005, Thomas Matthijs 
-# Copyright (c) 2004-2011, Gentoo Foundation
-# Changes:
-#   May 2007:
-# Made bsfix make one pass for all things and add some glocal targets for
-# setting up the whole thing. Contributed by  kiorky
-# (kio...@cryptelium.net).
-#   December 2006:
-# I pretty much rewrote the logic of the bsfix functions
-# and xml-rewrite.py because they were so slow
-# Petteri Räty (betelge...@gentoo.org)
-#
-# Licensed under the GNU General Public License, v2
-#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v 1.58 2014/03/31 
16:48:51 mgorny Exp $
-
-# @ECLASS: java-ant-2.eclass
-# @MAINTAINER:
-# j...@gentoo.org
-# @AUTHOR:
-# kiorky (kio...@cryptelium.net), Petteri Räty (betelge...@gentoo.org)
-# @BLURB: eclass for ant based Java packages
-# @DESCRIPTION:
-# Eclass for Ant-based Java packages. Provides support for both automatic and
-# manual manipulation of build.xml files. Should be inherited after java-pkg-2
-# or java-pkg-opt-2 eclass.
-
-inherit java-utils-2 multilib
-
-# This eclass provides functionality for Java packages which use
-# ant to build. In particular, it will attempt to fix build.xml files, so that
-# they use the appropriate 'target' and 'source' attributes.
-
-# @ECLASS-VARIABLE: WANT_ANT_TASKS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# An $IFS separated list of ant tasks.
-# Ebuild can specify this variable before inheriting java-ant-2 eclass to
-# determine ANT_TASKS it needs. They will be automatically translated to
-# DEPEND variable and ANT_TASKS variable. JAVA_PKG_FORCE_ANT_TASKS can override
-# ANT_TASKS set by WANT_ANT_TASKS, but not the DEPEND due to caching.
-# Ebuilds that need to depend conditionally on certain tasks and specify them
-# differently for different eant calls can't use this simplified approach.
-# You also cannot specify version or anything else than ant-*.
-#
-# @CODE
-# WANT_ANT_TASKS="ant-junit ant-trax"
-# @CODE
-
-#The implementation of dependencies is handled by java-utils-2.eclass
-#WANT_ANT_TASKS
-
-# @ECLASS-VARIABLE: JAVA_ANT_DISABLE_ANT_CORE_DEP
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Setting this variable non-empty before inheriting java-ant-2 disables adding
-# dev-java/ant-core into DEPEND.
-if [[ -z "${JAVA_ANT_DISABLE_ANT_CORE_DEP}" ]]; then
-   JAVA_ANT_E_DEPEND="${JAVA_ANT_E_DEPEND} 
>=dev-java/ant-core-1.8.2"
-fi
-
-# add ant tasks specified in WANT_ANT_TASKS to DEPEND
-local ANT_TASKS_DEPEND;
-ANT_TASKS_DEPEND="$(java-pkg_ant-tasks-depend)"
-# check that java-pkg_ant-tasks-depend didn't fail
-if [[ $? != 0 ]]; then
-   eerror "${ANT_TASKS_DEPEND}"
-   die "java-pkg_ant-tasks-depend() failed"
-fi
-
-# We need some tools from javatoolkit. We also need portage 2.1 for phase hooks
-# and ant dependencies constructed above. Python is there for
-# java-ant_remove-taskdefs
-JAVA_ANT_E_DEPEND="${JAVA_ANT_E_DEPEND}
-  ${ANT_TASKS_DEPEND}
-  ${JAVA_PKG_PORTAGE_DEP}
-  >=dev-java/javatoolkit-0.3.0-r2"
-
-# this eclass must be inherited after java-pkg-2 or java-pkg-opt-2
-# if it's java-pkg-opt-2, ant dependencies are pulled based on USE flag
-if has java-pkg-opt-2 ${INHERITED}; then
-   JAVA_ANT_E_DEPEND="${JAVA_PKG_OPT_USE}? ( ${JAVA_ANT_E_DEPEND} )"
-elif ! has java-pkg-2 ${INHERITED}; then
-   eerror "java-ant-2 eclass can only be inherited AFTER java-pkg-2 or 
java-pkg-opt-2"
-fi
-
-DEPEND="${JAVA_ANT_E_DEPEND}"
-
-# @ECLASS-VARIABLE: JAVA_PKG_BSFIX
-# @DESCRIPTION:
-# Should we attempt to 'fix' ant build files to include the source/target
-# attributes when calling javac?
-JAVA_PKG_BSFIX=${JAVA_PKG_BSFIX:-"on"}
-
-# @ECLASS-VARIABLE: JAVA_PKG_BSFIX_ALL
-# @DESCRIPTION:
-# If we're fixing build files, should we try to fix all the ones we can find?
-JAVA_PKG_BSFIX_ALL=${JAVA_PKG_BSFIX_ALL:-"yes"}
-
-# @ECLASS-VARIABLE: JAVA_PKG_BSFIX_NAME
-# @DESCRIPTION:
-# Filename of build files to fix/search for
-JAVA_PKG_BSFIX_NAME=${JAVA_PKG_BSFIX_NAME:-"build.xml"}
-
-# @ECLASS-VARIABLE: JAVA_PKG_BSFIX_TARGET_TAGS
-# @DESCRIPTION:
-# Targets to fix the 'source' attribute in
-JAVA_PKG_BSFIX_TARGET_TAGS=${JAVA_PKG_BSFIX_TARGET_TAGS:-"javac xjavac 
javac.preset"}
-
-# 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2017-10-03 Thread Michael Haubenwallner
commit: 454ac483ada6005cd1285afc1f152a2512f46634
Author: Michael Haubenwallner  gentoo  org>
AuthorDate: Tue Oct  3 07:36:18 2017 +
Commit: Michael Haubenwallner  gentoo  org>
CommitDate: Tue Oct  3 07:36:18 2017 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=454ac483

libtool.eclass: drop, app-portage/elt-patches has prefix support

 eclass/libtool.eclass | 519 --
 1 file changed, 519 deletions(-)

diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass
deleted file mode 100644
index 7f09f3760c..00
--- a/eclass/libtool.eclass
+++ /dev/null
@@ -1,519 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# @ECLASS: libtool.eclass
-# @MAINTAINER:
-# base-sys...@gentoo.org
-# @BLURB: quickly update bundled libtool code
-# @DESCRIPTION:
-# This eclass patches ltmain.sh distributed with libtoolized packages with the
-# relink and portage patch among others
-#
-# Note, this eclass does not require libtool as it only applies patches to
-# generated libtool files.  We do not run the libtoolize program because that
-# requires a regeneration of the main autotool files in order to work properly.
-
-if [[ -z ${_LIBTOOL_ECLASS} ]]; then
-_LIBTOOL_ECLASS=1
-
-DEPEND=">=app-portage/elt-patches-20170317"
-
-libtool_elt_patch_dir() {
-   if use prefix-chain; then
-   local parent parents
-   IFS=: eval 'parents=(${PORTAGE_READONLY_EPREFIXES})'
-   for parent in "${parents[@]}"; do
-   if [[ -d ${parent}/usr/share/elt-patches ]]; then
-   echo "${parent}/usr/share/elt-patches"
-   return 0
-   fi
-   done
-   fi
-   echo "${EPREFIX}/usr/share/elt-patches"
-}
-
-inherit multilib toolchain-funcs
-
-#
-# See if we can apply $2 on $1, and if so, do it
-#
-ELT_try_and_apply_patch() {
-   local ret=0
-   local file=$1
-   local patch=$2
-   local src=$3
-   local disp="${src} patch"
-   local log="${T}/elibtool.log"
-
-   if [[ -z ${_ELT_NOTED_TMP} ]] ; then
-   _ELT_NOTED_TMP=true
-   printf 'temp patch: %s\n' "${patch}" > "${log}"
-   fi
-   printf '\nTrying %s\n' "${disp}" >> "${log}"
-
-   if [[ ! -e ${file} ]] ; then
-   echo "File not found: ${file}" >> "${log}"
-   return 1
-   fi
-
-   # Save file for permission restoration.  `patch` sometimes resets 
things.
-   # Ideally we'd want 'stat -c %a', but stat is highly non portable and 
we are
-   # guaranted to have GNU find, so use that instead.
-   local perms="$(find ${file} -maxdepth 0 -printf '%m')"
-   # We only support patchlevel of 0 - why worry if its static patches?
-   if patch -p0 --dry-run "${file}" "${patch}" >> "${log}" 2>&1 ; then
-   einfo "  Applying ${disp} ..."
-   patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" >> 
"${log}" 2>&1
-   ret=$?
-   export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${src}"
-   else
-   ret=1
-   fi
-   chmod "${perms}" "${file}"
-
-   return "${ret}"
-}
-
-#
-# Get string version of ltmain.sh or ltconfig (passed as $1)
-#
-ELT_libtool_version() {
-   (
-   unset VERSION
-   eval $(grep -e '^[[:space:]]*VERSION=' "$1")
-   echo "${VERSION:-0}"
-   )
-}
-
-#
-# Run through the patches in $2 and see if any
-# apply to $1 ...
-#
-ELT_walk_patches() {
-   local patch tmp
-   local ret=1
-   local file=$1
-   local patch_set=$2
-   local patch_dir="$(libtool_elt_patch_dir)/${patch_set}"
-   local rem_int_dep=$3
-
-   [[ -z ${patch_set} ]] && return 1
-   [[ ! -d ${patch_dir} ]] && return 1
-
-   # Allow patches to use @GENTOO_LIBDIR@ replacements
-   local sed_args=( -e "s:@GENTOO_LIBDIR@:$(get_libdir):g" )
-   if [[ -n ${rem_int_dep} ]] ; then
-   # replace @REM_INT_DEP@ with what was passed
-   # to --remove-internal-dep
-   sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" )
-   fi
-
-   pushd "$(libtool_elt_patch_dir)" >/dev/null || die
-
-   # Go through the patches in reverse order (newer version to older)
-   for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort 
-r) ; do
-   tmp="${T}/libtool-elt.patch"
-   sed "${sed_args[@]}" "${patch}" > "${tmp}" || die
-   if ELT_try_and_apply_patch "${file}" "${tmp}" "${patch}" ; then
-   # Break to unwind w/popd rather than return directly
-   ret=0
-   break
-   fi
-   done
-
-   popd >/dev/null
-   return ${ret}
-}
-
-# @FUNCTION: elibtoolize
-# @USAGE: [dirs] [--portage] [--reverse-deps] [--patch-only] 

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2016-07-08 Thread Fabian Groffen
commit: bfd6b1346c60047b04563a61dd6cedec361e2d59
Author: Fabian Groffen  gentoo  org>
AuthorDate: Fri Jul  8 11:17:19 2016 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Fri Jul  8 11:17:19 2016 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=bfd6b134

eclass/toolchain-funcs: sync with gx86

 eclass/toolchain-funcs.eclass | 124 +-
 1 file changed, 99 insertions(+), 25 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 4a5c5e1..b2eeb69 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -22,7 +22,7 @@ inherit multilib prefix
 _tc-getPROG() {
local tuple=$1
local v var vars=$2
-   local prog=$3
+   local prog=( $3 )
 
var=${vars%% *}
for v in ${vars} ; do
@@ -34,11 +34,11 @@ _tc-getPROG() {
done
 
local search=
-   [[ -n $4 ]] && search=$(type -p "$4-${prog}")
-   [[ -z ${search} && -n ${!tuple} ]] && search=$(type -p 
"${!tuple}-${prog}")
-   [[ -n ${search} ]] && prog=${search##*/}
+   [[ -n $4 ]] && search=$(type -p $4-${prog[0]})
+   [[ -z ${search} && -n ${!tuple} ]] && search=$(type -p 
${!tuple}-${prog[0]})
+   [[ -n ${search} ]] && prog[0]=${search##*/}
 
-   export ${var}=${prog}
+   export ${var}="${prog[*]}"
echo "${!var}"
 }
 tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" 
"${@:2}"; }
@@ -59,7 +59,7 @@ tc-getCC() { tc-getPROG CC gcc "$@"; }
 # @FUNCTION: tc-getCPP
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the C preprocessor
-tc-getCPP() { tc-getPROG CPP cpp "$@"; }
+tc-getCPP() { tc-getPROG CPP "${CC:-gcc} -E" "$@"; }
 # @FUNCTION: tc-getCXX
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the C++ compiler
@@ -132,7 +132,7 @@ tc-getBUILD_CC() { tc-getBUILD_PROG CC gcc "$@"; }
 # @FUNCTION: tc-getBUILD_CPP
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the C preprocessor for building binaries to run on the 
build machine
-tc-getBUILD_CPP() { tc-getBUILD_PROG CPP cpp "$@"; }
+tc-getBUILD_CPP() { tc-getBUILD_PROG CPP "$(tc-getBUILD_CC) -E" "$@"; }
 # @FUNCTION: tc-getBUILD_CXX
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the C++ compiler for building binaries to run on the build 
machine
@@ -221,6 +221,21 @@ tc-is-static-only() {
[[ ${host} == *-mint* ]]
 }
 
+# @FUNCTION: tc-stack-grows-down
+# @DESCRIPTION:
+# Return shell true if the stack grows down.  This is the default behavior
+# for the vast majority of systems out there and usually projects shouldn't
+# care about such internal details.
+tc-stack-grows-down() {
+   # List the few that grow up.
+   case ${ARCH} in
+   hppa|metag) return 1 ;;
+   esac
+
+   # Assume all others grow down.
+   return 0
+}
+
 # @FUNCTION: tc-export_build_env
 # @USAGE: [compiler variables]
 # @DESCRIPTION:
@@ -445,11 +460,6 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
local host=$2
[[ -z ${host} ]] && host=${CTARGET:-${CHOST}}
 
-   local KV=${KV:-${KV_FULL}}
-   use kernel_linux &&
-   [[ ${type} == "kern" ]] && [[ -z ${KV} ]] && \
-   ewarn "QA: Kernel version could not be determined, please inherit 
kernel-2 or linux-info"
-
case ${host} in
powerpc-apple-darwin*)echo ppc-macos;;
powerpc64-apple-darwin*)  echo ppc64-macos;;
@@ -488,7 +498,7 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
# Starting with linux-2.6.24, the 'x86_64' and 'i386'
# trees have been unified into 'x86'.
# FreeBSD still uses i386
-   if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -lt 
$(KV_to_int 2.6.24) || ${host} == *freebsd* ]] ; then
+   if [[ ${type} == "kern" && ${host} == *freebsd* ]] ; 
then
echo i386
else
echo x86
@@ -506,18 +516,10 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
# Starting with linux-2.6.15, the 'ppc' and 'ppc64' 
trees
# have been unified into simply 'powerpc', but until 
2.6.16,
# ppc32 is still using ARCH="ppc" as default
-   if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge 
$(KV_to_int 2.6.16) ]] ; then
+   if [[ ${type} == "kern" ]] ; then
echo powerpc
-   elif [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) 
-eq $(KV_to_int 2.6.15) ]] ; then
-   if [[ ${host} == powerpc64* ]] || [[ 
${PROFILE_ARCH} == "ppc64" ]] ; then
-   echo powerpc
-   else
-   echo ppc
-   fi

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2016-06-15 Thread Benda XU
commit: 97556ea18ef948aac8f56f039a3cc086f1b7a061
Author: Benda Xu  gentoo  org>
AuthorDate: Wed Jun 15 11:04:55 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Wed Jun 15 11:04:55 2016 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=97556ea1

remove kernel-2.eclass, merged.
Bug: 478436

 eclass/kernel-2.eclass | 1321 
 1 file changed, 1321 deletions(-)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
deleted file mode 100644
index e8cb8f2..000
--- a/eclass/kernel-2.eclass
+++ /dev/null
@@ -1,1321 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.297 2014/11/28 
17:40:20 mpagano Exp $
-
-# Description: kernel.eclass rewrite for a clean base regarding the 2.6
-#  series of kernel with back-compatibility for 2.4
-#
-# Original author: John Mylchreest 
-# Maintainer: kernel-m...@gentoo.org
-#
-# Please direct your bugs to the current eclass maintainer :)
-
-# added functionality:
-# unipatch - a flexible, singular method to extract, add and 
remove patches.
-
-# A Couple of env vars are available to effect usage of this eclass
-# These are as follows:
-#
-# K_USEPV  - When setting the EXTRAVERSION 
variable, it should
-#add PV to the end.
-#this is useful for thigns 
like wolk. IE:
-#EXTRAVERSION would be 
something like : -wolk-4.19-r1
-# K_NOSETEXTRAVERSION  - if this is set then EXTRAVERSION will not be
-#automatically set within the 
kernel Makefile
-# K_NOUSENAME  - if this is set then EXTRAVERSION will not 
include the
-#first part of ${PN} in 
EXTRAVERSION
-# K_NOUSEPR- if this is set then EXTRAVERSION will 
not include the
-#anything based on ${PR}.
-# K_PREPATCHED - if the patchset is prepatched (ie: mm-sources,
-#ck-sources, ac-sources) it 
will use PR (ie: -r5) as
-#the patchset version for
-#and not use it as a true 
package revision
-# K_EXTRAEINFO - this is a new-line seperated list of einfo 
displays in
-#postinst and can be used to 
carry additional postinst
-#messages
-# K_EXTRAELOG  - same as K_EXTRAEINFO except using elog 
instead of einfo
-# K_EXTRAEWARN - same as K_EXTRAEINFO except using ewarn 
instead of einfo
-# K_SYMLINK- if this is set, then forcably create 
symlink anyway
-#
-# K_DEFCONFIG  - Allow specifying a different defconfig target.
-#If length zero, defaults to 
"defconfig".
-# K_WANT_GENPATCHES- Apply genpatches to kernel source. Provide any
-#combination of "base", 
"extras" or "experimental".
-# K_EXP_GENPATCHES_PULL- If set, we pull "experimental" regardless of 
the USE FLAG
-#but expect the ebuild 
maintainer to use K_EXP_GENPATCHES_LIST.
-# K_EXP_GENPATCHES_NOUSE   - If set, no USE flag will be provided for 
"experimental";
-#as a result the user cannot 
choose to apply those patches.
-# K_EXP_GENPATCHES_LIST- A list of patches to pick from "experimental" 
to apply when
-#the USE flag is unset and 
K_EXP_GENPATCHES_PULL is set.
-# K_GENPATCHES_VER - The version of the genpatches tarball(s) to 
apply.
-#A value of "5" would apply 
genpatches-2.6.12-5 to
-#my-sources-2.6.12.ebuild
-# K_SECURITY_UNSUPPORTED- If set, this kernel is unsupported by Gentoo Security
-# K_DEBLOB_AVAILABLE   - A value of "0" will disable all of the optional deblob
-#code. If empty, will be set 
to "1" if deblobbing is
-#possible. Test ONLY for "1".
-# K_PREDEBLOBBED   - This kernel was already deblobbed elsewhere.
-#If false, either optional 
deblobbing will be available
-#or the license will note the 
inclusion of freedist
-#   

[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2016-04-18 Thread Michael Haubenwallner
commit: c658ad8cc73fde6590c34fce7af7340b76c01d21
Author: Michael Haubenwallner  ssi-schaefer 
 com>
AuthorDate: Fri Apr 15 09:15:09 2016 +
Commit: Michael Haubenwallner  gentoo  org>
CommitDate: Mon Apr 18 08:06:00 2016 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=c658ad8c

toolchain.eclass: support CYGWINPORTS_GITREV to take patches from 
github.com/cygwinports/gcc

 eclass/toolchain.eclass | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 2696110..149a991 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -366,6 +366,10 @@ get_gcc_src_uri() {
fi
fi
 
+   # Cygwin patches from https://github.com/cygwinports/gcc
+   [[ -n ${CYGWINPORTS_GITREV} ]] && \
+   GCC_SRC_URI+=" elibc_Cygwin? ( 
https://github.com/cygwinports/gcc/archive/${CYGWINPORTS_GITREV}.zip )"
+
echo "${GCC_SRC_URI}"
 }
 
@@ -484,6 +488,8 @@ gcc_quick_unpack() {
 
use_if_iuse boundschecking && unpack 
"bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2"
 
+   [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin && unpack 
"${CYGWINPORTS_GITREV}.zip"
+
popd > /dev/null
 }
 
@@ -508,6 +514,7 @@ toolchain_src_prepare() {
fi
do_gcc_HTB_patches
do_gcc_PIE_patches
+   do_gcc_CYGWINPORTS_patches
epatch_user
 
if ( tc_version_is_at_least 4.8.2 || use hardened ) && ! use vanilla ; 
then
@@ -656,6 +663,19 @@ do_gcc_PIE_patches() {
BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, pie-${PIE_VER}"
 }
 
+do_gcc_CYGWINPORTS_patches() {
+   [[ -n ${CYGWINPORTS_GITREV} ]] || return 0
+   use elibc_Cygwin || return 0
+
+   local p d="${WORKDIR}/gcc-${CYGWINPORTS_GITREV}"
+   for p in $(
+   eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/gcc.cygport)"
+   echo ${PATCH_URI}
+   ); do
+   epatch "${d}/${p}"
+   done
+}
+
 # configure to build with the hardened GCC specs as the default
 make_gcc_hard() {
# we want to be able to control the pie patch logic via something other
@@ -1010,7 +1030,7 @@ toolchain_src_configure() {
confgcc+=( --enable-shared )
fi
case ${CHOST} in
-   mingw*|*-mingw*|*-cygwin)
+   mingw*|*-mingw*)
confgcc+=( --enable-threads=win32 ) ;;
*)
confgcc+=( --enable-threads=posix ) ;;



[gentoo-commits] repo/proj/prefix:master commit in: eclass/

2016-03-20 Thread Fabian Groffen
commit: 7ce7d487acf67d28db2eea56569c6fcb499bf6c9
Author: Fabian Groffen  gentoo  org>
AuthorDate: Sun Mar 20 18:22:24 2016 +
Commit: Fabian Groffen  gentoo  org>
CommitDate: Sun Mar 20 18:22:24 2016 +
URL:https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7ce7d487

eclass/toolchain-funcs: sync, bug #576680

 eclass/toolchain-funcs.eclass | 125 ++
 1 file changed, 102 insertions(+), 23 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index e6ebd49..4a5c5e1 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.131 
2014/11/01 05:19:20 vapier Exp $
+# $Id$
 
 # @ECLASS: toolchain-funcs.eclass
 # @MAINTAINER:
@@ -84,6 +84,10 @@ tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; }
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the object copier
 tc-getOBJCOPY() { tc-getPROG OBJCOPY objcopy "$@"; }
+# @FUNCTION: tc-getOBJDUMP
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the object dumper
+tc-getOBJDUMP() { tc-getPROG OBJDUMP objdump "$@"; }
 # @FUNCTION: tc-getF77
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the Fortran 77 compiler
@@ -96,6 +100,10 @@ tc-getFC() { tc-getPROG FC gfortran "$@"; }
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the java compiler
 tc-getGCJ() { tc-getPROG GCJ gcj "$@"; }
+# @FUNCTION: tc-getGO
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the Go compiler
+tc-getGO() { tc-getPROG GO gccgo "$@"; }
 # @FUNCTION: tc-getPKG_CONFIG
 # @USAGE: [toolchain prefix]
 # @RETURN: name of the pkg-config tool
@@ -219,10 +227,13 @@ tc-is-static-only() {
 # Export common build related compiler settings.
 tc-export_build_env() {
tc-export "$@"
+   # Some build envs will initialize vars like:
+   # : ${BUILD_LDFLAGS:-${LDFLAGS}}
+   # So make sure all variables are non-empty. #526734
: ${BUILD_CFLAGS:=-O1 -pipe}
: ${BUILD_CXXFLAGS:=-O1 -pipe}
-   : ${BUILD_CPPFLAGS:=}
-   : ${BUILD_LDFLAGS:=}
+   : ${BUILD_CPPFLAGS:= }
+   : ${BUILD_LDFLAGS:= }
export BUILD_{C,CXX,CPP,LD}FLAGS
 
# Some packages use XXX_FOR_BUILD.
@@ -297,7 +308,78 @@ tc-env_build() {
 # }
 # @CODE
 econf_build() {
-   tc-env_build econf --build=${CBUILD:-${CHOST}} "$@"
+   local CBUILD=${CBUILD:-${CHOST}}
+   tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@"
+}
+
+# @FUNCTION: tc-ld-is-gold
+# @USAGE: [toolchain prefix]
+# @DESCRIPTION:
+# Return true if the current linker is set to gold.
+tc-ld-is-gold() {
+   local out
+
+   # First check the linker directly.
+   out=$($(tc-getLD "$@") --version 2>&1)
+   if [[ ${out} == *"GNU gold"* ]] ; then
+   return 0
+   fi
+
+   # Then see if they're selecting gold via compiler flags.
+   # Note: We're assuming they're using LDFLAGS to hold the
+   # options and not CFLAGS/CXXFLAGS.
+   local base="${T}/test-tc-gold"
+   cat <<-EOF > "${base}.c"
+   int main() { return 0; }
+   EOF
+   out=$($(tc-getCC "$@") ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -Wl,--version 
"${base}.c" -o "${base}" 2>&1)
+   rm -f "${base}"*
+   if [[ ${out} == *"GNU gold"* ]] ; then
+   return 0
+   fi
+
+   # No gold here!
+   return 1
+}
+
+# @FUNCTION: tc-ld-disable-gold
+# @USAGE: [toolchain prefix]
+# @DESCRIPTION:
+# If the gold linker is currently selected, configure the compilation
+# settings so that we use the older bfd linker instead.
+tc-ld-disable-gold() {
+   if ! tc-ld-is-gold "$@" ; then
+   # They aren't using gold, so nothing to do!
+   return
+   fi
+
+   ewarn "Forcing usage of the BFD linker instead of GOLD"
+
+   # Set up LD to point directly to bfd if it's available.
+   # We need to extract the first word in case there are flags appended
+   # to its value (like multilib).  #545218
+   local ld=$(tc-getLD "$@")
+   local bfd_ld="${ld%% *}.bfd"
+   local path_ld=$(which "${bfd_ld}" 2>/dev/null)
+   [[ -e ${path_ld} ]] && export LD=${bfd_ld}
+
+   # Set up LDFLAGS to select gold based on the gcc version.
+   local major=$(gcc-major-version "$@")
+   local minor=$(gcc-minor-version "$@")
+   if [[ ${major} -lt 4 ]] || [[ ${major} -eq 4 && ${minor} -lt 8 ]] ; then
+   # <=gcc-4.7 requires some coercion.  Only works if bfd exists.
+   if [[ -e ${path_ld} ]] ; then
+   local d="${T}/bfd-linker"
+   mkdir -p "${d}"
+   ln -sf "${path_ld}" "${d}"/ld
+   export LDFLAGS="${LDFLAGS} -B${d}"
+   else
+   die "unable to locate a BFD