summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/apache-2.eclass10
-rw-r--r--eclass/autotools.eclass28
-rw-r--r--eclass/chromium-2.eclass4
-rw-r--r--eclass/cmake-utils.eclass850
-rw-r--r--eclass/distutils-r1.eclass208
-rw-r--r--eclass/dotnet.eclass6
-rw-r--r--eclass/epatch.eclass102
-rw-r--r--eclass/eqawarn.eclass26
-rw-r--r--eclass/eutils.eclass176
-rw-r--r--eclass/findlib.eclass11
-rw-r--r--eclass/flag-o-matic.eclass206
-rw-r--r--eclass/frameworks.kde.org.eclass72
-rw-r--r--eclass/gear.kde.org.eclass66
-rw-r--r--eclass/gnustep-2.eclass12
-rw-r--r--eclass/gnustep-base.eclass11
-rw-r--r--eclass/gstreamer-meson.eclass1
-rw-r--r--eclass/haskell-cabal.eclass168
-rw-r--r--eclass/java-pkg-simple.eclass28
-rw-r--r--eclass/java-utils-2.eclass8
-rw-r--r--eclass/java-vm-2.eclass30
-rw-r--r--eclass/kde.org.eclass132
-rw-r--r--eclass/kernel-2.eclass14
-rw-r--r--eclass/kernel-build.eclass15
-rw-r--r--eclass/llvm.eclass2
-rw-r--r--eclass/llvm.org.eclass8
-rw-r--r--eclass/meson.eclass15
-rw-r--r--eclass/mozcoreconf-v6.eclass15
-rw-r--r--eclass/multilib.eclass33
-rw-r--r--eclass/opam.eclass35
-rw-r--r--eclass/optfeature.eclass6
-rw-r--r--eclass/perl-functions.eclass74
-rw-r--r--eclass/perl-module.eclass321
-rw-r--r--eclass/plasma-mobile.kde.org.eclass51
-rw-r--r--eclass/plasma.kde.org.eclass66
-rw-r--r--eclass/python-r1.eclass1
-rw-r--r--eclass/python-utils-r1.eclass18
-rw-r--r--eclass/qt5-build.eclass13
-rw-r--r--eclass/qt6-build.eclass161
-rw-r--r--eclass/ros-catkin.eclass40
-rw-r--r--eclass/ruby-ng.eclass43
-rw-r--r--eclass/ruby-utils.eclass4
-rw-r--r--eclass/selinux-policy-2.eclass9
-rw-r--r--eclass/stardict.eclass46
-rw-r--r--eclass/toolchain-funcs.eclass15
-rw-r--r--eclass/toolchain.eclass53
-rw-r--r--eclass/tree-sitter-grammar.eclass10
-rw-r--r--eclass/user.eclass8
-rw-r--r--eclass/vala.eclass5
-rw-r--r--eclass/vcs-snapshot.eclass3
-rw-r--r--eclass/virtualx.eclass79
-rw-r--r--eclass/xorg-3.eclass2
51 files changed, 1432 insertions, 1888 deletions
diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass
index f59030f926f..583657b35ff 100644
--- a/eclass/apache-2.eclass
+++ b/eclass/apache-2.eclass
@@ -11,7 +11,7 @@
# and inter-module dependency checking.
LUA_COMPAT=( lua5-{1..4} )
-inherit autotools flag-o-matic lua-single multilib ssl-cert user toolchain-funcs
+inherit autotools flag-o-matic lua-single multilib ssl-cert toolchain-funcs
[[ ${CATEGORY}/${PN} != www-servers/apache ]] \
&& die "Do not use this eclass with anything else than www-servers/apache ebuilds!"
@@ -133,6 +133,8 @@ unset -f _apache2_set_mpms
# Dependencies
RDEPEND="
+ acct-group/apache
+ acct-user/apache
dev-lang/perl
>=dev-libs/apr-1.5.1:=
=dev-libs/apr-util-1*:=[gdbm=,ldap?]
@@ -289,7 +291,7 @@ setup_modules() {
mod_type="shared"
fi
- MY_CONF=( --enable-so=static )
+ MY_CONF=( --enable-so=static --disable-static )
MY_MODS=()
if use ldap ; then
@@ -437,10 +439,6 @@ check_upgrade() {
apache-2_pkg_setup() {
check_upgrade
- # setup apache user and group
- enewgroup apache 81
- enewuser apache 81 -1 /var/www apache
-
setup_mpm
setup_modules
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index d6c5b7f0ec0..ab9040d99c7 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -4,7 +4,7 @@
# @ECLASS: autotools.eclass
# @MAINTAINER:
# base-system@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: Regenerates auto* build scripts
# @DESCRIPTION:
# This eclass is for safely handling autotooled software packages that need to
@@ -27,7 +27,7 @@ if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then
_AUTOTOOLS_ECLASS=1
case ${EAPI} in
- 5|6)
+ 6)
# Needed for eqawarn
inherit eutils
;;
@@ -130,7 +130,7 @@ RDEPEND=""
: ${AUTOTOOLS_AUTO_DEPEND:=yes}
if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then
case ${EAPI} in
- 5|6) DEPEND=${AUTOTOOLS_DEPEND} ;;
+ 6) DEPEND=${AUTOTOOLS_DEPEND} ;;
*) BDEPEND=${AUTOTOOLS_DEPEND} ;;
esac
fi
@@ -336,7 +336,7 @@ eaclocal() {
# - ${BROOT}/usr/share/aclocal
# - ${ESYSROOT}/usr/share/aclocal
# See bug #677002
- if [[ ${EAPI} != [56] ]] ; then
+ if [[ ${EAPI} != 6 ]] ; then
if [[ ! -f "${T}"/aclocal/dirlist ]] ; then
mkdir "${T}"/aclocal || die
cat <<- EOF > "${T}"/aclocal/dirlist || die
@@ -394,7 +394,7 @@ eautoconf() {
if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then
case ${EAPI} in
- 5|6|7)
+ 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."
@@ -485,7 +485,7 @@ config_rpath_update() {
local dst src
case ${EAPI} in
- 5|6)
+ 6)
src="${EPREFIX}/usr/share/gettext/config.rpath"
;;
*)
@@ -516,7 +516,7 @@ autotools_env_setup() {
# Break on first hit to respect _LATEST_AUTOMAKE order.
local hv_args=""
case ${EAPI} in
- 5|6)
+ 6)
hv_args="--host-root"
;;
*)
@@ -525,8 +525,18 @@ autotools_env_setup() {
esac
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[*]}"
+
+ # During bootstrap in prefix there might be no automake merged yet
+ # due to --nodeps, but still available somewhere in PATH.
+ # For example, ncurses needs local libtool on aix and hpux.
+ # So, make the check non-fatal where automake doesn't yet
+ # exist within BROOT. (We could possibly do better here
+ # and inspect PATH, but I'm not sure there's much point.)
+ if use prefix && [[ ! -x "${BROOT}"/usr/bin/automake ]] ; then
+ [[ ${WANT_AUTOMAKE} == "latest" ]] && ewarn "Ignoring missing automake during Prefix bootstrap! Tried ${_LATEST_AUTOMAKE[*]}"
+ else
+ [[ ${WANT_AUTOMAKE} == "latest" ]] && die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE[*]}"
+ fi
fi
[[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.71
}
diff --git a/eclass/chromium-2.eclass b/eclass/chromium-2.eclass
index bf509d8ff0f..cd4495767e5 100644
--- a/eclass/chromium-2.eclass
+++ b/eclass/chromium-2.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: chromium-2.eclass
@@ -122,7 +122,7 @@ chromium_pkg_die() {
fi
# Prevent user problems like bug #348235.
- if ( shopt -s extglob; is-flagq '-g?(gdb)?([1-9])' ); then
+ if is-flagq '-g?(gdb)?([1-9])'; then
ewarn
ewarn "You have enabled debug info (i.e. -g or -ggdb in your CFLAGS/CXXFLAGS)."
ewarn "This produces very large build files causes the linker to consume large"
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
deleted file mode 100644
index 4ec3b900eda..00000000000
--- a/eclass/cmake-utils.eclass
+++ /dev/null
@@ -1,850 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @ECLASS: cmake-utils.eclass
-# @MAINTAINER:
-# kde@gentoo.org
-# @AUTHOR:
-# Tomáš Chvátal <scarabeus@gentoo.org>
-# Maciej Mrozowski <reavertm@gentoo.org>
-# (undisclosed contributors)
-# Original author: Zephyrus (zephyrus@mirach.it)
-# @SUPPORTED_EAPIS: 5 6 7
-# @PROVIDES: ninja-utils
-# @BLURB: common ebuild functions for cmake-based packages
-# @DEPRECATED: cmake.eclass
-# @DESCRIPTION:
-# DEPRECATED: This no longer receives any changes. Everyone must port to cmake.eclass.
-# The cmake-utils eclass makes creating ebuilds for cmake-based packages much easier.
-# It provides all inherited features (DOCS, HTML_DOCS, PATCHES) along with out-of-source
-# builds (default), in-source builds and an implementation of the well-known use_enable
-# and use_with functions for CMake.
-
-if [[ -z ${_CMAKE_UTILS_ECLASS} ]]; then
-_CMAKE_UTILS_ECLASS=1
-
-# @ECLASS_VARIABLE: BUILD_DIR
-# @DESCRIPTION:
-# Build directory where all cmake processed files should be generated.
-# For in-source build it's fixed to ${CMAKE_USE_DIR}.
-# For out-of-source build it can be overridden, by default it uses
-# ${WORKDIR}/${P}_build.
-#
-# This variable has been called CMAKE_BUILD_DIR formerly.
-# It is set under that name for compatibility.
-
-# @ECLASS_VARIABLE: CMAKE_BINARY
-# @DESCRIPTION:
-# Eclass can use different cmake binary than the one provided in by system.
-: ${CMAKE_BINARY:=cmake}
-
-# @ECLASS_VARIABLE: CMAKE_BUILD_TYPE
-# @DESCRIPTION:
-# Set to override default CMAKE_BUILD_TYPE. Only useful for packages
-# known to make use of "if (CMAKE_BUILD_TYPE MATCHES xxx)".
-# If about to be set - needs to be set before invoking cmake-utils_src_configure.
-# You usualy do *NOT* want nor need to set it as it pulls CMake default build-type
-# specific compiler flags overriding make.conf.
-: ${CMAKE_BUILD_TYPE:=Gentoo}
-
-# @ECLASS_VARIABLE: CMAKE_IN_SOURCE_BUILD
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Set to enable in-source build.
-
-# @ECLASS_VARIABLE: CMAKE_MAKEFILE_GENERATOR
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Specify a makefile generator to be used by cmake.
-# At this point only "emake" and "ninja" are supported.
-# In EAPI 7 and above, the default is set to "ninja",
-# whereas in EAPIs below 7, it is set to "emake".
-
-# @ECLASS_VARIABLE: CMAKE_MIN_VERSION
-# @DESCRIPTION:
-# Specify the minimum required CMake version.
-: ${CMAKE_MIN_VERSION:=3.9.6}
-
-# @ECLASS_VARIABLE: CMAKE_REMOVE_MODULES
-# @DESCRIPTION:
-# Do we want to remove anything? yes or whatever else for no
-: ${CMAKE_REMOVE_MODULES:=yes}
-
-# @ECLASS_VARIABLE: CMAKE_REMOVE_MODULES_LIST
-# @DESCRIPTION:
-# Space-separated list of CMake modules that will be removed in $S during src_prepare,
-# in order to force packages to use the system version.
-: ${CMAKE_REMOVE_MODULES_LIST:=FindBLAS FindLAPACK}
-
-# @ECLASS_VARIABLE: CMAKE_USE_DIR
-# @DESCRIPTION:
-# Sets the directory where we are working with cmake.
-# For example when application uses autotools and only one
-# plugin needs to be done by cmake.
-# By default it uses ${S}.
-
-# @ECLASS_VARIABLE: CMAKE_VERBOSE
-# @DESCRIPTION:
-# Set to OFF to disable verbose messages during compilation
-: ${CMAKE_VERBOSE:=ON}
-
-# @ECLASS_VARIABLE: CMAKE_WARN_UNUSED_CLI
-# @DESCRIPTION:
-# Warn about variables that are declared on the command line
-# but not used. Might give false-positives.
-# "no" to disable (default) or anything else to enable.
-
-# @ECLASS_VARIABLE: CMAKE_EXTRA_CACHE_FILE
-# @USER_VARIABLE
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Specifies an extra cache file to pass to cmake. This is the analog of EXTRA_ECONF
-# for econf and is needed to pass TRY_RUN results when cross-compiling.
-# Should be set by user in a per-package basis in /etc/portage/package.env.
-
-# @ECLASS_VARIABLE: CMAKE_UTILS_QA_SRC_DIR_READONLY
-# @USER_VARIABLE
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# After running cmake-utils_src_prepare, sets ${S} to read-only. This is
-# a user flag and should under _no circumstances_ be set in the ebuild.
-# Helps in improving QA of build systems that write to source tree.
-
-case ${EAPI} in
- 5) : ${CMAKE_WARN_UNUSED_CLI:=no} ;;
- 6|7) : ${CMAKE_WARN_UNUSED_CLI:=yes} ;;
- *) die "EAPI=${EAPI:-0} is not supported" ;;
-esac
-
-inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils
-
-case ${EAPI} in
- [56])
- : ${CMAKE_MAKEFILE_GENERATOR:=emake}
- inherit eutils multilib
- ;;
- *)
- : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
- ;;
-esac
-
-EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
-
-if [[ ${WANT_CMAKE} ]]; then
- if [[ ${EAPI} != [56] ]]; then
- die "\${WANT_CMAKE} has been removed and is a no-op now"
- else
- eqawarn "\${WANT_CMAKE} has been removed and is a no-op now"
- fi
-fi
-[[ ${PREFIX} ]] && die "\${PREFIX} has been removed and is a no-op now"
-
-case ${CMAKE_MAKEFILE_GENERATOR} in
- emake)
- BDEPEND="sys-devel/make"
- ;;
- ninja)
- BDEPEND="dev-util/ninja"
- ;;
- *)
- eerror "Unknown value for \${CMAKE_MAKEFILE_GENERATOR}"
- die "Value ${CMAKE_MAKEFILE_GENERATOR} is not supported"
- ;;
-esac
-
-if [[ ${PN} != cmake ]]; then
- BDEPEND+=" >=dev-util/cmake-${CMAKE_MIN_VERSION}"
-fi
-
-case ${EAPI} in
- 7) ;;
- *) DEPEND=" ${BDEPEND}" ;;
-esac
-
-# Internal functions used by cmake-utils_use_*
-_cmake_use_me_now() {
- debug-print-function ${FUNCNAME} "$@"
-
- local arg=$2
- [[ ! -z $3 ]] && arg=$3
-
- [[ ${EAPI} == 5 ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead"
-
- local uper capitalised x
- [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
- if [[ ! -z $3 ]]; then
- # user specified the use name so use it
- echo "-D$1$3=$(use $2 && echo ON || echo OFF)"
- else
- # use all various most used combinations
- uper=$(echo ${2} | tr '[:lower:]' '[:upper:]')
- capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g')
- for x in $2 $uper $capitalised; do
- echo "-D$1$x=$(use $2 && echo ON || echo OFF) "
- done
- fi
-}
-_cmake_use_me_now_inverted() {
- debug-print-function ${FUNCNAME} "$@"
-
- local arg=$2
- [[ ! -z $3 ]] && arg=$3
-
- if [[ ${EAPI} != 5 && "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then
- die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead"
- fi
-
- local uper capitalised x
- [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
- if [[ ! -z $3 ]]; then
- # user specified the use name so use it
- echo "-D$1$3=$(use $2 && echo OFF || echo ON)"
- else
- # use all various most used combinations
- uper=$(echo ${2} | tr '[:lower:]' '[:upper:]')
- capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g')
- for x in $2 $uper $capitalised; do
- echo "-D$1$x=$(use $2 && echo OFF || echo ON) "
- done
- fi
-}
-
-# Determine using IN or OUT source build
-_cmake_check_build_dir() {
- : ${CMAKE_USE_DIR:=${S}}
- if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
- # we build in source dir
- BUILD_DIR="${CMAKE_USE_DIR}"
- else
- # Respect both the old variable and the new one, depending
- # on which one was set by the ebuild.
- if [[ ! ${BUILD_DIR} && ${CMAKE_BUILD_DIR} ]]; then
- if [[ ${EAPI} != [56] ]]; then
- eerror "The CMAKE_BUILD_DIR variable has been renamed to BUILD_DIR."
- die "The ebuild must be migrated to BUILD_DIR."
- else
- eqawarn "The CMAKE_BUILD_DIR variable has been renamed to BUILD_DIR."
- eqawarn "Please migrate the ebuild to use the new one."
- fi
-
- # In the next call, both variables will be set already
- # and we'd have to know which one takes precedence.
- _RESPECT_CMAKE_BUILD_DIR=1
- fi
-
- if [[ ${_RESPECT_CMAKE_BUILD_DIR} ]]; then
- BUILD_DIR=${CMAKE_BUILD_DIR:-${WORKDIR}/${P}_build}
- else
- : ${BUILD_DIR:=${WORKDIR}/${P}_build}
- fi
- fi
-
- # Backwards compatibility for getting the value.
- [[ ${EAPI} == [56] ]] && CMAKE_BUILD_DIR=${BUILD_DIR}
-
- mkdir -p "${BUILD_DIR}" || die
- echo ">>> Working in BUILD_DIR: \"$BUILD_DIR\""
-}
-
-# Determine which generator to use
-_cmake_generator_to_use() {
- local generator_name
-
- case ${CMAKE_MAKEFILE_GENERATOR} in
- ninja)
- # if ninja is enabled but not installed, the build could fail
- # this could happen if ninja is manually enabled (eg. make.conf) but not installed
- case ${EAPI} in
- 5|6)
- if ! ROOT=/ has_version dev-util/ninja; then
- die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR."
- fi
- ;;
- *)
- if ! has_version -b dev-util/ninja; then
- die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR."
- fi
- ;;
- esac
- generator_name="Ninja"
- ;;
- emake)
- generator_name="Unix Makefiles"
- ;;
- *)
- eerror "Unknown value for \${CMAKE_MAKEFILE_GENERATOR}"
- die "Value ${CMAKE_MAKEFILE_GENERATOR} is not supported"
- ;;
- esac
-
- echo ${generator_name}
-}
-
-# @FUNCTION: cmake_comment_add_subdirectory
-# @USAGE: <subdirectory>
-# @DESCRIPTION:
-# Comment out one or more add_subdirectory calls in CMakeLists.txt in the current directory
-cmake_comment_add_subdirectory() {
- if [[ -z ${1} ]]; then
- die "comment_add_subdirectory must be passed at least one directory name to comment"
- fi
-
- if [[ -e "CMakeLists.txt" ]]; then
- local d
- for d in $@; do
- sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \
- -i CMakeLists.txt || die "failed to comment add_subdirectory(${d})"
- done
- fi
-}
-
-# @FUNCTION: comment_add_subdirectory
-# @USAGE: <subdirectory>
-# @DESCRIPTION:
-# Comment out an add_subdirectory call in CMakeLists.txt in the current directory
-# Banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead.
-comment_add_subdirectory() {
- [[ ${EAPI} == 5 ]] || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead"
-
- cmake_comment_add_subdirectory "$@"
-}
-
-# @FUNCTION: cmake-utils_use_with
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_with. See ebuild(5).
-#
-# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled
-# and -DWITH_FOO=OFF if it is disabled.
-cmake-utils_use_with() { _cmake_use_me_now WITH_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_enable
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled
-# and -DENABLE_FOO=OFF if it is disabled.
-cmake-utils_use_enable() { _cmake_use_me_now ENABLE_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_find_package
-# @USAGE: <USE flag> <package name>
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_find_package foo LibFoo` echoes -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=OFF
-# if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=ON if it is disabled.
-# This can be used to make find_package optional.
-cmake-utils_use_find_package() {
- if [[ ${EAPI} != 5 && "$#" != 2 ]] ; then
- die "Usage: cmake-utils_use_find_package <USE flag> <package name>"
- fi
-
- _cmake_use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ;
-}
-
-# @FUNCTION: cmake_use_find_package
-# @USAGE: <USE flag> <package name>
-# @DESCRIPTION:
-# Alias for cmake-utils_use_find_package.
-cmake_use_find_package() {
- if [[ "$#" != 2 ]] ; then
- die "Usage: cmake_use_find_package <USE flag> <package name>"
- fi
-
- cmake-utils_use_find_package "$@" ;
-}
-
-# @FUNCTION: cmake-utils_use_disable
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on inversion of use_enable. See ebuild(5).
-#
-# `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled
-# and -DDISABLE_FOO=ON if it is disabled.
-cmake-utils_use_disable() { _cmake_use_me_now_inverted DISABLE_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_no
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_disable. See ebuild(5).
-#
-# `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled
-# and -DNO_FOO=ON if it is disabled.
-cmake-utils_use_no() { _cmake_use_me_now_inverted NO_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_want
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled
-# and -DWANT_FOO=OFF if it is disabled.
-cmake-utils_use_want() { _cmake_use_me_now WANT_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_build
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled
-# and -DBUILD_FOO=OFF if it is disabled.
-cmake-utils_use_build() { _cmake_use_me_now BUILD_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_has
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled
-# and -DHAVE_FOO=OFF if it is disabled.
-cmake-utils_use_has() { _cmake_use_me_now HAVE_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_use
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_use foo FOO` echoes -DUSE_FOO=ON if foo is enabled
-# and -DUSE_FOO=OFF if it is disabled.
-cmake-utils_use_use() { _cmake_use_me_now USE_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use foo FOO` echoes -DFOO=ON if foo is enabled
-# and -DFOO=OFF if it is disabled.
-cmake-utils_use() { _cmake_use_me_now "" "$@" ; }
-
-# @FUNCTION: cmake-utils_useno
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_useno foo NOFOO` echoes -DNOFOO=OFF if foo is enabled
-# and -DNOFOO=ON if it is disabled.
-cmake-utils_useno() { _cmake_use_me_now_inverted "" "$@" ; }
-
-# Internal function for modifying hardcoded definitions.
-# Removes dangerous definitions that override Gentoo settings.
-_cmake_modify-cmakelists() {
- debug-print-function ${FUNCNAME} "$@"
-
- # Only edit the files once
- grep -qs "<<< Gentoo configuration >>>" "${CMAKE_USE_DIR}"/CMakeLists.txt && return 0
-
- # Comment out all set (<some_should_be_user_defined_variable> value)
- find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec sed \
- -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE\([[:space:]].*)\|)\)/I{s/^/#_cmake_modify_IGNORE /g}' \
- -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
- -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
- -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
- -i {} + || die "${LINENO}: failed to disable hardcoded settings"
- local x
- for x in $(find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec grep -l "^#_cmake_modify_IGNORE" {} +;); do
- einfo "Hardcoded definition(s) removed in $(echo "${x}" | cut -c $((${#CMAKE_USE_DIR}+2))-):"
- einfo "$(grep -se '^#_cmake_modify_IGNORE' ${x} | cut -c 22-99)"
- done
-
- # NOTE Append some useful summary here
- cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_ || die
-
- MESSAGE(STATUS "<<< Gentoo configuration >>>
- Build type \${CMAKE_BUILD_TYPE}
- Install path \${CMAKE_INSTALL_PREFIX}
- Compiler flags:
- C \${CMAKE_C_FLAGS}
- C++ \${CMAKE_CXX_FLAGS}
- Linker flags:
- Executable \${CMAKE_EXE_LINKER_FLAGS}
- Module \${CMAKE_MODULE_LINKER_FLAGS}
- Shared \${CMAKE_SHARED_LINKER_FLAGS}\n")
- _EOF_
-}
-
-# temporary function for moving cmake cleanups from from src_configure -> src_prepare.
-# bug #378850
-_cmake_cleanup_cmake() {
- : ${CMAKE_USE_DIR:=${S}}
-
- if [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] ; then
- local name
- for name in ${CMAKE_REMOVE_MODULES_LIST} ; do
- find "${S}" -name ${name}.cmake -exec rm -v {} + || die
- done
- fi
-
- # check if CMakeLists.txt exist and if no then die
- if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
- eerror "Unable to locate CMakeLists.txt under:"
- eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\""
- eerror "Consider not inheriting the cmake eclass."
- die "FATAL: Unable to find CMakeLists.txt"
- fi
-
- # Remove dangerous things.
- _cmake_modify-cmakelists
-}
-
-# @FUNCTION: cmake-utils_src_prepare
-# @DESCRIPTION:
-# Apply ebuild and user patches.
-cmake-utils_src_prepare() {
- debug-print-function ${FUNCNAME} "$@"
-
- pushd "${S}" > /dev/null || die
-
- if [[ ${EAPI} != 5 ]]; then
- default_src_prepare
- _cmake_cleanup_cmake
- else
- debug-print "$FUNCNAME: PATCHES=$PATCHES"
- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
-
- debug-print "$FUNCNAME: applying user patches"
- epatch_user
- fi
-
- popd > /dev/null || die
-
- # make ${S} read-only in order to detect broken build-systems
- if [[ ${CMAKE_UTILS_QA_SRC_DIR_READONLY} && ! ${CMAKE_IN_SOURCE_BUILD} ]]; then
- chmod -R a-w "${S}"
- fi
-
- _CMAKE_UTILS_SRC_PREPARE_HAS_RUN=1
-}
-
-# @VARIABLE: mycmakeargs
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Optional cmake defines as a bash array. Should be defined before calling
-# src_configure.
-# @CODE
-# src_configure() {
-# local mycmakeargs=(
-# $(cmake-utils_use_with openconnect)
-# )
-#
-# cmake-utils_src_configure
-# }
-# @CODE
-
-# @FUNCTION: cmake-utils_src_configure
-# @DESCRIPTION:
-# General function for configuring with cmake. Default behaviour is to start an
-# out-of-source build.
-cmake-utils_src_configure() {
- debug-print-function ${FUNCNAME} "$@"
-
- if [[ ! ${_CMAKE_UTILS_SRC_PREPARE_HAS_RUN} ]]; then
- if [[ ${EAPI} != [56] ]]; then
- die "FATAL: cmake-utils_src_prepare has not been run"
- else
- eqawarn "cmake-utils_src_prepare has not been run, please open a bug on https://bugs.gentoo.org/"
- fi
- fi
-
- [[ ${EAPI} == 5 ]] && _cmake_cleanup_cmake
-
- _cmake_check_build_dir
-
- # Fix xdg collision with sandbox
- xdg_environment_reset
-
- # @SEE CMAKE_BUILD_TYPE
- if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then
- # Handle release builds
- if ! has debug ${IUSE//+} || ! use debug; then
- local CPPFLAGS=${CPPFLAGS}
- append-cppflags -DNDEBUG
- fi
- fi
-
- # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.)
- local build_rules=${BUILD_DIR}/gentoo_rules.cmake
-
- cat > "${build_rules}" <<- _EOF_ || die
- SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
- SET (CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM-ATT_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c -x assembler <SOURCE>" CACHE STRING "ASM-ATT compile command" FORCE)
- SET (CMAKE_ASM-ATT_LINK_FLAGS "-nostdlib" CACHE STRING "ASM-ATT link flags" FORCE)
- SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
- SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
- SET (CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE)
- _EOF_
-
- local myCC=$(tc-getCC) myCXX=$(tc-getCXX) myFC=$(tc-getFC)
-
- # !!! IMPORTANT NOTE !!!
- # Single slash below is intentional. CMake is weird and wants the
- # CMAKE_*_VARIABLES split into two elements: the first one with
- # compiler path, and the second one with all command-line options,
- # space separated.
- local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake
- cat > ${toolchain_file} <<- _EOF_ || die
- SET (CMAKE_ASM_COMPILER "${myCC/ /;}")
- SET (CMAKE_ASM-ATT_COMPILER "${myCC/ /;}")
- SET (CMAKE_C_COMPILER "${myCC/ /;}")
- SET (CMAKE_CXX_COMPILER "${myCXX/ /;}")
- SET (CMAKE_Fortran_COMPILER "${myFC/ /;}")
- SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
- SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE)
- SET (CMAKE_SYSTEM_PROCESSOR "${CHOST%%-*}")
- _EOF_
-
- # We are using the C compiler for assembly by default.
- local -x ASMFLAGS=${CFLAGS}
- local -x PKG_CONFIG=$(tc-getPKG_CONFIG)
-
- if tc-is-cross-compiler; then
- local sysname
- case "${KERNEL:-linux}" in
- Cygwin) sysname="CYGWIN_NT-5.1" ;;
- HPUX) sysname="HP-UX" ;;
- linux) sysname="Linux" ;;
- Winnt)
- sysname="Windows"
- cat >> "${toolchain_file}" <<- _EOF_ || die
- SET (CMAKE_RC_COMPILER $(tc-getRC))
- _EOF_
- ;;
- *) sysname="${KERNEL}" ;;
- esac
-
- cat >> "${toolchain_file}" <<- _EOF_ || die
- SET (CMAKE_SYSTEM_NAME "${sysname}")
- _EOF_
-
- if [ "${SYSROOT:-/}" != "/" ] ; then
- # When cross-compiling with a sysroot (e.g. with crossdev's emerge wrappers)
- # we need to tell cmake to use libs/headers from the sysroot but programs from / only.
- cat >> "${toolchain_file}" <<- _EOF_ || die
- SET (CMAKE_FIND_ROOT_PATH "${SYSROOT}")
- SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
- SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
- SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
- _EOF_
- fi
- fi
-
- if use prefix-guest; then
- cat >> "${build_rules}" <<- _EOF_ || die
- # in Prefix we need rpath and must ensure cmake gets our default linker path
- # right ... except for Darwin hosts
- IF (NOT APPLE)
- SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
- SET (CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)"
- CACHE STRING "" FORCE)
-
- ELSE ()
-
- SET (CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE)
- SET (CMAKE_MACOSX_RPATH ON CACHE BOOL "" FORCE)
- SET (CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE)
- SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
- SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE)
-
- ENDIF (NOT APPLE)
- _EOF_
- fi
-
- # Common configure parameters (invariants)
- local common_config=${BUILD_DIR}/gentoo_common_config.cmake
- local libdir=$(get_libdir)
- cat > "${common_config}" <<- _EOF_ || die
- SET (CMAKE_GENTOO_BUILD ON CACHE BOOL "Indicate Gentoo package build")
- SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
- SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
- SET (CMAKE_INSTALL_INFODIR "${EPREFIX}/usr/share/info" CACHE PATH "")
- SET (CMAKE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "")
- SET (CMAKE_USER_MAKE_RULES_OVERRIDE "${build_rules}" CACHE FILEPATH "Gentoo override rules")
- _EOF_
-
- # See bug 689410
- if [[ "${ARCH}" == riscv ]]; then
- echo 'SET (CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '"${libdir#lib}"' CACHE STRING "library search suffix" FORCE)' >> "${common_config}" || die
- fi
-
- [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
-
- if [[ ${EAPI} != [56] ]]; then
- cat >> "${common_config}" <<- _EOF_ || die
- SET (CMAKE_INSTALL_DOCDIR "${EPREFIX}/usr/share/doc/${PF}" CACHE PATH "")
- SET (BUILD_SHARED_LIBS ON CACHE BOOL "")
- _EOF_
- fi
-
- # Wipe the default optimization flags out of CMake
- if [[ ${CMAKE_BUILD_TYPE} != Gentoo && ${EAPI} != 5 ]]; then
- cat >> ${common_config} <<- _EOF_ || die
- SET (CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- SET (CMAKE_ASM-ATT_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- SET (CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- SET (CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- SET (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- SET (CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- SET (CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- SET (CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- SET (CMAKE_STATIC_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
- _EOF_
- fi
-
- # Convert mycmakeargs to an array, for backwards compatibility
- # Make the array a local variable since <=portage-2.1.6.x does not
- # support global arrays (see bug #297255).
- local mycmakeargstype=$(declare -p mycmakeargs 2>&-)
- if [[ "${mycmakeargstype}" != "declare -a mycmakeargs="* ]]; then
- if [[ -n "${mycmakeargstype}" ]] ; then
- if [[ ${EAPI} == 5 ]]; then
- eqawarn "Declaring mycmakeargs as a variable is deprecated. Please use an array instead."
- else
- die "Declaring mycmakeargs as a variable is banned in EAPI=${EAPI}. Please use an array instead."
- fi
- fi
- local mycmakeargs_local=(${mycmakeargs})
- else
- local mycmakeargs_local=("${mycmakeargs[@]}")
- fi
-
- if [[ ${CMAKE_WARN_UNUSED_CLI} == no ]] ; then
- local warn_unused_cli="--no-warn-unused-cli"
- else
- local warn_unused_cli=""
- fi
-
- # Common configure parameters (overridable)
- # NOTE CMAKE_BUILD_TYPE can be only overridden via CMAKE_BUILD_TYPE eclass variable
- # No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect.
- local cmakeargs=(
- ${warn_unused_cli}
- -C "${common_config}"
- -G "$(_cmake_generator_to_use)"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
- "${mycmakeargs_local[@]}"
- -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
- $([[ ${EAPI} == 5 ]] && echo -DCMAKE_INSTALL_DO_STRIP=OFF)
- -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}"
- "${MYCMAKEARGS}"
- )
-
- if [[ -n "${CMAKE_EXTRA_CACHE_FILE}" ]] ; then
- cmakeargs+=( -C "${CMAKE_EXTRA_CACHE_FILE}" )
- fi
-
- pushd "${BUILD_DIR}" > /dev/null || die
- debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
- echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
- "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
- popd > /dev/null || die
-}
-
-# @FUNCTION: cmake-utils_src_compile
-# @DESCRIPTION:
-# General function for compiling with cmake.
-# Automatically detects the build type. All arguments are passed to emake.
-cmake-utils_src_compile() {
- debug-print-function ${FUNCNAME} "$@"
-
- cmake-utils_src_make "$@"
-}
-
-# @FUNCTION: _cmake_ninja_src_make
-# @INTERNAL
-# @DESCRIPTION:
-# Build the package using ninja generator
-_cmake_ninja_src_make() {
- debug-print-function ${FUNCNAME} "$@"
-
- [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage."
-
- eninja "$@"
-}
-
-# @FUNCTION: _cmake_emake_src_make
-# @INTERNAL
-# @DESCRIPTION:
-# Build the package using make generator
-_cmake_emake_src_make() {
- debug-print-function ${FUNCNAME} "$@"
-
- [[ -e Makefile ]] || die "Makefile not found. Error during configure stage."
-
- if [[ "${CMAKE_VERBOSE}" != "OFF" ]]; then
- emake VERBOSE=1 "$@" || die
- else
- emake "$@" || die
- fi
-
-}
-
-# @FUNCTION: cmake-utils_src_make
-# @DESCRIPTION:
-# Function for building the package. Automatically detects the build type.
-# All arguments are passed to emake.
-cmake-utils_src_make() {
- debug-print-function ${FUNCNAME} "$@"
-
- _cmake_check_build_dir
- pushd "${BUILD_DIR}" > /dev/null || die
-
- _cmake_${CMAKE_MAKEFILE_GENERATOR}_src_make "$@"
-
- popd > /dev/null || die
-}
-
-# @FUNCTION: cmake-utils_src_test
-# @DESCRIPTION:
-# Function for testing the package. Automatically detects the build type.
-cmake-utils_src_test() {
- debug-print-function ${FUNCNAME} "$@"
-
- _cmake_check_build_dir
- pushd "${BUILD_DIR}" > /dev/null || die
- [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
-
- [[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure )
-
- set -- ctest -j "$(makeopts_jobs "${MAKEOPTS}" 999)" \
- --test-load "$(makeopts_loadavg)" "${myctestargs[@]}" "$@"
- echo "$@" >&2
- if "$@" ; then
- einfo "Tests succeeded."
- popd > /dev/null || die
- return 0
- else
- if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then
- # on request from Diego
- eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:"
- eerror "--START TEST LOG--------------------------------------------------------------"
- cat "${BUILD_DIR}/Testing/Temporary/LastTest.log"
- eerror "--END TEST LOG----------------------------------------------------------------"
- die "Tests failed."
- else
- die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log"
- fi
-
- # die might not die due to nonfatal
- popd > /dev/null || die
- return 1
- fi
-}
-
-# @FUNCTION: cmake-utils_src_install
-# @DESCRIPTION:
-# Function for installing the package. Automatically detects the build type.
-cmake-utils_src_install() {
- debug-print-function ${FUNCNAME} "$@"
-
- _cmake_check_build_dir
- pushd "${BUILD_DIR}" > /dev/null || die
- DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" || die "died running ${CMAKE_MAKEFILE_GENERATOR} install"
- popd > /dev/null || die
-
- pushd "${S}" > /dev/null || die
- einstalldocs
- popd > /dev/null || die
-}
-
-fi
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 4e8c2d67db0..60f81473c0a 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -205,27 +205,33 @@ _distutils_set_globals() {
fi
bdep='
- >=dev-python/gpep517-3[${PYTHON_USEDEP}]'
+ >=dev-python/gpep517-8[${PYTHON_USEDEP}]
+ '
case ${DISTUTILS_USE_PEP517} in
flit)
bdep+='
- >=dev-python/flit_core-3.7.1[${PYTHON_USEDEP}]'
+ >=dev-python/flit_core-3.7.1[${PYTHON_USEDEP}]
+ '
;;
flit_scm)
bdep+='
- dev-python/flit_scm[${PYTHON_USEDEP}]'
+ dev-python/flit_scm[${PYTHON_USEDEP}]
+ '
;;
hatchling)
bdep+='
- >=dev-python/hatchling-0.22.0[${PYTHON_USEDEP}]'
+ >=dev-python/hatchling-1.3.1[${PYTHON_USEDEP}]
+ '
;;
jupyter)
bdep+='
- >=dev-python/jupyter_packaging-0.11.1[${PYTHON_USEDEP}]'
+ >=dev-python/jupyter_packaging-0.12.0-r1[${PYTHON_USEDEP}]
+ '
;;
maturin)
bdep+='
- >=dev-util/maturin-0.12.7[${PYTHON_USEDEP}]'
+ >=dev-util/maturin-0.12.20[${PYTHON_USEDEP}]
+ '
;;
no)
# undo the generic deps added above
@@ -233,28 +239,34 @@ _distutils_set_globals() {
;;
meson-python)
bdep+='
- dev-python/meson-python[${PYTHON_USEDEP}]'
+ dev-python/meson-python[${PYTHON_USEDEP}]
+ '
;;
pbr)
bdep+='
- >=dev-python/pbr-5.8.0-r1[${PYTHON_USEDEP}]'
+ >=dev-python/pbr-5.9.0[${PYTHON_USEDEP}]
+ '
;;
pdm)
bdep+='
- >=dev-python/pdm-pep517-0.12.3[${PYTHON_USEDEP}]'
+ >=dev-python/pdm-pep517-1.0.2[${PYTHON_USEDEP}]
+ '
;;
poetry)
bdep+='
- >=dev-python/poetry-core-1.0.8[${PYTHON_USEDEP}]'
+ >=dev-python/poetry-core-1.0.8[${PYTHON_USEDEP}]
+ '
;;
setuptools)
bdep+='
- >=dev-python/setuptools-60.5.0[${PYTHON_USEDEP}]
- dev-python/wheel[${PYTHON_USEDEP}]'
+ >=dev-python/setuptools-62.6.0[${PYTHON_USEDEP}]
+ dev-python/wheel[${PYTHON_USEDEP}]
+ '
;;
sip)
bdep+='
- >=dev-python/sip-6.5.0-r1[${PYTHON_USEDEP}]'
+ >=dev-python/sip-6.6.2[${PYTHON_USEDEP}]
+ '
;;
standalone)
;;
@@ -473,7 +485,7 @@ distutils_enable_sphinx() {
_DISTUTILS_SPHINX_PLUGINS=( "${@}" )
local deps autodoc=1 d
- deps=">=dev-python/sphinx-4.4.0[\${PYTHON_USEDEP}]"
+ deps=">=dev-python/sphinx-4.5.0-r1[\${PYTHON_USEDEP}]"
for d; do
if [[ ${d} == --no-autodoc ]]; then
autodoc=
@@ -497,7 +509,7 @@ distutils_enable_sphinx() {
use doc || return 0
local p
- for p in ">=dev-python/sphinx-4.4.0" \
+ for p in ">=dev-python/sphinx-4.5.0-r1" \
"${_DISTUTILS_SPHINX_PLUGINS[@]}"
do
python_has_version "${p}[${PYTHON_USEDEP}]" ||
@@ -505,7 +517,7 @@ distutils_enable_sphinx() {
done
}
else
- deps=">=dev-python/sphinx-4.4.0"
+ deps=">=dev-python/sphinx-4.5.0-r1"
fi
sphinx_compile_all() {
@@ -585,10 +597,10 @@ distutils_enable_tests() {
local test_pkg
case ${1} in
nose)
- test_pkg=">=dev-python/nose-1.3.7-r4"
+ test_pkg=">=dev-python/nose-1.3.7_p20211111_p1-r1"
;;
pytest)
- test_pkg=">=dev-python/pytest-7.0.1"
+ test_pkg=">=dev-python/pytest-7.1.2"
;;
setup.py)
;;
@@ -872,10 +884,10 @@ _distutils-r1_handle_pyproject_toml() {
if [[ ! -f setup.py && -f pyproject.toml ]]; then
if [[ ${DISTUTILS_USE_SETUPTOOLS} != pyproject.toml ]]; then
- eerror "No setup.py found but pyproject.toml is present. In order to enable"
- eerror "pyproject.toml support in distutils-r1, set:"
- eerror " DISTUTILS_USE_SETUPTOOLS=pyproject.toml"
- die "No setup.py found and DISTUTILS_USE_SETUPTOOLS!=pyproject.toml"
+ eerror "No setup.py found but pyproject.toml is present. Please migrate"
+ eerror "the package to use DISTUTILS_USE_PEP517. See:"
+ eerror " https://projects.gentoo.org/python/guide/distutils.html"
+ die "No setup.py found and PEP517 mode not enabled"
fi
fi
}
@@ -1239,6 +1251,56 @@ _distutils-r1_get_backend() {
echo "${build_backend}"
}
+# @FUNCTION: distutils_wheel_install
+# @USAGE: <root> <wheel>
+# @DESCRIPTION:
+# Install the specified wheel into <root>.
+#
+# This function is intended for expert use only.
+distutils_wheel_install() {
+ debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${#} -ne 2 ]]; then
+ die "${FUNCNAME} takes exactly two arguments: <root> <wheel>"
+ fi
+ if [[ -z ${PYTHON} ]]; then
+ die "PYTHON unset, invalid call context"
+ fi
+
+ local root=${1}
+ local wheel=${2}
+
+ einfo " Installing ${wheel##*/} to ${root}"
+ if has_version -b ">=dev-python/gpep517-9"; then
+ # TODO: inline when we dep on >=9
+ local cmd=(
+ gpep517 install-wheel
+ --destdir="${root}"
+ --interpreter="${PYTHON}"
+ --prefix="${EPREFIX}/usr"
+ --optimize=all
+ "${wheel}"
+ )
+ else
+ local cmd=(
+ gpep517 install-wheel
+ --destdir="${root}"
+ --interpreter="${PYTHON}"
+ --prefix="${EPREFIX}/usr"
+ "${wheel}"
+ )
+ fi
+ printf '%s\n' "${cmd[*]}"
+ "${cmd[@]}" || die "Wheel install failed"
+
+ # remove installed licenses
+ find "${root}$(python_get_sitedir)" -depth \
+ \( -path '*.dist-info/COPYING*' \
+ -o -path '*.dist-info/LICENSE*' \
+ -o -path '*.dist-info/license_files/*' \
+ -o -path '*.dist-info/license_files' \
+ \) -delete || die
+}
+
# @FUNCTION: distutils_pep517_install
# @USAGE: <root>
# @DESCRIPTION:
@@ -1310,27 +1372,20 @@ distutils_pep517_install() {
local config_args=()
[[ -n ${config_settings} ]] &&
config_args+=( --config-json "${config_settings}" )
+ local cmd=(
+ gpep517 build-wheel
+ --backend "${build_backend}"
+ --output-fd 3
+ --wheel-dir "${WHEEL_BUILD_DIR}"
+ "${config_args[@]}"
+ )
+ printf '%s\n' "${cmd[*]}"
local wheel=$(
- gpep517 build-wheel --backend "${build_backend}" \
- --output-fd 3 \
- --wheel-dir "${WHEEL_BUILD_DIR}" \
- "${config_args[@]}" 3>&1 >&2 ||
- die "Wheel build failed"
+ "${cmd[@]}" 3>&1 >&2 || die "Wheel build failed"
)
[[ -n ${wheel} ]] || die "No wheel name returned"
- einfo " Installing ${wheel} to ${root}"
- gpep517 install-wheel --destdir="${root}" --interpreter="${PYTHON}" \
- --prefix="${EPREFIX}/usr" "${WHEEL_BUILD_DIR}/${wheel}" ||
- die "Wheel install failed"
-
- # remove installed licenses
- find "${root}$(python_get_sitedir)" -depth \
- \( -path '*.dist-info/COPYING*' \
- -o -path '*.dist-info/LICENSE*' \
- -o -path '*.dist-info/license_files/*' \
- -o -path '*.dist-info/license_files' \
- \) -delete || die
+ distutils_wheel_install "${root}" "${WHEEL_BUILD_DIR}/${wheel}"
# clean the build tree; otherwise we may end up with PyPy3
# extensions duplicated into CPython dists
@@ -1399,12 +1454,22 @@ distutils-r1_python_compile() {
fi
;;
maturin)
- # auditwheel may attempt to auto-bundle libraries, bug #831171
- local -x MATURIN_PEP517_ARGS=--skip-auditwheel
-
- # support cargo.eclass' IUSE=debug if available
- in_iuse debug && use debug &&
- MATURIN_PEP517_ARGS+=" --cargo-extra-args=--profile=dev"
+ if has_version '>=dev-util/maturin-0.13'; then
+ # auditwheel may auto-bundle libraries (bug #831171),
+ # also support cargo.eclass' IUSE=debug if available
+ local -x MATURIN_PEP517_ARGS="
+ --jobs=$(makeopts_jobs)
+ --skip-auditwheel
+ $(in_iuse debug && usex debug --profile=dev '')
+ "
+ else
+ # legacy support, can cleanup when depend on >=0.13
+ local -x MATURIN_PEP517_ARGS="
+ --skip-auditwheel
+ $(in_iuse debug && usex debug \
+ --cargo-extra-args=--profile=dev '')
+ "
+ fi
;;
no)
return
@@ -1412,13 +1477,6 @@ distutils-r1_python_compile() {
esac
if [[ ${DISTUTILS_USE_PEP517} ]]; then
- # python likes to compile any module it sees, which triggers sandbox
- # failures if some packages haven't compiled their modules yet.
- addpredict "${EPREFIX}/usr/lib/${EPYTHON}"
- addpredict /usr/lib/pypy3.8
- addpredict /usr/lib/portage/pym
- addpredict /usr/local # bug 498232
-
distutils_pep517_install "${BUILD_DIR}/install"
fi
}
@@ -1547,20 +1605,25 @@ distutils-r1_python_install() {
# remove files that we've created explicitly
rm "${reg_scriptdir}"/{"${EPYTHON}",python3,python,pyvenv.cfg} || die
- # verify that scriptdir & wrapped_scriptdir both contain
- # the same files
- (
- cd "${reg_scriptdir}" && find . -mindepth 1
- ) | sort > "${T}"/.distutils-files-bin
- assert "listing ${reg_scriptdir} failed"
- (
- if [[ -d ${wrapped_scriptdir} ]]; then
- cd "${wrapped_scriptdir}" && find . -mindepth 1
+
+ # Automagically do the QA check to avoid issues when bootstrapping
+ # prefix.
+ if type diff &>/dev/null ; then
+ # verify that scriptdir & wrapped_scriptdir both contain
+ # the same files
+ (
+ cd "${reg_scriptdir}" && find . -mindepth 1
+ ) | sort > "${T}"/.distutils-files-bin
+ assert "listing ${reg_scriptdir} failed"
+ (
+ if [[ -d ${wrapped_scriptdir} ]]; then
+ cd "${wrapped_scriptdir}" && find . -mindepth 1
+ fi
+ ) | sort > "${T}"/.distutils-files-wrapped
+ assert "listing ${wrapped_scriptdir} failed"
+ if ! diff -U 0 "${T}"/.distutils-files-{bin,wrapped}; then
+ die "File lists for ${reg_scriptdir} and ${wrapped_scriptdir} differ (see diff above)"
fi
- ) | sort > "${T}"/.distutils-files-wrapped
- assert "listing ${wrapped_scriptdir} failed"
- if ! diff -U 0 "${T}"/.distutils-files-{bin,wrapped}; then
- die "File lists for ${reg_scriptdir} and ${wrapped_scriptdir} differ (see diff above)"
fi
# remove the altered bindir, executables from the package
@@ -1596,9 +1659,8 @@ distutils-r1_python_install() {
# python likes to compile any module it sees, which triggers sandbox
# failures if some packages haven't compiled their modules yet.
addpredict "${EPREFIX}/usr/lib/${EPYTHON}"
- addpredict /usr/lib/pypy3.8
- addpredict /usr/lib/portage/pym
- addpredict /usr/local # bug 498232
+ addpredict "${EPREFIX}/usr/lib/pypy3.9"
+ addpredict "${EPREFIX}/usr/local" # bug 498232
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
merge_root=1
@@ -1944,9 +2006,13 @@ _distutils-r1_post_python_install() {
done
if [[ ${DISTUTILS_USE_PEP517} ]]; then
- # we need to recompile everything here in order to embed
- # the correct paths
- python_optimize "${sitedir}"
+ if ! has_version -b ">=dev-python/gpep517-9"
+ then
+ # TODO: remove when we dep on >=9
+ # we need to recompile everything here in order to embed
+ # the correct paths
+ python_optimize "${sitedir}"
+ fi
fi
fi
}
diff --git a/eclass/dotnet.eclass b/eclass/dotnet.eclass
index 3affc00ba45..319fde89311 100644
--- a/eclass/dotnet.eclass
+++ b/eclass/dotnet.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: dotnet.eclass
@@ -12,7 +12,7 @@
# MONO_SHARED_DIR and sets LC_ALL in order to prevent errors during compilation
# of dotnet packages.
-case ${EAPI:-0} in
+case ${EAPI} in
6)
inherit eapi7-ver multilib
DEPEND="dev-lang/mono"
@@ -98,7 +98,6 @@ exbuild() {
# @DESCRIPTION:
# Install package to GAC.
egacinstall() {
- use !prefix && has "${EAPI:-0}" 0 1 2 && ED="${D}"
gacutil -i "${1}" \
-root "${ED}"/usr/$(get_libdir) \
-gacdir /usr/$(get_libdir) \
@@ -110,7 +109,6 @@ egacinstall() {
# @DESCRIPTION:
# multilib comply
dotnet_multilib_comply() {
- use !prefix && has "${EAPI:-0}" 0 1 2 && ED="${D}"
local dir finddirs=() mv_command=${mv_command:-mv}
if [[ -d "${ED}/usr/lib" && "$(get_libdir)" != "lib" ]]
then
diff --git a/eclass/epatch.eclass b/eclass/epatch.eclass
index 6a9c460da0a..07f802583fc 100644
--- a/eclass/epatch.eclass
+++ b/eclass/epatch.eclass
@@ -4,7 +4,7 @@
# @ECLASS: epatch.eclass
# @MAINTAINER:
# base-system@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6
+# @SUPPORTED_EAPIS: 6
# @BLURB: easy patch application functions
# @DEPRECATED: eapply from EAPI 7
# @DESCRIPTION:
@@ -13,11 +13,9 @@
if [[ -z ${_EPATCH_ECLASS} ]]; then
-case ${EAPI:-0} in
- 0|1|2|3|4|5|6)
- ;;
- *)
- die "${ECLASS}: banned in EAPI=${EAPI}; use eapply* instead";;
+case ${EAPI} in
+ 6) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
inherit estack
@@ -52,10 +50,6 @@ EPATCH_COMMON_OPTS="-g0 -E --no-backup-if-mismatch"
# List of patches not to apply. Note this is only file names,
# and not the full path. Globs accepted.
EPATCH_EXCLUDE=""
-# @VARIABLE: EPATCH_SINGLE_MSG
-# @DESCRIPTION:
-# Change the printed message for a single patch.
-EPATCH_SINGLE_MSG=""
# @VARIABLE: EPATCH_MULTI_MSG
# @DESCRIPTION:
# Change the printed message for multiple patches.
@@ -235,13 +229,9 @@ epatch() {
fi
if [[ ${SINGLE_PATCH} == "yes" ]] ; then
- if [[ -n ${EPATCH_SINGLE_MSG} ]] ; then
- einfo "${EPATCH_SINGLE_MSG}"
- else
- einfo "Applying ${patchname} ..."
- fi
+ ebegin "Applying ${patchname}"
else
- einfo " ${patchname} ..."
+ ebegin " ${patchname}"
fi
# Handle aliased patch command #404447 #461568
@@ -386,85 +376,5 @@ epatch() {
: # everything worked
}
-case ${EAPI:-0} in
-0|1|2|3|4|5)
-
-# @ECLASS_VARIABLE: EPATCH_USER_SOURCE
-# @USER_VARIABLE
-# @DESCRIPTION:
-# Location for user patches, see the epatch_user function.
-# Should be set by the user. Don't set this in ebuilds.
-: ${EPATCH_USER_SOURCE:=${PORTAGE_CONFIGROOT%/}/etc/portage/patches}
-
-# @FUNCTION: epatch_user
-# @USAGE:
-# @DESCRIPTION:
-# Applies user-provided patches to the source tree. The patches are
-# taken from /etc/portage/patches/<CATEGORY>/<P-PR|P|PN>[:SLOT]/, where the first
-# of these three directories to exist will be the one to use, ignoring
-# any more general directories which might exist as well. They must end
-# in ".patch" to be applied.
-#
-# User patches are intended for quick testing of patches without ebuild
-# modifications, as well as for permanent customizations a user might
-# desire. Obviously, there can be no official support for arbitrarily
-# patched ebuilds. So whenever a build log in a bug report mentions that
-# user patches were applied, the user should be asked to reproduce the
-# problem without these.
-#
-# Not all ebuilds do call this function, so placing patches in the
-# stated directory might or might not work, depending on the package and
-# the eclasses it inherits and uses. It is safe to call the function
-# repeatedly, so it is always possible to add a call at the ebuild
-# level. The first call is the time when the patches will be
-# applied.
-#
-# Ideally, this function should be called after gentoo-specific patches
-# have been applied, so that their code can be modified as well, but
-# before calls to e.g. eautoreconf, as the user patches might affect
-# autotool input files as well.
-epatch_user() {
- [[ $# -ne 0 ]] && die "epatch_user takes no options"
-
- # Allow multiple calls to this function; ignore all but the first
- local applied="${T}/epatch_user.log"
- [[ -e ${applied} ]] && return 2
-
- # don't clobber any EPATCH vars that the parent might want
- local EPATCH_SOURCE check
- for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
- EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CTARGET}/${check}
- [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CHOST}/${check}
- [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${check}
- if [[ -d ${EPATCH_SOURCE} ]] ; then
- local old_n_applied_patches=${EPATCH_N_APPLIED_PATCHES:-0}
- EPATCH_SOURCE=${EPATCH_SOURCE} \
- EPATCH_SUFFIX="patch" \
- EPATCH_FORCE="yes" \
- EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \
- epatch
- echo "${EPATCH_SOURCE}" > "${applied}"
- if [[ ${old_n_applied_patches} -lt ${EPATCH_N_APPLIED_PATCHES} ]]; then
- has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || \
- EBUILD_DEATH_HOOKS+=" epatch_user_death_notice"
- fi
- return 0
- fi
- done
- echo "none" > "${applied}"
- return 1
-}
-
-# @FUNCTION: epatch_user_death_notice
-# @INTERNAL
-# @DESCRIPTION:
-# Include an explicit notice in the die message itself that user patches were
-# applied to this build.
-epatch_user_death_notice() {
- ewarn "!!! User patches were applied to this build!"
-}
-
-esac
-
_EPATCH_ECLASS=1
fi #_EPATCH_ECLASS
diff --git a/eclass/eqawarn.eclass b/eclass/eqawarn.eclass
new file mode 100644
index 00000000000..288976182fb
--- /dev/null
+++ b/eclass/eqawarn.eclass
@@ -0,0 +1,26 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: eqawarn.eclass
+# @MAINTAINER:
+# base-system@gentoo.org
+# @SUPPORTED_EAPIS: 6
+# @BLURB: output a QA warning
+
+case ${EAPI} in
+ 6) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+# @FUNCTION: eqawarn
+# @USAGE: [message]
+# @DESCRIPTION:
+# Proxy to ewarn for package managers that don't provide eqawarn and
+# use the PM implementation if available. Reuses PORTAGE_ELOG_CLASSES
+# as set by the dev profile.
+if ! declare -F eqawarn >/dev/null ; then
+ eqawarn() {
+ has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@"
+ :
+ }
+fi
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 207d05e7f97..3b6a90fecb8 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -1,72 +1,28 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: eutils.eclass
# @MAINTAINER:
# base-system@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
# @BLURB: many extra (but common) functions that are used in ebuilds
-# @DESCRIPTION:
-# The eutils eclass contains a suite of functions that complement
-# the ones that ebuild.sh already contain. The idea is that the functions
-# are not required in all ebuilds but enough utilize them to have a common
-# home rather than having multiple ebuilds implementing the same thing.
-#
-# Due to the nature of this eclass, some functions may have maintainers
-# different from the overall eclass!
-#
-# This eclass is DEPRECATED and must not be inherited by any new ebuilds
-# or eclasses. Use the more specific split eclasses instead, or native
-# package manager functions when available.
+# @DEPRECATED: native package manager functions, more specific eclasses
if [[ -z ${_EUTILS_ECLASS} ]]; then
_EUTILS_ECLASS=1
# implicitly inherited (now split) eclasses
case ${EAPI} in
- 5|6)
- inherit desktop edos2unix epatch estack ltprune multilib \
- preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper
- ;;
+ 6) inherit desktop edos2unix epatch eqawarn estack ltprune multilib \
+ preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper ;;
7) inherit edos2unix strip-linguas wrapper ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-# @FUNCTION: emktemp
-# @USAGE: [temp dir]
-# @DESCRIPTION:
-# Cheap replacement for when coreutils (and thus mktemp) does not exist
-# on the user's system.
emktemp() {
- eqawarn "emktemp is deprecated. Create a temporary file in \${T} instead."
-
- local exe="touch"
- [[ $1 == -d ]] && exe="mkdir" && shift
- local topdir=$1
-
- if [[ -z ${topdir} ]] ; then
- [[ -z ${T} ]] \
- && topdir="/tmp" \
- || topdir=${T}
- fi
-
- if ! type -P mktemp > /dev/null ; then
- # system lacks `mktemp` so we have to fake it
- local tmp=/
- while [[ -e ${tmp} ]] ; do
- tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}
- done
- ${exe} "${tmp}" || ${exe} -p "${tmp}"
- echo "${tmp}"
- else
- # the args here will give slightly wierd names on BSD,
- # but should produce a usable file on all userlands
- if [[ ${exe} == "touch" ]] ; then
- TMPDIR="${topdir}" mktemp -t tmp.XXXXXXXXXX
- else
- TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX
- fi
- fi
+ eerror "emktemp has been removed."
+ eerror "Create a temporary file in \${T} instead."
+ die "emktemp is banned"
}
path_exists() {
@@ -76,119 +32,11 @@ path_exists() {
die "path_exists is banned"
}
-# @FUNCTION: use_if_iuse
-# @USAGE: <flag>
-# @DESCRIPTION:
-# Return true if the given flag is in USE and IUSE.
-#
-# Note that this function should not be used in the global scope.
use_if_iuse() {
- eqawarn "use_if_iuse is deprecated."
- eqawarn "Define it as a local function, or inline it:"
- eqawarn " in_iuse foo && use foo"
- in_iuse $1 || return 1
- use $1
-}
-
-if [[ ${EAPI} == 5 ]] ; then
-
-# @FUNCTION: einstalldocs
-# @DESCRIPTION:
-# Install documentation using DOCS and HTML_DOCS, in EAPIs that do not
-# provide this function. When available (i.e., in EAPI 6 or later),
-# the package manager implementation should be used instead.
-#
-# If DOCS is declared and non-empty, all files listed in it are
-# installed. The files must exist, otherwise the function will fail.
-# In EAPI 4 and 5, DOCS may specify directories as well; in earlier
-# EAPIs using directories is unsupported.
-#
-# If DOCS is not declared, the files matching patterns given
-# in the default EAPI implementation of src_install will be installed.
-# If this is undesired, DOCS can be set to empty value to prevent any
-# documentation from being installed.
-#
-# If HTML_DOCS is declared and non-empty, all files and/or directories
-# listed in it are installed as HTML docs (using dohtml).
-#
-# Both DOCS and HTML_DOCS can either be an array or a whitespace-
-# separated list. Whenever directories are allowed, '<directory>/.' may
-# be specified in order to install all files within the directory
-# without creating a sub-directory in docdir.
-#
-# Passing additional options to dodoc and dohtml is not supported.
-# If you needed such a thing, you need to call those helpers explicitly.
-einstalldocs() {
- debug-print-function ${FUNCNAME} "${@}"
-
- local dodoc_opts=-r
-
- if ! declare -p DOCS &>/dev/null ; then
- local d
- for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
- THANKS BUGS FAQ CREDITS CHANGELOG ; do
- if [[ -s ${d} ]] ; then
- dodoc "${d}" || die
- fi
- done
- elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
- if [[ ${DOCS[@]} ]] ; then
- dodoc ${dodoc_opts} "${DOCS[@]}" || die
- fi
- else
- if [[ ${DOCS} ]] ; then
- dodoc ${dodoc_opts} ${DOCS} || die
- fi
- fi
-
- if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
- if [[ ${HTML_DOCS[@]} ]] ; then
- dohtml -r "${HTML_DOCS[@]}" || die
- fi
- else
- if [[ ${HTML_DOCS} ]] ; then
- dohtml -r ${HTML_DOCS} || die
- fi
- fi
-
- return 0
+ eerror "use_if_iuse has been removed."
+ eerror "Define it as a local function, or inline it:"
+ eerror " in_iuse foo && use foo"
+ die "use_if_iuse is banned"
}
-# @FUNCTION: in_iuse
-# @USAGE: <flag>
-# @DESCRIPTION:
-# Determines whether the given flag is in IUSE. Strips IUSE default
-# prefixes as necessary. In EAPIs where it is available (i.e., EAPI 6
-# or later), the package manager implementation should be used instead.
-#
-# Note that this function must not be used in the global scope.
-in_iuse() {
- debug-print-function ${FUNCNAME} "${@}"
- [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()"
-
- local flag=${1}
- local liuse=( ${IUSE} )
-
- has "${flag}" "${liuse[@]#[+-]}"
-}
-
-fi # EAPI 5
-
-if [[ ${EAPI} == [56] ]] ; then
-
-# @FUNCTION: eqawarn
-# @USAGE: [message]
-# @DESCRIPTION:
-# Proxy to ewarn for package managers that don't provide eqawarn and use the PM
-# implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev
-# profile.
-if ! declare -F eqawarn >/dev/null ; then
- eqawarn() {
- has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@"
- :
- }
-fi
-
-fi # EAPI [56]
-
fi
diff --git a/eclass/findlib.eclass b/eclass/findlib.eclass
index 0e14514e298..52e3655b3e8 100644
--- a/eclass/findlib.eclass
+++ b/eclass/findlib.eclass
@@ -6,13 +6,13 @@
# ML <ml@gentoo.org>
# @AUTHOR:
# Original author: Matthieu Sozeau <mattam@gentoo.org> (retired)
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: ocamlfind (a.k.a. findlib) eclass
# @DESCRIPTION:
# ocamlfind (a.k.a. findlib) eclass
case ${EAPI:-0} in
- [67]) ;;
+ [678]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -26,11 +26,14 @@ QA_FLAGS_IGNORED='.*'
IUSE="+ocamlopt"
# From this findlib version, there is proper stublibs support.
-DEPEND=">=dev-ml/findlib-1.0.4-r1"
+DEPEND=">=dev-ml/findlib-1.0.4-r1[ocamlopt?]"
[[ ${FINDLIB_USE} ]] && DEPEND="${FINDLIB_USE}? ( ${DEPEND} )"
RDEPEND="dev-lang/ocaml:=[ocamlopt?]"
[[ ${FINDLIB_USE} ]] && RDEPEND="${FINDLIB_USE}? ( ${RDEPEND} )"
+# @FUNCTION: check_ocamlfind
+# @DESCRIPTION:
+# Die if ocamlfind is not found
check_ocamlfind() {
if [ ! -x "${EPREFIX}"/usr/bin/ocamlfind ] ; then
eerror "In ${ECLASS}: could not find the ocamlfind executable"
@@ -45,8 +48,6 @@ check_ocamlfind() {
# We use the stublibs style, so no ld.conf needs to be
# updated when a package installs C shared libraries.
findlib_src_preinst() {
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
- has "${EAPI:-0}" 0 1 2 && use !prefix && ED="${D}"
check_ocamlfind
# destdir is the ocaml sitelib
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 50caa401bac..7319326c7ad 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -4,16 +4,15 @@
# @ECLASS: flag-o-matic.eclass
# @MAINTAINER:
# toolchain@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
# @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.
-case ${EAPI:-0} in
- 0|1|2|3|4) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;;
- 5|6|7|8) ;;
- *) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;;
+case ${EAPI} in
+ 6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then
@@ -21,11 +20,11 @@ _FLAG_O_MATIC_ECLASS=1
inherit toolchain-funcs
-[[ ${EAPI} == [567] ]] && inherit eutils
+[[ ${EAPI} == [67] ]] && inherit eutils
# @FUNCTION: all-flag-vars
# @DESCRIPTION:
-# Return all the flag variables that our high level funcs operate on.
+# Return all the flag variables that our high level functions operate on.
all-flag-vars() {
echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS
}
@@ -36,7 +35,7 @@ all-flag-vars() {
# {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() {
- [[ ${EAPI} == [567] ]] ||
+ [[ ${EAPI} == [67] ]] ||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}."
_setup-allowed-flags "$@"
}
@@ -210,6 +209,7 @@ filter-flags() {
# Remove flags that enable Large File Support.
filter-lfs-flags() {
[[ $# -ne 0 ]] && die "filter-lfs-flags takes no arguments"
+
# http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
# _LARGEFILE_SOURCE: enable support for new LFS funcs (ftello/etc...)
# _LARGEFILE64_SOURCE: enable support for 64bit variants (off64_t/fseeko64/etc...)
@@ -218,6 +218,14 @@ filter-lfs-flags() {
filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_TIME_BITS=64
}
+# @FUNCTION: filter-lto
+# @DESCRIPTION:
+# Remove flags that enable LTO and those that depend on it
+filter-lto() {
+ [[ $# -ne 0 ]] && die "filter-lto takes no arguments"
+ filter-flags '-flto*' -fwhole-program-vtables '-fsanitize=cfi*'
+}
+
# @FUNCTION: filter-ldflags
# @USAGE: <flags>
# @DESCRIPTION:
@@ -247,7 +255,7 @@ append-cppflags() {
# @CODE
append-cflags() {
[[ $# -eq 0 ]] && return 0
- # Do not do automatic flag testing ourselves. #417047
+ # Do not do automatic flag testing ourselves, bug #417047
export CFLAGS+=" $*"
return 0
}
@@ -262,7 +270,7 @@ append-cflags() {
# @CODE
append-cxxflags() {
[[ $# -eq 0 ]] && return 0
- # Do not do automatic flag testing ourselves. #417047
+ # Do not do automatic flag testing ourselves, bug #417047
export CXXFLAGS+=" $*"
return 0
}
@@ -277,7 +285,7 @@ append-cxxflags() {
# @CODE
append-fflags() {
[[ $# -eq 0 ]] && return 0
- # Do not do automatic flag testing ourselves. #417047
+ # Do not do automatic flag testing ourselves, bug #417047
export FFLAGS+=" $*"
export FCFLAGS+=" $*"
return 0
@@ -288,7 +296,8 @@ append-fflags() {
# Add flags that enable Large File Support.
append-lfs-flags() {
[[ $# -ne 0 ]] && die "append-lfs-flags takes no arguments"
- # see comments in filter-lfs-flags func for meaning of these
+
+ # See comments in filter-lfs-flags func for meaning of these
append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
}
@@ -315,9 +324,9 @@ append-ldflags() {
append-flags() {
[[ $# -eq 0 ]] && return 0
case " $* " in
- *' '-[DIU]*) eqawarn 'please use append-cppflags for preprocessor flags' ;;
+ *' '-[DIU]*) eqawarn 'Please use append-cppflags for preprocessor flags' ;;
*' '-L*|\
- *' '-Wl,*) eqawarn 'please use append-ldflags for linker flags' ;;
+ *' '-Wl,*) eqawarn 'Please use append-ldflags for linker flags' ;;
esac
append-cflags "$@"
append-cxxflags "$@"
@@ -504,7 +513,7 @@ strip-flags() {
# Returns shell true if <flag> is supported by given <compiler>,
# else returns shell false.
test-flag-PROG() {
- [[ ${EAPI} == [567] ]] ||
+ [[ ${EAPI} == [67] ]] ||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}."
_test-flag-PROG "$@"
}
@@ -565,6 +574,15 @@ _test-flag-PROG() {
c+ld)
in_ext='c'
in_src='int main(void) { return 0; }'
+
+ if is-ldflagq -fuse-ld=* ; then
+ # Respect linker chosen by user so we don't
+ # end up giving false results by checking
+ # with default linker. bug #832377
+ fuse_ld_value=$(get-flag -fuse-ld=*)
+ cmdline_extra+=(${fuse_ld_value})
+ fi
+
cmdline_extra+=(-xc)
;;
esac
@@ -574,7 +592,7 @@ _test-flag-PROG() {
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.
+ # before the flag to see if a flag produces any warnings.
# This has a few drawbacks:
# - if compiler already generates warnings we filter out
# every single flag: bug #712488
@@ -600,7 +618,9 @@ _test-flag-PROG() {
# -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
+ # any other.
+ #
+ # See also bug #712488 and bug #714742.
cmdline+=( -Qunused-arguments )
"${cmdline[@]}" &>/dev/null
fi
@@ -643,7 +663,7 @@ test-flag-CCLD() { _test-flag-PROG CC c+ld "$@"; }
# Returns shell true if <flags> are supported by given <compiler>,
# else returns shell false.
test-flags-PROG() {
- [[ ${EAPI} == [567] ]] ||
+ [[ ${EAPI} == [67] ]] ||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}."
_test-flags-PROG "$@"
}
@@ -665,7 +685,7 @@ _test-flags-PROG() {
while (( $# )); do
case "$1" in
- # '-B /foo': bug # 687198
+ # '-B /foo': bug #687198
--param|-B)
if test-flag-${comp} "$1" "$2"; then
flags+=( "$1" "$2" )
@@ -851,7 +871,7 @@ raw-ldflags() {
x=${x#-Wl,}
set -- "$@" ${x//,/ }
;;
- *) # Assume it's a compiler driver flag, so throw it away #441808
+ *) # Assume it's a compiler driver flag, so throw it away, bug #441808
;;
esac
done
@@ -868,4 +888,150 @@ no-as-needed() {
esac
}
+# @FUNCTION: _test-compile-PROG
+# @USAGE: <language> <code>
+# @INTERNAL
+# @DESCRIPTION:
+# Attempts to compile (and possibly link) the given program. The first
+# <language> parameter corresponds to the standard -x compiler argument.
+# If the program should additionally be attempted to be linked, the string
+# "+ld" should be added to the <language> parameter.
+_test-compile-PROG() {
+ local lang=$1
+ local code=$2
+ shift 2
+
+ [[ -z "${lang}" ]] && return 1
+ [[ -z "${code}" ]] && return 1
+
+ local compiler filename_in filename_out args=() libs=()
+ case "${lang}" in
+ c)
+ compiler="$(tc-getCC)"
+ filename_in="${T}/test.c"
+ filename_out="${T}/test.o"
+ args+=(${CFLAGS[@]} -xc -c)
+ ;;
+ c++)
+ compiler="$(tc-getCXX)"
+ filename_in="${T}/test.cc"
+ filename_out="${T}/test.o"
+ args+=(${CXXFLAGS[@]} -xc++ -c)
+ ;;
+ f77)
+ compiler="$(tc-getF77)"
+ filename_in="${T}/test.f"
+ filename_out="${T}/test.o"
+ args+=(${FFFLAGS[@]} -xf77 -c)
+ ;;
+ f95)
+ compiler="$(tc-getFC)"
+ filename_in="${T}/test.f90"
+ filename_out="${T}/test.o"
+ args+=(${FCFLAGS[@]} -xf95 -c)
+ ;;
+ c+ld)
+ compiler="$(tc-getCC)"
+ filename_in="${T}/test.c"
+ filename_out="${T}/test.exe"
+ args+=(${CFLAGS[@]} ${LDFLAGS[@]} -xc)
+ libs+=(${LIBS[@]})
+ ;;
+ c+++ld)
+ compiler="$(tc-getCXX)"
+ filename_in="${T}/test.cc"
+ filename_out="${T}/test.exe"
+ args+=(${CXXFLAGS[@]} ${LDFLAGS[@]} -xc++)
+ libs+=(${LIBS[@]})
+ ;;
+ f77+ld)
+ compiler="$(tc-getF77)"
+ filename_in="${T}/test.f"
+ filename_out="${T}/test.exe"
+ args+=(${FFLAGS[@]} ${LDFLAGS[@]} -xf77)
+ libs+=(${LIBS[@]})
+ ;;
+ f95+ld)
+ compiler="$(tc-getFC)"
+ filename_in="${T}/test.f90"
+ filename_out="${T}/test.exe"
+ args+=(${FCFLAGS[@]} ${LDFLAGS[@]} -xf95)
+ libs+=(${LIBS[@]})
+ ;;
+ *)
+ die "Unknown compiled language ${lang}"
+ ;;
+ esac
+
+ printf "%s\n" "${code}" > "${filename_in}" || die "Failed to create '${test_in}'"
+
+ "${compiler}" ${args[@]} "${filename_in}" -o "${filename_out}" ${libs[@]} &>/dev/null
+}
+
+# @FUNCTION: append-atomic-flags
+# @USAGE: [bytes]
+# @DESCRIPTION:
+# Attempts to detect if appending -latomic is required to use
+# a specific-sized atomic intrinsic, and if so, appends it. If the bytesize
+# is not specified, then check the four most common byte sizes (1, 2, 4, 8).
+# >=16-byte atomics are not included in this default set and must be explicitly
+# passed if required. This may require you to add a macro definition like
+# -Duint128_t=__uint128_t to your CFLAGS.
+append-atomic-flags() {
+ # this implementation is as described in bug #820101
+ local code
+
+ # first, ensure we can compile a trivial program
+ # this is because we can't distinguish if _test-compile-PROG
+ # fails because -latomic is actually needed or if we have a
+ # broken toolchain (like due to bad FLAGS)
+ read -r -d '' code <<- EOF
+ int main()
+ {
+ return 0;
+ }
+ EOF
+
+ # if toolchain is broken, just return silently. it's better to
+ # let other pieces of the build fail later down the line than to
+ # make people think that something to do with atomic support is the
+ # cause of their problems.
+ _test-compile-PROG "c+ld" "${code}" || return
+
+ local bytesizes
+ [[ "${#}" == "0" ]] && bytesizes=( "1" "2" "4" "8" ) || bytesizes="${@}"
+
+ for bytesize in ${bytesizes[@]}
+ do
+ # this sample program is informed by the great testing from the buildroot project:
+ # https://github.com/buildroot/buildroot/commit/6856e417da4f3aa77e2a814db2a89429af072f7d
+ read -r -d '' code <<- EOF
+ #include <stdint.h>
+ int main()
+ {
+ uint$((${bytesize} * 8))_t a = 0;
+ __atomic_add_fetch(&a, 3, __ATOMIC_RELAXED);
+ __atomic_compare_exchange_n(&a, &a, 2, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+ return 0;
+ }
+ EOF
+
+ # do nothing if test program links fine
+ _test-compile-PROG "c+ld" "${code}" && continue
+
+ # ensure that the toolchain supports -latomic
+ test-flags-CCLD "-latomic" &>/dev/null || die "-latomic is required but not supported by $(tc-getCC)"
+
+ append-libs "-latomic"
+
+ # verify that this did indeed fix the problem
+ _test-compile-PROG "c+ld" "${code}" || \
+ die "libatomic does not include an implementation of ${bytesize}-byte atomics for this toolchain"
+
+ # if any of the required bytesizes require -latomic, no need to continue
+ # checking the others
+ return
+ done
+}
+
fi
diff --git a/eclass/frameworks.kde.org.eclass b/eclass/frameworks.kde.org.eclass
new file mode 100644
index 00000000000..876c05c9b6a
--- /dev/null
+++ b/eclass/frameworks.kde.org.eclass
@@ -0,0 +1,72 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: frameworks.kde.org.eclass
+# @MAINTAINER:
+# kde@gentoo.org
+# @SUPPORTED_EAPIS: 8
+# @PROVIDES: kde.org
+# @BLURB: Support eclass for KDE Frameworks packages.
+# @DESCRIPTION:
+# This eclass extends kde.org.eclass for Frameworks release group to assemble
+# default SRC_URI for tarballs, set up git-r3.eclass for stable/master branch
+# versions or restrict access to unreleased (packager access only) tarballs
+# in Gentoo KDE overlay.
+#
+# This eclass unconditionally inherits kde.org.eclass and all its public
+# variables and helper functions (not phase functions) may be considered as
+# part of this eclass's API.
+
+case ${EAPI} in
+ 8) ;;
+ *) die "EAPI=${EAPI:-0} is not supported" ;;
+esac
+
+if [[ -z ${_FRAMEWORKS_KDE_ORG_ECLASS} ]]; then
+_FRAMEWORKS_KDE_ORG_ECLASS=1
+
+# @ECLASS_VARIABLE: KDE_PV_UNRELEASED
+# @INTERNAL
+# @DESCRIPTION:
+# For proper description see kde.org.eclass manpage.
+KDE_PV_UNRELEASED=( )
+
+inherit kde.org
+
+HOMEPAGE="https://develop.kde.org/products/frameworks/"
+
+SLOT=5/${PV}
+[[ ${KDE_BUILD_TYPE} == release ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
+
+# @ECLASS_VARIABLE: KDE_ORG_SCHEDULE_URI
+# @INTERNAL
+# @DESCRIPTION:
+# For proper description see kde.org.eclass manpage.
+KDE_ORG_SCHEDULE_URI+="/Frameworks"
+
+# @ECLASS_VARIABLE: _KDE_SRC_URI
+# @INTERNAL
+# @DESCRIPTION:
+# Helper variable to construct release group specific SRC_URI.
+_KDE_SRC_URI="mirror://kde/"
+
+if [[ ${KDE_BUILD_TYPE} != live && -z ${KDE_ORG_COMMIT} ]]; then
+ _KDE_SRC_URI+="stable/frameworks/$(ver_cut 1-2)/"
+ case ${KDE_ORG_NAME} in
+ kdelibs4support | \
+ kdesignerplugin | \
+ kdewebkit | \
+ khtml | \
+ kjs | \
+ kjsembed | \
+ kmediaplayer | \
+ kross | \
+ kxmlrpcclient)
+ _KDE_SRC_URI+="portingAids/"
+ ;;
+ esac
+
+ SRC_URI="${_KDE_SRC_URI}${KDE_ORG_NAME}-${PV}.tar.xz"
+fi
+
+fi
diff --git a/eclass/gear.kde.org.eclass b/eclass/gear.kde.org.eclass
new file mode 100644
index 00000000000..66c86b59fa3
--- /dev/null
+++ b/eclass/gear.kde.org.eclass
@@ -0,0 +1,66 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: gear.kde.org.eclass
+# @MAINTAINER:
+# kde@gentoo.org
+# @SUPPORTED_EAPIS: 8
+# @PROVIDES: kde.org
+# @BLURB: Support eclass for KDE Gear packages.
+# @DESCRIPTION:
+# This eclass extends kde.org.eclass for KDE Gear release group to assemble
+# default SRC_URI for tarballs, set up git-r3.eclass for stable/master branch
+# versions or restrict access to unreleased (packager access only) tarballs
+# in Gentoo KDE overlay.
+#
+# This eclass unconditionally inherits kde.org.eclass and all its public
+# variables and helper functions (not phase functions) may be considered as
+# part of this eclass's API.
+
+case ${EAPI} in
+ 8) ;;
+ *) die "EAPI=${EAPI:-0} is not supported" ;;
+esac
+
+if [[ -z ${_GEAR_KDE_ORG_ECLASS} ]]; then
+_GEAR_KDE_ORG_ECLASS=1
+
+# @ECLASS_VARIABLE: KDE_PV_UNRELEASED
+# @INTERNAL
+# @DESCRIPTION:
+# For proper description see kde.org.eclass manpage.
+KDE_PV_UNRELEASED=( )
+
+inherit kde.org
+
+HOMEPAGE="https://apps.kde.org/"
+
+# @ECLASS_VARIABLE: KDE_ORG_SCHEDULE_URI
+# @INTERNAL
+# @DESCRIPTION:
+# For proper description see kde.org.eclass manpage.
+KDE_ORG_SCHEDULE_URI+="/KDE_Gear_${PV:0:5}_Schedule"
+
+# @ECLASS_VARIABLE: _KDE_SRC_URI
+# @INTERNAL
+# @DESCRIPTION:
+# Helper variable to construct release group specific SRC_URI.
+_KDE_SRC_URI="mirror://kde/"
+
+if [[ ${KDE_BUILD_TYPE} == live ]]; then
+ if [[ ${PV} == ??.??.49.9999 ]]; then
+ EGIT_BRANCH="release/$(ver_cut 1-2)"
+ fi
+elif [[ -z ${KDE_ORG_COMMIT} ]]; then
+ case ${PV} in
+ ??.??.[6-9]? )
+ _KDE_SRC_URI+="unstable/release-service/${PV}/src/"
+ RESTRICT+=" mirror"
+ ;;
+ *) _KDE_SRC_URI+="stable/release-service/${PV}/src/" ;;
+ esac
+
+ SRC_URI="${_KDE_SRC_URI}${KDE_ORG_NAME}-${PV}.tar.xz"
+fi
+
+fi
diff --git a/eclass/gnustep-2.eclass b/eclass/gnustep-2.eclass
index 68c15bbc62e..e1d7f00da08 100644
--- a/eclass/gnustep-2.eclass
+++ b/eclass/gnustep-2.eclass
@@ -1,18 +1,18 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnustep-2.eclass
# @MAINTAINER:
# GNUstep Herd <gnustep@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
# @PROVIDES: gnustep-base
# @BLURB: eclass for GNUstep Apps, Frameworks, and Bundles build
# @DESCRIPTION:
# This eclass sets up GNUstep environment to properly install
# GNUstep packages
-case ${EAPI:-0} in
- [5678]) ;;
+case ${EAPI} in
+ 6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -21,8 +21,8 @@ _GNUSTEP_2_ECLASS=1
inherit gnustep-base
-case ${EAPI:-0} in
- [56])
+case ${EAPI} in
+ 6)
DEPEND=">=gnustep-base/gnustep-make-2.0"
;;
*)
diff --git a/eclass/gnustep-base.eclass b/eclass/gnustep-base.eclass
index d37ecad102e..9d72e6315ff 100644
--- a/eclass/gnustep-base.eclass
+++ b/eclass/gnustep-base.eclass
@@ -1,17 +1,18 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnustep-base.eclass
# @MAINTAINER:
# GNUstep Herd <gnustep@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: Internal handling of GNUstep pacakges
# @DESCRIPTION:
# Inner gnustep eclass, should only be inherited directly by gnustep-base
# packages
-case ${EAPI:-0} in
- [5678]) inherit eutils ;;
+case ${EAPI} in
+ 6|7) inherit eutils ;;
+ 8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -64,7 +65,7 @@ gnustep-base_src_prepare() {
eend $?
fi
- ! has ${EAPI} 5 && default
+ default
}
gnustep-base_src_configure() {
diff --git a/eclass/gstreamer-meson.eclass b/eclass/gstreamer-meson.eclass
index f81c2beeccd..f8ca343b0ca 100644
--- a/eclass/gstreamer-meson.eclass
+++ b/eclass/gstreamer-meson.eclass
@@ -420,6 +420,7 @@ gstreamer_multilib_src_install() {
for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
for plugin in $(_gstreamer_get_target_filename $(gstreamer_get_plugin_dir ${plugin_dir})); do
local install_filename="${plugin##*:}"
+ install_filename="${install_filename#${EPREFIX}}"
insinto "${install_filename%/*}"
doins "${plugin%%:*}"
done
diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass
index 541bb4a90ee..d437fc824f5 100644
--- a/eclass/haskell-cabal.eclass
+++ b/eclass/haskell-cabal.eclass
@@ -8,7 +8,6 @@
# Original author: Andres Loeh <kosmikus@gentoo.org>
# Original author: Duncan Coutts <dcoutts@gentoo.org>
# @SUPPORTED_EAPIS: 6 7 8
-# @PROVIDES: ghc-package
# @BLURB: for packages that make use of the Haskell Common Architecture for Building Applications and Libraries (cabal)
# @DESCRIPTION:
# Basic instructions:
@@ -50,7 +49,7 @@ esac
inherit ghc-package multilib toolchain-funcs
-EXPORT_FUNCTIONS pkg_setup src_configure src_compile src_test src_install pkg_postinst pkg_postrm
+EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
# @ECLASS_VARIABLE: CABAL_EXTRA_CONFIGURE_FLAGS
# @USER_VARIABLE
@@ -123,6 +122,72 @@ EXPORT_FUNCTIONS pkg_setup src_configure src_compile src_test src_install pkg_po
# Set to anything else to disable.
: ${CABAL_REPORT_OTHER_BROKEN_PACKAGES:=yes}
+# @ECLASS_VARIABLE: CABAL_HACKAGE_REVISION
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Set the upstream revision number from Hackage. This will automatically
+# add the upstream cabal revision to SRC_URI and apply it in src_prepare.
+: ${CABAL_HACKAGE_REVISION:=0}
+
+# @ECLASS_VARIABLE: CABAL_PN
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Set the name of the package as it is recorded in the Hackage database. This
+# is mostly used when packages use CamelCase names upstream, but we want them
+# to be lowercase in portage.
+: ${CABAL_PN:=${PN}}
+
+# @ECLASS_VARIABLE: CABAL_PV
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Set the version of the package as it is recorded in the Hackage database.
+# This can be useful if we use a different versioning scheme in Portage than
+# the one from upstream
+: ${CABAL_PV:=${PV}}
+
+# @ECLASS_VARIABLE: CABAL_P
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# The combined $CABAL_PN and $CABAL_PV variables, analogous to $P
+CABAL_P="${CABAL_PN}-${CABAL_PV}"
+
+S="${WORKDIR}/${CABAL_P}"
+
+# @ECLASS_VARIABLE: CABAL_FILE
+# @DESCRIPTION:
+# The location of the .cabal file for the Haskell package. This defaults to
+# "${S}/${CABAL_PN}.cabal".
+: ${CABAL_FILE:="${S}/${CABAL_PN}.cabal"}
+
+# @ECLASS_VARIABLE: CABAL_DISTFILE
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# The name of the .cabal file downloaded from Hackage. This filename does not
+# include $DISTDIR
+if [[ ${CABAL_HACKAGE_REVISION} -ge 1 ]]; then
+ CABAL_DISTFILE="${P}-rev${CABAL_HACKAGE_REVISION}.cabal"
+fi
+
+# @ECLASS_VARIABLE: CABAL_CHDEPS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Specifies changes to be made to the .cabal file. Uses the cabal_chdeps
+# function internally and shares the same syntax.
+# @EXAMPLE:
+# CABAL_CHDEPS=(
+# 'base >= 4.2 && < 4.6' 'base >= 4.2 && < 4.7'
+# 'containers ==0.4.*' 'containers >= 0.4 && < 0.6'
+# )
+: ${CABAL_CHDEPS:=}
+
+
+# @ECLASS_VARIABLE: CABAL_LIVE_VERSION
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set this to any value to prevent SRC_URI from being set automatically.
+: ${CABAL_LIVE_VERSION:=}
+
# 'dev-haskell/cabal' passes those options with ./configure-based
# configuration, but most packages don't need/don't accept it:
# #515362, #515362
@@ -156,7 +221,7 @@ fi
if [[ -n "${CABAL_USE_HOOGLE}" ]]; then
# enabled only in ::haskell
- #IUSE="${IUSE} hoogle"
+ # IUSE="${IUSE} hoogle"
CABAL_USE_HOOGLE=
fi
@@ -169,6 +234,26 @@ if [[ -n "${CABAL_TEST_SUITE}" ]]; then
RESTRICT+=" !test? ( test )"
fi
+# If SRC_URI is defined in the ebuild without appending, it will overwrite
+# the value set here. This will not be set on packages whose versions end in "9999"
+# or if CABAL_LIVE_VERSION is set.
+case $PV in
+ *9999) ;;
+ *)
+ if [[ -z "${CABAL_LIVE_VERSION}" ]]; then
+ if [[ "${CABAL_P}" == "${P}" ]]; then
+ SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"
+ else
+ SRC_URI="https://hackage.haskell.org/package/${CABAL_P}/${CABAL_P}.tar.gz -> ${P}.tar.gz"
+ fi
+ if [[ -n ${CABAL_DISTFILE} ]]; then
+ SRC_URI+=" https://hackage.haskell.org/package/${CABAL_P}/revision/${CABAL_HACKAGE_REVISION}.cabal -> ${CABAL_DISTFILE}"
+ fi
+ fi ;;
+esac
+
+BDEPEND="${BDEPEND} app-text/dos2unix"
+
# returns the version of cabal currently in use.
# Rarely it's handy to pin cabal version from outside.
: ${_CABAL_VERSION_CACHE:=""}
@@ -228,20 +313,6 @@ cabal-bootstrap() {
$(ghc-getghc) "$@"
}
if $(ghc-supports-shared-libraries); then
- # # some custom build systems might use external libraries,
- # # for which we don't have shared libs, so keep static fallback
- # bug #411789, http://hackage.haskell.org/trac/ghc/ticket/5743#comment:3
- # http://hackage.haskell.org/trac/ghc/ticket/7062
- # http://hackage.haskell.org/trac/ghc/ticket/3072
- # ghc does not set RPATH for extralibs, thus we do it ourselves by hands
- einfo "Prepending $(ghc-libdir) to LD_LIBRARY_PATH"
- if [[ ${CHOST} != *-darwin* ]]; then
- LD_LIBRARY_PATH="$(ghc-libdir)${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
- export LD_LIBRARY_PATH
- else
- DYLD_LIBRARY_PATH="$(ghc-libdir)${DYLD_LIBRARY_PATH:+:}${DYLD_LIBRARY_PATH}"
- export DYLD_LIBRARY_PATH
- fi
{ make_setup -dynamic "$@" && ./setup --help >/dev/null; } ||
make_setup "$@" || die "compiling ${setupmodule} failed"
else
@@ -288,8 +359,8 @@ cabal-show-brokens() {
elog "ghc-pkg check: 'checking for other broken packages:'"
# pretty-printer
$(ghc-getghcpkg) check 2>&1 \
- | grep -E -v '^Warning: haddock-(html|interfaces): ' \
- | grep -E -v '^Warning: include-dirs: ' \
+ | egrep -v '^Warning: haddock-(html|interfaces): ' \
+ | egrep -v '^Warning: include-dirs: ' \
| head -n 20
cabal-die-if-nonempty 'broken' \
@@ -448,7 +519,7 @@ cabal-build() {
}
cabal-copy() {
- set -- copy --destdir="${D}" "$@"
+ set -- copy "$@" --destdir="${D}"
echo ./setup "$@"
./setup "$@" || die "setup copy failed"
@@ -510,6 +581,29 @@ haskell-cabal_pkg_setup() {
fi
}
+haskell-cabal_src_prepare() {
+ # Needed for packages that are still using MY_PN
+ if [[ -n ${MY_PN} ]]; then
+ local cabal_file="${S}/${MY_PN}.cabal"
+ else
+ local cabal_file="${CABAL_FILE}"
+ fi
+
+ if [[ -n ${CABAL_DISTFILE} ]]; then
+ # pull revised cabal from upstream
+ einfo "Using revised .cabal file from Hackage: revision ${CABAL_HACKAGE_REVISION}"
+ cp "${DISTDIR}/${CABAL_DISTFILE}" "${cabal_file}" || die
+ fi
+
+ # Convert to unix line endings
+ dos2unix "${cabal_file}" || die
+
+ # Apply patches *after* pulling the revised cabal
+ default
+
+ [[ -n "${CABAL_CHDEPS}" ]] && cabal_chdeps "${CABAL_CHDEPS[@]}"
+}
+
haskell-cabal_src_configure() {
cabal-is-dummy-lib && return
@@ -599,7 +693,8 @@ haskell-cabal_src_test() {
# exported function: cabal-style copy and register
cabal_src_install() {
if ! cabal-is-dummy-lib; then
- cabal-copy
+ # Pass arguments to cabal-copy
+ cabal-copy "$@"
cabal-pkg
fi
@@ -614,10 +709,14 @@ cabal_src_install() {
touch "${hint_file}" || die
}
+# Arguments passed to this function will make their way to `cabal-copy`
+# and eventually `./setup copy`. This allows you to specify which
+# components will be installed.
+# e.g. `haskell-cabal_src_install "lib:${PN}"` will only install the library
haskell-cabal_src_install() {
pushd "${S}" > /dev/null || die
- cabal_src_install
+ cabal_src_install "$@"
popd > /dev/null || die
}
@@ -678,23 +777,28 @@ cabal_flag() {
#}
# or
# src_prepare() {
-# CABAL_FILE=${S}/${MY_PN}.cabal cabal_chdeps \
+# CABAL_FILE=${S}/${CABAL_PN}.cabal cabal_chdeps \
# 'base >= 4.2 && < 4.6' 'base >= 4.2 && < 4.7'
-# CABAL_FILE=${S}/${MY_PN}-tools.cabal cabal_chdeps \
+# CABAL_FILE=${S}/${CABAL_PN}-tools.cabal cabal_chdeps \
# 'base == 3.*' 'base >= 4.2 && < 4.7'
#}
#
cabal_chdeps() {
- local cabal_fn=${MY_PN:-${PN}}.cabal
- local cf=${CABAL_FILE:-${S}/${cabal_fn}}
+ # Needed for compatibility with ebuilds still using MY_PN
+ if [[ -n ${MY_PN} ]]; then
+ local cabal_file="${S}/${MY_PN}.cabal"
+ else
+ local cabal_file="${CABAL_FILE}"
+ fi
+
local from_ss # ss - substring
local to_ss
local orig_c # c - contents
local new_c
- [[ -f $cf ]] || die "cabal file '$cf' does not exist"
+ [[ -f "${cabal_file}" ]] || die "cabal file '${cabal_file}' does not exist"
- orig_c=$(< "$cf")
+ orig_c=$(< "${cabal_file}")
while :; do
from_pat=$1
@@ -712,9 +816,9 @@ cabal_chdeps() {
new_c=${orig_c//${from_pat}/${to_str}}
if [[ -n $CABAL_DEBUG_LOOSENING ]]; then
- echo "${orig_c}" >"${T}/${cf}".pre
- echo "${new_c}" >"${T}/${cf}".post
- diff -u "${T}/${cf}".{pre,post}
+ echo "${orig_c}" >"${T}/${cabal_file}".pre
+ echo "${new_c}" >"${T}/${cabal_file}".post
+ diff -u "${T}/${cabal_file}".{pre,post}
fi
[[ "${orig_c}" == "${new_c}" ]] && die "no trigger for '${from_pat}'"
@@ -723,7 +827,7 @@ cabal_chdeps() {
shift
done
- echo "${new_c}" > "$cf" ||
+ echo "${new_c}" > "$cabal_file" ||
die "failed to update"
}
diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass
index 47499c7870a..6f7324240e3 100644
--- a/eclass/java-pkg-simple.eclass
+++ b/eclass/java-pkg-simple.eclass
@@ -6,7 +6,7 @@
# java@gentoo.org
# @AUTHOR:
# Java maintainers <java@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: Eclass for packaging Java software with ease.
# @DESCRIPTION:
# This class is intended to build pure Java packages from Java sources
@@ -16,8 +16,8 @@
# addressed by an ebuild by putting corresponding files into the target
# directory before calling the src_compile function of this eclass.
-case ${EAPI:-0} in
- 5|6) inherit eutils ;; # eutils for eqawarn
+case ${EAPI} in
+ 6) inherit eqawarn ;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -134,6 +134,12 @@ fi
# JAVA_MAIN_CLASS="org.gentoo.java.ebuilder.Main"
# @CODE
+# @ECLASS_VARIABLE: JAVA_AUTOMATIC_MODULE_NAME
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The value of the Automatic-Module-Name entry, which is going to be added to
+# MANIFEST.MF.
+
# @ECLASS_VARIABLE: JAVADOC_ARGS
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -338,9 +344,6 @@ java-pkg-simple_prepend_resources() {
java-pkg-simple_src_compile() {
local sources=sources.lst classes=target/classes apidoc=target/api moduleinfo
- # auto generate classpath
- java-pkg_gen-cp JAVA_GENTOO_CLASSPATH
-
# do not compile if we decide to install binary jar
if has binary ${JAVA_PKG_IUSE} && use binary; then
# register the runtime dependencies
@@ -351,6 +354,9 @@ java-pkg-simple_src_compile() {
cp "${DISTDIR}"/${JAVA_BINJAR_FILENAME} ${JAVA_JAR_FILENAME}\
|| die "Could not copy the binary jar file to ${S}"
return 0
+ else
+ # auto generate classpath
+ java-pkg_gen-cp JAVA_GENTOO_CLASSPATH
fi
# gather sources
@@ -418,13 +424,19 @@ java-pkg-simple_src_compile() {
jar_args="cf ${JAVA_JAR_FILENAME}"
fi
jar ${jar_args} -C ${classes} . || die "jar failed"
+ if [[ -v JAVA_AUTOMATIC_MODULE_NAME ]]; then
+ cat > "${T}/add-to-MANIFEST.MF" <<< "Automatic-Module-Name: ${JAVA_AUTOMATIC_MODULE_NAME}" \
+ || die "add-to-MANIFEST.MF failed"
+ jar ufmv ${JAVA_JAR_FILENAME} "${T}/add-to-MANIFEST.MF" \
+ || die "updating MANIFEST.MF failed"
+ fi
}
# @FUNCTION: java-pkg-simple_src_install
# @DESCRIPTION:
# src_install for simple single jar java packages. Simply installs
# ${JAVA_JAR_FILENAME}. It will also install a launcher if
-# ${JAVA_MAIN_CLASS} is set.
+# ${JAVA_MAIN_CLASS} is set. Also invokes einstalldocs.
java-pkg-simple_src_install() {
local sources=sources.lst classes=target/classes apidoc=target/api
@@ -455,6 +467,8 @@ java-pkg-simple_src_install() {
fi
java-pkg_dosrc ${srcdirs}
fi
+
+ einstalldocs
}
# @FUNCTION: java-pkg-simple_src_test
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index e5a2b611d11..4f50ce39c5d 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -316,7 +316,6 @@ java-pkg_rm_files() {
[[ ! -f "${filename}" ]] && die "${filename} is not a regular file. Aborting."
einfo "Removing unneeded file ${filename}"
rm -f "${S}/${filename}" || die "cannot remove ${filename}"
- eend $?
done
}
@@ -1901,7 +1900,12 @@ etestng() {
${JAVA_TEST_RUNNER_EXTRA_ARGS[@]}
)
- [[ ! "${JAVA_TEST_RUNNER_EXTRA_ARGS[@]}" =~ "-usedefaultlisteners" ]] && args+=( -usedefaultlisteners false )
+ if [[ ! "${JAVA_TEST_RUNNER_EXTRA_ARGS[@]}" =~ "-usedefaultlisteners" ]]; then
+ args+=(
+ -verbose 3
+ -usedefaultlisteners true
+ )
+ fi
args+=( -testclass ${tests} )
diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass
index 8196b1cdc72..ad814d7efd1 100644
--- a/eclass/java-vm-2.eclass
+++ b/eclass/java-vm-2.eclass
@@ -25,6 +25,7 @@ RDEPEND="
"
DEPEND="${RDEPEND}"
BDEPEND="app-arch/unzip"
+IDEPEND="app-eselect/eselect-java"
if [[ ${EAPI} == 6 ]]; then
DEPEND+=" ${BDEPEND}"
@@ -88,14 +89,35 @@ java-vm-2_pkg_postinst() {
xdg_desktop_database_update
}
+# @FUNCTION: has_eselect_java-vm_update
+# @INTERNAL
+# @DESCRIPTION:
+# Checks if an eselect-java version providing "eselect java-vm update"
+# is available.
+# @RETURN: 0 if >=app-eselect/eselect-java-0.5 is installed, 1 otherwise.
+has_eselect_java-vm_update() {
+ local has_version_args="-b"
+ if [[ ${EAPI} == 6 ]]; then
+ has_version_args="--host-root"
+ fi
+
+ has_version "${has_version_args}" ">=app-eselect/eselect-java-0.5"
+}
# @FUNCTION: java-vm-2_pkg_prerm
# @DESCRIPTION:
# default pkg_prerm
#
-# Warn user if removing system-vm.
+# Does nothing if eselect-java-0.5 or newer is available. Otherwise,
+# warn user if removing system-vm.
java-vm-2_pkg_prerm() {
+ if has_eselect_java-vm_update; then
+ # We will potentially switch to a new Java system VM in
+ # pkg_postrm().
+ return
+ fi
+
if [[ $(GENTOO_VM= java-config -f 2>/dev/null) == ${VMHANDLE} && -z ${REPLACED_BY_VERSION} ]]; then
ewarn "It appears you are removing your system-vm! Please run"
ewarn "\"eselect java-vm list\" to list available VMs, then use"
@@ -108,10 +130,14 @@ java-vm-2_pkg_prerm() {
# @DESCRIPTION:
# default pkg_postrm
#
-# Update mime database.
+# Invoke "eselect java-vm update" if eselect-java 0.5, or newer, is
+# available. Also update the mime database.
java-vm-2_pkg_postrm() {
xdg_desktop_database_update
+ if has_eselect_java-vm_update; then
+ eselect java-vm update
+ fi
}
diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
index b38ca5a024a..099bbaa4ef7 100644
--- a/eclass/kde.org.eclass
+++ b/eclass/kde.org.eclass
@@ -101,13 +101,18 @@ readonly KDE_ORG_CATEGORIES
# Name of the package as hosted on kde.org mirrors.
: ${KDE_ORG_NAME:=$PN}
+# @ECLASS_VARIABLE: KDE_ORG_SCHEDULE_URI
+# @DESCRIPTION:
+# Known schedule URI of package or release group.
+: ${KDE_ORG_SCHEDULE_URI:="https://community.kde.org/Schedules"}
+
# @ECLASS_VARIABLE: KDE_GEAR
# @PRE_INHERIT
# @DESCRIPTION:
# Mark package is being part of KDE Gear release schedule.
# By default, this is set to "false" and does nothing.
# If CATEGORY equals kde-apps, this is automatically set to "true".
-# If set to "true", set SRC_URI accordingly and apply KDE_UNRELEASED.
+# If set to "true", set SRC_URI accordingly.
: ${KDE_GEAR:=false}
if [[ ${CATEGORY} == kde-apps ]]; then
KDE_GEAR=true
@@ -129,13 +134,21 @@ case ${KDE_SELINUX_MODULE} in
;;
esac
-# @ECLASS_VARIABLE: KDE_UNRELEASED
+# @ECLASS_VARIABLE: KDE_PV_UNRELEASED
# @INTERNAL
+# @DEFAULT_UNSET
# @DESCRIPTION:
-# An array of $CATEGORY-$PV pairs of packages that are unreleased upstream.
+# An array of package versions that are unreleased upstream.
# Any package matching this will have fetch restriction enabled, and receive
# a proper error message via pkg_nofetch.
-KDE_UNRELEASED=( )
+
+# @ECLASS_VARIABLE: KDE_ORG_UNRELEASED
+# @DESCRIPTION:
+# If set to "true" fetch restriction will be enabled, and a proper error
+# message displayed via pkg_nofetch.
+KDE_ORG_UNRELEASED=false
+has ${PV} "${KDE_PV_UNRELEASED[*]}" && KDE_ORG_UNRELEASED=true
+[[ ${KDE_ORG_UNRELEASED} == true ]] && RESTRICT+=" fetch"
# @ECLASS_VARIABLE: EGIT_MIRROR
# @DESCRIPTION:
@@ -156,35 +169,20 @@ case ${CATEGORY} in
https://invent.kde.org/qt/qt/ https://www.qt.io/"
;;
kde-plasma)
- HOMEPAGE="https://kde.org/plasma-desktop"
+ if [[ -z ${_PLASMA_KDE_ORG_ECLASS} ]]; then
+ HOMEPAGE="https://kde.org/plasma-desktop"
+ fi
;;
kde-frameworks)
- HOMEPAGE="https://kde.org/products/frameworks/"
- SLOT=5/${PV}
- [[ ${KDE_BUILD_TYPE} == release ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
+ if [[ -z ${_FRAMEWORKS_KDE_ORG_ECLASS} ]]; then
+ HOMEPAGE="https://kde.org/products/frameworks/"
+ SLOT=5/${PV}
+ [[ ${KDE_BUILD_TYPE} == release ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
+ fi
;;
*) ;;
esac
-# @FUNCTION: _kde.org_is_unreleased
-# @INTERNAL
-# @DESCRIPTION:
-# Return true if $CATEGORY-$PV matches against an entry in KDE_UNRELEASED array.
-_kde.org_is_unreleased() {
- local pair
- for pair in "${KDE_UNRELEASED[@]}" ; do
- if [[ "${pair}" == "${CATEGORY}-${PV}" ]]; then
- return 0
- elif [[ ${KDE_GEAR} == true ]]; then
- if [[ "${pair/kde-apps/${CATEGORY}}" == "${CATEGORY}-${PV}" ]]; then
- return 0
- fi
- fi
- done
-
- return 1
-}
-
# @FUNCTION: _kde.org_calculate_src_uri
# @INTERNAL
# @DESCRIPTION:
@@ -192,6 +190,18 @@ _kde.org_is_unreleased() {
_kde.org_calculate_src_uri() {
debug-print-function ${FUNCNAME} "$@"
+ if [[ -n ${KDE_ORG_COMMIT} ]]; then
+ SRC_URI="https://invent.kde.org/${KDE_ORG_CATEGORY}/${KDE_ORG_NAME}/-/"
+ SRC_URI+="archive/${KDE_ORG_COMMIT}/${KDE_ORG_NAME}-${KDE_ORG_COMMIT}.tar.gz"
+ SRC_URI+=" -> ${KDE_ORG_NAME}-${PV}-${KDE_ORG_COMMIT:0:8}.tar.gz"
+ fi
+
+ [[ ${KDE_ORG_UNRELEASED} == true ]] && RESTRICT+=" fetch"
+
+ if [[ -n ${_FRAMEWORKS_KDE_ORG_ECLASS} ]] || [[ -n ${_PLASMA_KDE_ORG_ECLASS} ]] || [[ -n ${_GEAR_KDE_ORG_ECLASS} ]] || [[ -n ${KDE_ORG_COMMIT} ]]; then
+ return
+ fi
+
local _src_uri="mirror://kde/"
if [[ ${KDE_GEAR} == true ]]; then
@@ -233,51 +243,18 @@ _kde.org_calculate_src_uri() {
;;
esac
- if [[ ${PN} == kdevelop* && ${PV} == 5.6.2 ]]; then
- _src_uri+="stable/kdevelop/${PV}/src/"
- fi
-
- if [[ -n ${KDE_ORG_COMMIT} ]]; then
- SRC_URI="https://invent.kde.org/${KDE_ORG_CATEGORY}/${KDE_ORG_NAME}/-/"
- SRC_URI+="archive/${KDE_ORG_COMMIT}/${KDE_ORG_NAME}-${KDE_ORG_COMMIT}.tar.gz"
- SRC_URI+=" -> ${KDE_ORG_NAME}-${PV}-${KDE_ORG_COMMIT:0:8}.tar.gz"
- else
- SRC_URI="${_src_uri}${KDE_ORG_NAME}-${PV}.tar.xz"
- fi
-
- if _kde.org_is_unreleased ; then
- RESTRICT+=" fetch"
- fi
-}
-
-# @FUNCTION: _kde.org_calculate_live_repo
-# @INTERNAL
-# @DESCRIPTION:
-# Determine fetch location for live sources
-_kde.org_calculate_live_repo() {
- debug-print-function ${FUNCNAME} "$@"
-
- SRC_URI=""
-
- EGIT_MIRROR=${EGIT_MIRROR:=https://invent.kde.org/${KDE_ORG_CATEGORY}}
-
- if [[ ${PV} == 5.??(.?)*.9999 && ${CATEGORY} == dev-qt ]]; then
- EGIT_BRANCH="kde/$(ver_cut 1-2)"
- fi
-
- if [[ ${PV} == ??.??.49.9999 && ${KDE_GEAR} == true ]]; then
- EGIT_BRANCH="release/$(ver_cut 1-2)"
- fi
-
- if [[ ${PV} != 9999 && ${CATEGORY} == kde-plasma ]]; then
- EGIT_BRANCH="Plasma/$(ver_cut 1-2)"
- fi
-
- EGIT_REPO_URI="${EGIT_MIRROR}/${EGIT_REPONAME:=$KDE_ORG_NAME}.git"
+ SRC_URI="${_src_uri}${KDE_ORG_NAME}-${PV}.tar.xz"
}
case ${KDE_BUILD_TYPE} in
- live) _kde.org_calculate_live_repo ;;
+ live)
+ EGIT_MIRROR=${EGIT_MIRROR:=https://invent.kde.org/${KDE_ORG_CATEGORY}}
+ EGIT_REPO_URI="${EGIT_MIRROR}/${EGIT_REPONAME:=$KDE_ORG_NAME}.git"
+
+ if [[ ${PV} == 5.??.?.9999 && ${CATEGORY} == dev-qt ]]; then
+ EGIT_BRANCH="kde/$(ver_cut 1-2)"
+ fi
+ ;;
*)
_kde.org_calculate_src_uri
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
@@ -296,20 +273,7 @@ esac
# KDE_UNRELEASED, display a giant warning that the package has not yet been
# released upstream and should not be used.
kde.org_pkg_nofetch() {
- if ! _kde.org_is_unreleased ; then
- return
- fi
-
- local sched_uri="https://community.kde.org/Schedules"
- case ${CATEGORY} in
- kde-frameworks) sched_uri+="/Frameworks" ;;
- kde-plasma) sched_uri+="/Plasma_5" ;;
- *)
- [[ ${KDE_GEAR} == true ]] &&
- sched_uri+="/KDE_Gear_$(ver_cut 1-2)_Schedule"
- ;;
- esac
-
+ [[ ${KDE_ORG_UNRELEASED} == true ]] || return
eerror " _ _ _ _ ____ _____ _ _____ _ ____ _____ ____ "
eerror "| | | | \ | | _ \| ____| | | ____| / \ / ___|| ____| _ \ "
eerror "| | | | \| | |_) | _| | | | _| / _ \ \___ \| _| | | | |"
@@ -329,7 +293,7 @@ kde.org_pkg_nofetch() {
eerror ""
eerror "Please consult the upstream release schedule to see when this "
eerror "package is scheduled to be released:"
- eerror "${sched_uri}"
+ eerror "${KDE_ORG_SCHEDULE_URI}"
}
# @FUNCTION: kde.org_src_unpack
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index b3fb5cef76c..50464470a9b 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -675,15 +675,7 @@ if [[ ${ETYPE} == sources ]]; then
# Bug #266157, deblob for libre support
if [[ -z ${K_PREDEBLOBBED} ]]; then
- # deblob less than 5.10 require python 2.7
- if kernel_is lt 5 10; then
- K_DEBLOB_AVAILABLE=0
- fi
if [[ ${K_DEBLOB_AVAILABLE} == 1 ]]; then
- PYTHON_COMPAT=( python3_{8..10} )
-
- inherit python-any-r1
-
IUSE="${IUSE} deblob"
# Reflect that kernels contain firmware blobs unless otherwise
@@ -691,8 +683,6 @@ if [[ ${ETYPE} == sources ]]; then
# tree has been dropped from the kernel.
kernel_is lt 4 14 && LICENSE+=" !deblob? ( linux-firmware )"
- BDEPEND+=" deblob? ( ${PYTHON_DEPS} )"
-
if [[ -n KV_MINOR ]]; then
DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
else
@@ -1470,8 +1460,10 @@ kernel-2_src_compile() {
cd "${S}" || die
if [[ ${K_DEBLOB_AVAILABLE} == 1 ]] && use deblob; then
+ einfo ">>> Patching deblob script for forcing awk ..."
+ sed -i '/check="\/bin\/sh $check"/a \ check="$check --use-awk"' \
+ "${T}/${DEBLOB_A}" || die "Failed to patch ${DEBLOB_A}"
einfo ">>> Running deblob script ..."
- python_setup
sh "${T}/${DEBLOB_A}" --force || die "Deblob script failed to run!!!"
fi
}
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index dbd9080ab98..750a8e873d9 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -196,16 +196,17 @@ kernel-build_src_install() {
local image_path=$(dist-kernel_get_image_path)
cp -p "build/${image_path}" "${ED}/usr/src/linux-${ver}/${image_path}" || die
- # Install the unstripped uncompressed vmlinux for use with systemtap
- # etc. Use mv rather than doins for the same reason as above --
- # space and time.
- if use debug; then
- mv build/vmlinux "${ED}/usr/src/linux-${ver}/" || die
- fi
-
# building modules fails with 'vmlinux has no symtab?' if stripped
use ppc64 && dostrip -x "/usr/src/linux-${ver}/${image_path}"
+ # Install vmlinux with debuginfo when requested
+ if use debug; then
+ if [[ "${image_path}" != "vmlinux" ]]; then
+ mv "build/vmlinux" "${ED}/usr/src/linux-${ver}/vmlinux" || die
+ fi
+ dostrip -x "/usr/src/linux-${ver}/vmlinux"
+ fi
+
# strip empty directories
find "${D}" -type d -empty -exec rmdir {} + || die
diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
index 5f2c445913c..1effcc55590 100644
--- a/eclass/llvm.eclass
+++ b/eclass/llvm.eclass
@@ -85,7 +85,7 @@ DEPEND="!!sys-devel/llvm:0"
# @INTERNAL
# @DESCRIPTION:
# Correct values of LLVM slots, newest first.
-declare -g -r _LLVM_KNOWN_SLOTS=( {15..8} )
+declare -g -r _LLVM_KNOWN_SLOTS=( {16..8} )
# @FUNCTION: get_llvm_prefix
# @USAGE: [-b|-d] [<max_slot>]
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 306b9c020e1..8f1f48414d1 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -45,13 +45,13 @@ esac
# @DESCRIPTION:
# The major version of current LLVM trunk. Used to determine
# the correct branch to use.
-_LLVM_MASTER_MAJOR=15
+_LLVM_MASTER_MAJOR=16
# @ECLASS_VARIABLE: _LLVM_NEWEST_MANPAGE_RELEASE
# @INTERNAL
# @DESCRIPTION:
# The newest release of LLVM for which manpages were generated.
-_LLVM_NEWEST_MANPAGE_RELEASE=14.0.5
+_LLVM_NEWEST_MANPAGE_RELEASE=14.0.6
# @ECLASS_VARIABLE: _LLVM_SOURCE_TYPE
# @INTERNAL
@@ -161,7 +161,9 @@ case ${PV} in
)
;;
*)
- ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY LoongArch M68k )
+ ALL_LLVM_EXPERIMENTAL_TARGETS=(
+ ARC CSKY DirectX LoongArch M68k SPIRV
+ )
ALL_LLVM_PRODUCTION_TARGETS=(
AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 NVPTX
PowerPC RISCV Sparc SystemZ VE WebAssembly X86 XCore
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 905c4d89f50..a79019ccfd3 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -5,7 +5,7 @@
# @MAINTAINER:
# William Hubbs <williamh@gentoo.org>
# Mike Gilbert <floppym@gentoo.org>
-# @SUPPORTED_EAPIS: 6 7 8
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: common ebuild functions for meson-based packages
# @DESCRIPTION:
# This eclass contains the default phase functions for packages which
@@ -35,29 +35,22 @@
# @CODE
case ${EAPI} in
- 6|7|8) ;;
+ 7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_MESON_ECLASS} ]]; then
_MESON_ECLASS=1
-[[ ${EAPI} == 6 ]] && inherit eapi7-ver
inherit multiprocessing ninja-utils python-utils-r1 toolchain-funcs
EXPORT_FUNCTIONS src_configure src_compile src_test src_install
-_MESON_DEPEND=">=dev-util/meson-0.59.4
+BDEPEND=">=dev-util/meson-0.62.2
${NINJA_DEPEND}
dev-util/meson-format-array
"
-if [[ ${EAPI} == 6 ]]; then
- DEPEND=${_MESON_DEPEND}
-else
- BDEPEND=${_MESON_DEPEND}
-fi
-
# @ECLASS_VARIABLE: BUILD_DIR
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -414,6 +407,7 @@ meson_src_test() {
debug-print-function ${FUNCNAME} "$@"
local mesontestargs=(
+ --print-errorlogs
-C "${BUILD_DIR}"
--num-processes "$(makeopts_jobs "${MAKEOPTS}")"
"$@"
@@ -434,6 +428,7 @@ meson_install() {
local mesoninstallargs=(
-C "${BUILD_DIR}"
--destdir "${D}"
+ --no-rebuild
"$@"
)
diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass
index 8cea230a959..2d94be6baee 100644
--- a/eclass/mozcoreconf-v6.eclass
+++ b/eclass/mozcoreconf-v6.eclass
@@ -78,10 +78,10 @@ mozconfig_use_with() {
moz_pkgsetup() {
# Ensure we use C locale when building
- export LANG="C"
- export LC_ALL="C"
- export LC_MESSAGES="C"
- export LC_CTYPE="C"
+ export LANG="C.UTF-8"
+ export LC_ALL="C.UTF-8"
+ export LC_MESSAGES="C.UTF-8"
+ export LC_CTYPE="C.UTF-8"
# Ensure we use correct toolchain
export HOST_CC="$(tc-getBUILD_CC)"
@@ -195,8 +195,13 @@ mozconfig_init() {
# Strip optimization so it does not end up in compile string
filter-flags '-O*'
+ # elf-hack is broken on x86 and disabled by default.
if is-flagq '-g*' ; then
- mozconfig_annotate 'elf-hack broken with -g* flags' --disable-elf-hack
+ case "${ARCH}" in
+ amd64 | arm)
+ mozconfig_annotate 'elf-hack is broken with -g* flags' --disable-elf-hack
+ ;;
+ esac
fi
# Strip over-aggressive CFLAGS
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index 8590bbdfbff..e3c0d78a6e4 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -4,14 +4,13 @@
# @ECLASS: multilib.eclass
# @MAINTAINER:
# toolchain@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: This eclass is for all functions pertaining to handling multilib configurations.
# @DESCRIPTION:
# This eclass is for all functions pertaining to handling multilib configurations.
-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
@@ -40,32 +39,6 @@ has_multilib_profile() {
[ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ]
}
-# @FUNCTION: get_libdir
-# @RETURN: the libdir for the selected ABI
-# @DESCRIPTION:
-# This function simply returns the desired lib directory. With portage
-# 2.0.51, we now have support for installing libraries to lib32/lib64
-# to accomidate the needs of multilib systems. It's no longer a good idea
-# to assume all libraries will end up in lib. Replace any (sane) instances
-# where lib is named directly with $(get_libdir) if possible.
-#
-# Jeremy Huddleston <eradicator@gentoo.org> (23 Dec 2004):
-# Added support for ${ABI} and ${DEFAULT_ABI}. If they're both not set,
-# fall back on old behavior. Any profile that has these set should also
-# depend on a newer version of portage (not yet released) which uses these
-# over CONF_LIBDIR in econf, dolib, etc...
-if [[ ${EAPI} == [05] ]] ; then
- get_libdir() {
- local CONF_LIBDIR
- if [ -n "${CONF_LIBDIR_OVERRIDE}" ] ; then
- # if there is an override, we want to use that... always.
- echo ${CONF_LIBDIR_OVERRIDE}
- else
- get_abi_LIBDIR
- fi
- }
-fi
-
# @FUNCTION: get_abi_var
# @USAGE: <VAR> [ABI]
# @RETURN: returns the value of ${<VAR>_<ABI>} which should be set in make.defaults
diff --git a/eclass/opam.eclass b/eclass/opam.eclass
index dee40a4e9f9..197c3256f01 100644
--- a/eclass/opam.eclass
+++ b/eclass/opam.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: opam.eclass
@@ -7,15 +7,15 @@
# ML <ml@gentoo.org>
# @AUTHOR:
# Alexis Ballier <aballier@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: Provides functions for installing opam packages.
# @DESCRIPTION:
# Provides dependencies on opam and ocaml, opam-install and a default
# src_install for opam-based packages.
-case ${EAPI:-0} in
- 5|6|7) ;;
- *) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
+case ${EAPI} in
+ 7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# Do not complain about CFLAGS etc since ml projects do not use them.
@@ -28,15 +28,8 @@ QA_FLAGS_IGNORED='.*'
: ${OPAM_INSTALLER_DEP:="dev-ml/opam-installer"}
RDEPEND=">=dev-lang/ocaml-4:="
-case ${EAPI:-0} in
- 5|6)
- DEPEND="${RDEPEND} ${OPAM_INSTALLER_DEP}"
- ;;
- *)
- BDEPEND="${OPAM_INSTALLER_DEP} dev-lang/ocaml"
- DEPEND="${RDEPEND}"
- ;;
-esac
+BDEPEND="${OPAM_INSTALLER_DEP} dev-lang/ocaml"
+DEPEND="${RDEPEND}"
# @ECLASS_VARIABLE: OPAM_INSTALLER
# @DESCRIPTION:
@@ -52,10 +45,10 @@ opam-install() {
local pkg
for pkg ; do
${OPAM_INSTALLER} -i \
- --prefix="${ED%/}/usr" \
- --libdir="${D%/}/$(ocamlc -where)" \
- --docdir="${ED%/}/usr/share/doc/${PF}" \
- --mandir="${ED%/}/usr/share/man" \
+ --prefix="${ED}/usr" \
+ --libdir="${D}/$(ocamlc -where)" \
+ --docdir="${ED}/usr/share/doc/${PF}" \
+ --mandir="${ED}/usr/share/man" \
"${pkg}.install" || die
done
}
@@ -64,9 +57,9 @@ opam_src_install() {
local pkg="${1:-${PN}}"
opam-install "${pkg}"
# Handle opam putting doc in a subdir
- if [ -d "${ED%/}/usr/share/doc/${PF}/${pkg}" ] ; then
- mv "${ED%/}/usr/share/doc/${PF}/${pkg}/"* "${ED%/}/usr/share/doc/${PF}/" || die
- rmdir "${ED%/}/usr/share/doc/${PF}/${pkg}" || die
+ if [[ -d ${ED}/usr/share/doc/${PF}/${pkg} ]] ; then
+ mv "${ED}/usr/share/doc/${PF}/${pkg}/"* "${ED}/usr/share/doc/${PF}/" || die
+ rmdir "${ED}/usr/share/doc/${PF}/${pkg}" || die
fi
}
diff --git a/eclass/optfeature.eclass b/eclass/optfeature.eclass
index acf8584e6db..b44fc1b8525 100644
--- a/eclass/optfeature.eclass
+++ b/eclass/optfeature.eclass
@@ -1,14 +1,14 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: optfeature.eclass
# @MAINTAINER:
# base-system@gentoo.org
-# @SUPPORTED_EAPIS: 6 7 8
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: Advertise optional functionality that might be useful to users
case ${EAPI} in
- 6|7|8) ;;
+ 7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
esac
diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
index 4adba921485..142fdeb8cfb 100644
--- a/eclass/perl-functions.eclass
+++ b/eclass/perl-functions.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: perl-functions.eclass
@@ -8,7 +8,7 @@
# Seemant Kulleen <seemant@gentoo.org>
# Andreas K. Huettel <dilfridge@gentoo.org>
# Kent Fredric <kentnl@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: helper functions eclass for perl modules
# @DESCRIPTION:
# The perl-functions eclass is designed to allow easier installation of perl
@@ -16,16 +16,16 @@
# It provides helper functions, no phases or variable manipulation in
# global scope.
-[[ ${CATEGORY} == "perl-core" ]] && inherit alternatives
-
-case "${EAPI:-0}" in
- 5|6|7|8)
+case ${EAPI} in
+ 7|8)
;;
*)
- die "EAPI=${EAPI} is not supported by perl-functions.eclass"
+ die "${ECLASS}: EAPI ${EAPI:-0} not supported"
;;
esac
+[[ ${CATEGORY} == "perl-core" ]] && inherit alternatives
+
perlinfo_done=false
# @FUNCTION: perl_set_version
@@ -44,7 +44,8 @@ perlinfo_done=false
# echo $PERL_VERSION
# @CODE
perl_set_version() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}"
${perlinfo_done} && return 0
perlinfo_done=true
@@ -65,7 +66,7 @@ perl_set_version() {
#
# This function used to be called fixlocalpod as well.
perl_delete_localpod() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
find "${D}" -type f -name perllocal.pod -delete
find "${D}" -depth -mindepth 1 -type d -empty -delete
@@ -75,7 +76,7 @@ perl_delete_localpod() {
# @DESCRIPTION:
# Look through ${S} for AppleDouble encoded files and get rid of them.
perl_fix_osx_extra() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
local f
find "${S}" -type f -name "._*" -print0 | while read -rd '' f ; do
@@ -92,7 +93,7 @@ perl_fix_osx_extra() {
# Bump off manpages installed by the current module such as *.3pm files as well
# as empty directories.
perl_delete_module_manpages() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
if [[ -d "${ED}"/usr/share/man ]] ; then
find "${ED}"/usr/share/man -type f -name "*.3pm" -delete
@@ -105,7 +106,8 @@ perl_delete_module_manpages() {
# Look through ${D} for .packlist files, empty .bs files and empty directories,
# and get rid of items found.
perl_delete_packlist() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
perl_set_version
if [[ -d ${D}/${VENDOR_ARCH} ]] ; then
find "${D}/${VENDOR_ARCH}" -type f -a -name .packlist -delete
@@ -118,7 +120,8 @@ perl_delete_packlist() {
# Look through ${D} for empty .bs files and empty directories,
# and get rid of items found.
perl_delete_emptybsdir() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
perl_set_version
if [[ -d ${D}/${VENDOR_ARCH} ]] ; then
find "${D}/${VENDOR_ARCH}" -type f \
@@ -132,7 +135,8 @@ perl_delete_emptybsdir() {
# Make all of ${D} user-writable, since EU::MM does silly things with
# the w bit. See bug 554346.
perl_fix_permissions() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
perl_set_version
einfo Fixing installed file permissions
fperms -R u+w /
@@ -145,7 +149,7 @@ perl_fix_permissions() {
# Remove duplicate entries; then validate all entries in the packlist against ${D}
# and prune entries that do not correspond to installed files.
perl_fix_packlist() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
local packlist_temp="${T}/.gentoo_packlist_temp"
find "${D}" -type f -name '.packlist' -print0 | while read -rd '' f ; do
@@ -161,7 +165,7 @@ perl_fix_packlist() {
# remove files that dont exist
cat "${f}" | while read -r entry; do
- if [ ! -e "${D}/${entry}" ]; then
+ if [[ ! -e ${D}/${entry} ]]; then
einfo "Pruning surplus packlist entry ${entry}"
grep -v -x -F "${entry}" "${f}" > "${packlist_temp}"
mv "${packlist_temp}" "${f}"
@@ -176,7 +180,7 @@ perl_fix_packlist() {
# Look through ${D} for text files containing the temporary installation
# folder (i.e. ${D}). If the pattern is found, replace it with `/' and warn.
perl_remove_temppath() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do
if file "${f}" | grep -q -i " text" ; then
@@ -209,7 +213,8 @@ perl_remove_temppath() {
# }
# @CODE
perl_rm_files() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
local skipfile="${T}/.gentoo_makefile_skip"
local manifile="${S}/MANIFEST"
local manitemp="${T}/.gentoo_manifest_temp"
@@ -236,10 +241,9 @@ perl_rm_files() {
# lead to file collisions. Mainly for use in pkg_postinst and pkg_postrm, and makes
# only sense for perl-core packages.
perl_link_duallife_scripts() {
- debug-print-function $FUNCNAME "$@"
- if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then
- return 0
- fi
+ debug-print-function ${FUNCNAME} "$@"
+
+ [[ ${CATEGORY} != perl-core ]] && return 0
local i ff
if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then
@@ -278,12 +282,12 @@ perl_check_env() {
for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do
# Next unless match
- [ -v $i ] || continue;
+ [[ -v $i ]] || continue;
# Warn only once, and warn only when one of the bad values are set.
# record failure here.
- if [ ${errored:-0} == 0 ]; then
- if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
+ if [[ ${errored:-0} == 0 ]]; then
+ if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then
elog "perl-module.eclass: Suspicious environment values found.";
else
eerror "perl-module.eclass: Suspicious environment values found.";
@@ -295,7 +299,7 @@ perl_check_env() {
value=${!i};
# Print ENV name/value pair
- if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
+ if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then
elog " $i=\"$value\"";
else
eerror " $i=\"$value\"";
@@ -303,10 +307,10 @@ perl_check_env() {
done
# Return if there were no failures
- [ ${errored:-0} == 0 ] && return;
+ [[ ${errored:-0} == 0 ]] && return;
# Return if user knows what they're doing
- if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
+ if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then
elog "Continuing anyway, seems you know what you're doing."
return
fi
@@ -330,7 +334,7 @@ perl_check_env() {
# }
# @CODE
perl_doexamples() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
einfo "Installing examples into /usr/share/doc/${PF}/examples"
@@ -364,7 +368,7 @@ perl_doexamples() {
# @CODE
perl_has_module() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
[[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided"
[[ $# -lt 2 ]] || die "${FUNCNAME}: Too many parameters ($#)"
@@ -402,7 +406,7 @@ perl_has_module() {
# && echo "Test::Tester 0.017 or greater installed"
# @CODE
perl_has_module_version() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
[[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided"
[[ $# -gt 1 ]] || die "${FUNCNAME}: No module version provided"
@@ -443,7 +447,7 @@ perl_has_module_version() {
# @CODE
perl_get_module_version() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
[[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided"
[[ $# -lt 2 ]] || die "${FUNCNAME}: Too many parameters ($#)"
@@ -489,7 +493,7 @@ perl_get_module_version() {
# @CODE
perl_get_raw_vendorlib() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
[[ $# -lt 1 ]] || die "${FUNCNAME}: Too many parameters ($#)"
@@ -510,7 +514,7 @@ perl_get_raw_vendorlib() {
# @CODE
perl_get_vendorlib() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
[[ $# -lt 1 ]] || die "${FUNCNAME}: Too many parameters ($#)"
@@ -609,7 +613,7 @@ perl_domodule() {
# @CODE
perl_get_wikiurl() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
if [[ -z "${1}" ]]; then
echo "https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/${CATEGORY}/${PN}"
diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index 273cc2bc805..25490c25058 100644
--- a/eclass/perl-module.eclass
+++ b/eclass/perl-module.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: perl-module.eclass
@@ -7,7 +7,7 @@
# @AUTHOR:
# Seemant Kulleen <seemant@gentoo.org>
# Andreas K. Hüttel <dilfridge@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 7 8
# @PROVIDES: perl-functions
# @BLURB: eclass for installing Perl module distributions
# @DESCRIPTION:
@@ -19,12 +19,8 @@
# ExtUtils::MakeMaker or Module::Build), we recommend to use perl-functions.eclass
# instead.
-case ${EAPI:-0} in
- 5)
- inherit eutils multiprocessing unpacker perl-functions
- PERL_EXPF="src_unpack src_prepare src_configure src_compile src_test src_install"
- ;;
- 6|7)
+case ${EAPI} in
+ 7)
inherit multiprocessing perl-functions
PERL_EXPF="src_prepare src_configure src_compile src_test src_install"
;;
@@ -33,7 +29,7 @@ case ${EAPI:-0} in
PERL_EXPF="src_prepare src_configure src_compile src_test src_install"
;;
*)
- die "EAPI=${EAPI} is not supported by perl-module.eclass"
+ die "${ECLASS}: EAPI ${EAPI:-0} not supported"
;;
esac
@@ -43,69 +39,12 @@ esac
# This variable controls whether a runtime and build time dependency on
# dev-lang/perl is automatically added by the eclass. It defaults to yes.
# Set to no to disable, set to noslotop to add a perl dependency without
-# slot operator (EAPI=6). All packages installing into the vendor_perl
+# slot operator. All packages installing into the vendor_perl
# path must use yes here. (EAPI=8 and later) Also adds a test useflag,
# a use-conditional build time dependency on virtual/perl-Test-Simple, and
# the required RESTRICT setting.
-case ${EAPI:-0} in
- 5)
- [[ ${CATEGORY} == perl-core ]] && \
- PERL_EXPF+=" pkg_postinst pkg_postrm"
-
- case "${GENTOO_DEPEND_ON_PERL:-yes}" in
- yes)
- case "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" in
- yes)
- DEPEND="dev-lang/perl:=[-build(-)]"
- ;;
- *)
- DEPEND="dev-lang/perl[-build(-)]"
- ;;
- esac
- RDEPEND="${DEPEND}"
- ;;
- esac
-
- case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
- yes)
- EXPORT_FUNCTIONS ${PERL_EXPF}
- ;;
- no)
- debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
- ;;
- *)
- die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass"
- ;;
- esac
- ;;
- 6)
- [[ ${CATEGORY} == perl-core ]] && \
- PERL_EXPF+=" pkg_postinst pkg_postrm"
-
- case "${GENTOO_DEPEND_ON_PERL:-yes}" in
- yes)
- DEPEND="dev-lang/perl"
- RDEPEND="dev-lang/perl:="
- ;;
- noslotop)
- DEPEND="dev-lang/perl"
- RDEPEND="dev-lang/perl"
- ;;
- esac
-
- if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" != "yes" ]]; then
- eerror "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned in EAPI=6 and later. If you don't want a slot operator"
- die "set GENTOO_DEPEND_ON_PERL=noslotop instead."
- fi
-
- if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
- eerror "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6 and later. Use perl-module.eclass if you need"
- die "phase functions, perl-functions.eclass if not."
- fi
-
- EXPORT_FUNCTIONS ${PERL_EXPF}
- ;;
+case ${EAPI} in
7)
[[ ${CATEGORY} == perl-core ]] && \
PERL_EXPF+=" pkg_postinst pkg_postrm"
@@ -124,11 +63,11 @@ case ${EAPI:-0} in
esac
if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" != "yes" ]]; then
- die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned in EAPI=6 and later."
+ die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned."
fi
if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
- die "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6 and later."
+ die "PERL_EXPORT_PHASE_FUNCTIONS is banned."
fi
EXPORT_FUNCTIONS ${PERL_EXPF}
@@ -154,11 +93,11 @@ case ${EAPI:-0} in
esac
if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" != "yes" ]]; then
- die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned in EAPI=6 and later."
+ die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned."
fi
if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
- die "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6 and later."
+ die "PERL_EXPORT_PHASE_FUNCTIONS is banned."
fi
EXPORT_FUNCTIONS ${PERL_EXPF}
@@ -170,46 +109,43 @@ LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"
# @ECLASS_VARIABLE: DIST_NAME
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) This variable provides a way to override PN for the calculation of S,
+# This variable provides a way to override PN for the calculation of S,
# SRC_URI, and HOMEPAGE. If unset, defaults to PN.
# @ECLASS_VARIABLE: DIST_VERSION
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) This variable provides a way to override PV for the calculation of S and SRC_URI.
+# This variable provides a way to override PV for the calculation of S and SRC_URI.
# Use it to provide the non-normalized, upstream version number. If unset, defaults to PV.
-# Named MODULE_VERSION in EAPI=5.
# @ECLASS_VARIABLE: DIST_A_EXT
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) This variable provides a way to override the distfile extension for the calculation of
-# SRC_URI. If unset, defaults to tar.gz. Named MODULE_A_EXT in EAPI=5.
+# This variable provides a way to override the distfile extension for the calculation of
+# SRC_URI. If unset, defaults to tar.gz.
# @ECLASS_VARIABLE: DIST_A
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) This variable provides a way to override the distfile name for the calculation of
-# SRC_URI. If unset, defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT} Named MODULE_A in EAPI=5.
+# This variable provides a way to override the distfile name for the calculation of
+# SRC_URI. If unset, defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT}.
# @ECLASS_VARIABLE: DIST_AUTHOR
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) This variable sets the module author name for the calculation of
-# SRC_URI. Named MODULE_AUTHOR in EAPI=5.
+# This variable sets the module author name for the calculation of SRC_URI.
# @ECLASS_VARIABLE: DIST_SECTION
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) This variable sets the module section for the calculation of
+# This variable sets the module section for the calculation of
# SRC_URI. Only required in rare cases for very special snowflakes.
-# Named MODULE_SECTION in EAPI=5.
# @ECLASS_VARIABLE: DIST_EXAMPLES
# @PRE_INHERIT
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) This Bash array allows passing a list of example files to be installed
+# This Bash array allows passing a list of example files to be installed
# in /usr/share/doc/${PF}/examples. If set before inherit, automatically adds
# a use-flag examples, if not you'll have to add the useflag in your ebuild.
# Examples are installed only if the useflag examples exists and is activated.
@@ -233,67 +169,31 @@ if [[ $(declare -p DIST_MAKE 2>&-) != "declare -a DIST_MAKE="* ]]; then
DIST_MAKE=( OPTIMIZE="${CFLAGS}" )
fi
+DIST_NAME=${DIST_NAME:-${PN}}
+DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
+S=${WORKDIR}/${DIST_P}
-if [[ ${EAPI:-0} == 5 ]]; then
- if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
- : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
- S=${MY_S:-${WORKDIR}/${MY_P}}
- fi
- MODULE_NAME=${MY_PN:-${PN}}
- MODULE_P=${MY_P:-${P}}
-
- [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
- MODULE_A="${MODULE_P}.${MODULE_A_EXT:-tar.gz}"
- [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
- SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
- [[ -z "${HOMEPAGE}" ]] && \
- HOMEPAGE="https://metacpan.org/release/${MODULE_NAME}"
-
- SRC_TEST="skip"
-else
- DIST_NAME=${DIST_NAME:-${PN}}
- DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
- S=${WORKDIR}/${DIST_P}
-
- [[ -z "${SRC_URI}" && -z "${DIST_A}" ]] && \
- DIST_A="${DIST_P}.${DIST_A_EXT:-tar.gz}"
- [[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] && \
- SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}"
- [[ -z "${HOMEPAGE}" ]] && \
- HOMEPAGE="https://metacpan.org/release/${DIST_NAME}"
-
- [[ -z "${DIST_EXAMPLES}" ]] || IUSE+=" examples"
-fi
+[[ -z "${SRC_URI}" && -z "${DIST_A}" ]] &&
+ DIST_A="${DIST_P}.${DIST_A_EXT:-tar.gz}"
+[[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] &&
+ SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}"
+[[ -z "${HOMEPAGE}" ]] &&
+ HOMEPAGE="https://metacpan.org/release/${DIST_NAME}"
+
+[[ -z "${DIST_EXAMPLES}" ]] || IUSE+=" examples"
-SRC_PREP="no"
PREFER_BUILDPL="yes"
pm_echovar=""
-# @FUNCTION: perl-module_src_unpack
-# @DESCRIPTION:
-# Unpack the ebuild tarball(s).
-# This function is to be called during the ebuild src_unpack() phase.
-perl-module_src_unpack() {
- debug-print-function $FUNCNAME "$@"
- [[ ${EAPI:-0} == 5 ]] || die "perl-module_src_unpack is banned in EAPI=6 or later"
- unpacker_src_unpack
-}
-
# @FUNCTION: perl-module_src_prepare
# @DESCRIPTION:
# Get the ebuild sources ready.
# This function is to be called during the ebuild src_prepare() phase.
perl-module_src_prepare() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
- if [[ ${EAPI:-0} == 5 ]] ; then
- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
- debug-print "$FUNCNAME: applying user patches"
- epatch_user
- else
- default
- fi
+ default
if [[ ${PERL_RM_FILES[@]} ]]; then
debug-print "$FUNCNAME: stripping unneeded files"
@@ -307,12 +207,7 @@ perl-module_src_prepare() {
# Configure the ebuild sources.
# This function is to be called during the ebuild src_configure() phase.
perl-module_src_configure() {
- debug-print-function $FUNCNAME "$@"
-
- if [[ ${EAPI:-0} == 5 && ${SRC_PREP} == yes ]]; then
- return 0
- fi
- SRC_PREP="yes"
+ debug-print-function ${FUNCNAME} "$@"
perl_check_env
@@ -329,38 +224,20 @@ perl-module_src_configure() {
fi
if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then
- case ${EAPI:-0} in
- 5|6)
- if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then
- einfo "Using Module::Build::Tiny"
- if [[ ${DEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
- eerror "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it."
- die " Add dev-perl/Module-Build-Tiny to DEPEND!"
- fi
- else
- einfo "Using Module::Build"
- if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${DEPEND} != *dev-perl/Module-Build* && ${PN} != Module-Build ]] ; then
- eerror "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
- die " Add dev-perl/Module-Build to DEPEND!"
- fi
- fi
- ;;
- *)
- if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then
- einfo "Using Module::Build::Tiny"
- if [[ ${BDEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
- eerror "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it."
- eerror " Add dev-perl/Module-Build-Tiny to BDEPEND!"
- fi
- else
- einfo "Using Module::Build"
- if [[ ${BDEPEND} != *virtual/perl-Module-Build* && ${BDEPEND} != *dev-perl/Module-Build* && ${PN} != Module-Build ]] ; then
- eerror "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
- eerror " Add dev-perl/Module-Build to BDEPEND!"
- fi
- fi
- ;;
- esac
+ if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then
+ einfo "Using Module::Build::Tiny"
+ if [[ ${BDEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
+ eerror "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it."
+ eerror " Add dev-perl/Module-Build-Tiny to BDEPEND!"
+ fi
+ else
+ einfo "Using Module::Build"
+ if [[ ${BDEPEND} != *virtual/perl-Module-Build* && ${BDEPEND} != *dev-perl/Module-Build* && ${PN} != Module-Build ]] ; then
+ eerror "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
+ eerror " Add dev-perl/Module-Build to BDEPEND!"
+ fi
+ fi
+
set -- \
--installdirs=vendor \
--libdoc= \
@@ -393,11 +270,12 @@ perl-module_src_configure() {
# Compile the ebuild sources.
# This function is to be called during the ebuild src_compile() phase.
perl-module_src_compile() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
perl_set_version
case ${EAPI} in
- 5|6|7)
+ 7)
if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then
local mymake_local=(${mymake})
else
@@ -416,21 +294,16 @@ perl-module_src_compile() {
set -- \
OTHERLDFLAGS="${LDFLAGS}" \
"${mymake_local[@]}"
- einfo "emake" "$@"
- emake "$@" \
- || die "Compilation failed"
-# OPTIMIZE="${CFLAGS}" \
+ emake "$@"
fi
}
# @ECLASS_VARIABLE: DIST_TEST
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) Variable that controls if tests are run in the test phase
+# Variable that controls if tests are run in the test phase
# at all, and if yes under which conditions. If unset, defaults to "do parallel"
# If neither "do" nor "parallel" is recognized, tests are skipped.
-# (In EAPI=5 the variable is called SRC_TEST, defaults to "skip", and
-# recognizes fewer options.)
# The following space-separated keywords are recognized:
# do : run tests
# parallel : run tests in parallel
@@ -441,7 +314,7 @@ perl-module_src_compile() {
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
-# (EAPI=6 and later) Variable that controls if tests are run in the test phase
+# Variable that controls if tests are run in the test phase
# at all, and if yes under which conditions. It is intended for use in
# make.conf or the environment by ebuild authors during testing, and
# accepts the same values as DIST_TEST. If set, it overrides DIST_TEST
@@ -452,50 +325,37 @@ perl-module_src_compile() {
# This code attempts to work out your threadingness and runs tests
# according to the settings of DIST_TEST using Test::Harness.
perl-module_src_test() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
local my_test_control
local my_test_verbose
- if [[ ${EAPI} == 5 ]] ; then
- my_test_control=${SRC_TEST}
- my_test_verbose=${TEST_VERBOSE:-0}
- if has 'do' ${my_test_control} || has 'parallel' ${my_test_control} ; then
- if has "${my_test_verbose}" 0 && has 'parallel' ${my_test_control} ; then
- export HARNESS_OPTIONS=j$(makeopts_jobs)
- einfo "Test::Harness Jobs=$(makeopts_jobs)"
- fi
- else
- einfo Skipping tests due to SRC_TEST=${SRC_TEST}
- return 0
- fi
- else
- [[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE}
- my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}
+ [[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn "DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE}"
+ my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}
- if ! has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control} ; then
- einfo Skipping tests due to DIST_TEST=${my_test_control}
- return 0
- fi
+ if ! has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control} ; then
+ einfo Skipping tests due to DIST_TEST=${my_test_control}
+ return 0
+ fi
- if has verbose ${my_test_control} ; then
- my_test_verbose=1
- else
- my_test_verbose=0
- fi
+ if has verbose ${my_test_control} ; then
+ my_test_verbose=1
+ else
+ my_test_verbose=0
+ fi
- if has parallel ${my_test_control} ; then
- export HARNESS_OPTIONS=j$(makeopts_jobs)
- einfo "Test::Harness Jobs=$(makeopts_jobs)"
- fi
+ if has parallel ${my_test_control} ; then
+ export HARNESS_OPTIONS=j$(makeopts_jobs)
+ einfo "Test::Harness Jobs=$(makeopts_jobs)"
+ fi
- # this might sometimes work...
- if ! has network ${my_test_control} ; then
- export NO_NETWORK_TESTING=1
- fi
+ # this might sometimes work...
+ if ! has network ${my_test_control} ; then
+ export NO_NETWORK_TESTING=1
fi
case ${EAPI} in
- 5|6|7)
+ 7)
;;
*)
if has 'tests' ${DIST_WIKI} ; then
@@ -510,7 +370,7 @@ perl-module_src_test() {
if [[ -f Build ]] ; then
./Build test verbose=${my_test_verbose} || die "test failed"
elif [[ -f Makefile ]] ; then
- emake test TEST_VERBOSE=${my_test_verbose} || die "test failed"
+ emake test TEST_VERBOSE=${my_test_verbose}
fi
}
@@ -519,7 +379,7 @@ perl-module_src_test() {
# Install a Perl ebuild.
# This function is to be called during the ebuild src_install() phase.
perl-module_src_install() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
perl_set_version
@@ -541,12 +401,11 @@ perl-module_src_install() {
else
local myinst_local=("${myinst[@]}")
fi
- emake "${myinst_local[@]}" ${mytargets} \
- || die "emake ${myinst_local[@]} ${mytargets} failed"
+ emake "${myinst_local[@]}" ${mytargets}
fi
case ${EAPI} in
- 5|6|7)
+ 7)
;;
*)
perl_fix_permissions
@@ -555,28 +414,22 @@ perl-module_src_install() {
perl_delete_module_manpages
perl_delete_localpod
- if [[ ${EAPI} == 5 ]] ; then
- perl_delete_packlist
- else
- perl_fix_packlist
- perl_delete_emptybsdir
- fi
+ perl_fix_packlist
+ perl_delete_emptybsdir
perl_remove_temppath
for f in Change* CHANGES README* TODO FAQ ${mydoc}; do
[[ -s ${f} ]] && dodoc ${f}
done
- if [[ ${EAPI} != 5 ]] ; then
- if in_iuse examples && use examples ; then
- [[ ${#DIST_EXAMPLES[@]} -eq 0 ]] || perl_doexamples "${DIST_EXAMPLES[@]}"
- fi
+ if in_iuse examples && use examples ; then
+ [[ ${#DIST_EXAMPLES[@]} -eq 0 ]] || perl_doexamples "${DIST_EXAMPLES[@]}"
fi
perl_link_duallife_scripts
case ${EAPI} in
- 5|6|7)
+ 7)
;;
*)
if has 'features' ${DIST_WIKI} ; then
@@ -599,7 +452,8 @@ perl-module_src_install() {
# links that prevent file collisions for dual-life packages installing scripts.
# In any other category it immediately exits.
perl-module_pkg_postinst() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
if [[ ${CATEGORY} != perl-core ]] ; then
eerror "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category."
die " This does not do anything; the call can be removed."
@@ -614,7 +468,8 @@ perl-module_pkg_postinst() {
# links that prevent file collisions for dual-life packages installing scripts.
# In any other category it immediately exits.
perl-module_pkg_postrm() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
+
if [[ ${CATEGORY} != perl-core ]] ; then
eerror "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category."
die " This does not do anything; the call can be removed."
diff --git a/eclass/plasma-mobile.kde.org.eclass b/eclass/plasma-mobile.kde.org.eclass
new file mode 100644
index 00000000000..91397cd1c0e
--- /dev/null
+++ b/eclass/plasma-mobile.kde.org.eclass
@@ -0,0 +1,51 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: plasma-mobile.kde.org.eclass
+# @MAINTAINER:
+# kde@gentoo.org
+# @SUPPORTED_EAPIS: 8
+# @PROVIDES: kde.org
+# @BLURB: Support eclass for KDE Plasma Mobile packages.
+# @DESCRIPTION:
+# This eclass extends kde.org.eclass for Plasma Mobile release group to assemble
+# default SRC_URI for tarballs, set up git-r3.eclass for stable/master branch
+# versions or restrict access to unreleased (packager access only) tarballs
+# in Gentoo KDE overlay.
+#
+# This eclass unconditionally inherits kde.org.eclass and all its public
+# variables and helper functions (not phase functions) may be considered as
+# part of this eclass's API.
+
+case ${EAPI} in
+ 8) ;;
+ *) die "EAPI=${EAPI:-0} is not supported" ;;
+esac
+
+if [[ -z ${_PLASMA_MOBILE_KDE_ORG_ECLASS} ]]; then
+_PLASMA_MOBILE_KDE_ORG_ECLASS=1
+
+# @ECLASS_VARIABLE: KDE_ORG_CATEGORY
+# @PRE_INHERIT
+# @DESCRIPTION:
+# For proper description see kde.org.eclass manpage.
+: ${KDE_ORG_CATEGORY:=plasma-mobile}
+
+inherit kde.org
+
+HOMEPAGE="https://plasma-mobile.org/"
+
+SLOT=5/${PV}
+[[ ${KDE_BUILD_TYPE} == release ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
+
+# @ECLASS_VARIABLE: KDE_ORG_SCHEDULE_URI
+# @INTERNAL
+# @DESCRIPTION:
+# For proper description see kde.org.eclass manpage.
+KDE_ORG_SCHEDULE_URI="https://invent.kde.org/plasma/plasma-mobile/-/wikis/Release-Schedule"
+
+if [[ ${KDE_BUILD_TYPE} != live && -z ${KDE_ORG_COMMIT} ]]; then
+ SRC_URI="mirror://kde/stable/plasma-mobile/${PV}/${KDE_ORG_NAME}-${PV}.tar.xz"
+fi
+
+fi
diff --git a/eclass/plasma.kde.org.eclass b/eclass/plasma.kde.org.eclass
new file mode 100644
index 00000000000..b0aad867ec1
--- /dev/null
+++ b/eclass/plasma.kde.org.eclass
@@ -0,0 +1,66 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: plasma.kde.org.eclass
+# @MAINTAINER:
+# kde@gentoo.org
+# @SUPPORTED_EAPIS: 8
+# @PROVIDES: kde.org
+# @BLURB: Support eclass for KDE Plasma packages.
+# @DESCRIPTION:
+# This eclass extends kde.org.eclass for KDE Plasma release group to assemble
+# default SRC_URI for tarballs, set up git-r3.eclass for stable/master branch
+# versions or restrict access to unreleased (packager access only) tarballs
+# in Gentoo KDE overlay.
+#
+# This eclass unconditionally inherits kde.org.eclass and all its public
+# variables and helper functions (not phase functions) may be considered as
+# part of this eclass's API.
+
+case ${EAPI} in
+ 8) ;;
+ *) die "EAPI=${EAPI:-0} is not supported" ;;
+esac
+
+if [[ -z ${_PLASMA_KDE_ORG_ECLASS} ]]; then
+_PLASMA_KDE_ORG_ECLASS=1
+
+# @ECLASS_VARIABLE: KDE_PV_UNRELEASED
+# @INTERNAL
+# @DESCRIPTION:
+# For proper description see kde.org.eclass manpage.
+KDE_PV_UNRELEASED=( )
+
+inherit kde.org
+
+HOMEPAGE="https://kde.org/plasma-desktop"
+
+# @ECLASS_VARIABLE: KDE_ORG_SCHEDULE_URI
+# @INTERNAL
+# @DESCRIPTION:
+# For proper description see kde.org.eclass manpage.
+KDE_ORG_SCHEDULE_URI+="/Plasma_5"
+
+# @ECLASS_VARIABLE: _KDE_SRC_URI
+# @INTERNAL
+# @DESCRIPTION:
+# Helper variable to construct release group specific SRC_URI.
+_KDE_SRC_URI="mirror://kde/"
+
+if [[ ${KDE_BUILD_TYPE} == live ]]; then
+ if [[ ${PV} != 9999 ]]; then
+ EGIT_BRANCH="Plasma/$(ver_cut 1-2)"
+ fi
+elif [[ -z ${KDE_ORG_COMMIT} ]]; then
+ case ${PV} in
+ 5.??.[6-9]?* )
+ _KDE_SRC_URI+="unstable/plasma/$(ver_cut 1-3)/"
+ RESTRICT+=" mirror"
+ ;;
+ *) _KDE_SRC_URI+="stable/plasma/$(ver_cut 1-3)/" ;;
+ esac
+
+ SRC_URI="${_KDE_SRC_URI}${KDE_ORG_NAME}-${PV}.tar.xz"
+fi
+
+fi
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 3471e17bdde..2fd5c70120e 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -49,6 +49,7 @@ elif [[ ${_PYTHON_ANY_R1} ]]; then
die 'python-r1.eclass can not be used with python-any-r1.eclass.'
fi
+[[ ${EAPI} == 6 ]] && inherit eqawarn
inherit multibuild python-utils-r1
fi
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index b9cf9c03cae..89013591c31 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -35,6 +35,7 @@ fi
if [[ ! ${_PYTHON_UTILS_R1} ]]; then
[[ ${EAPI} == [67] ]] && inherit eapi8-dosym
+[[ ${EAPI} == 6 ]] && inherit eqawarn
inherit multiprocessing toolchain-funcs
# @ECLASS_VARIABLE: _PYTHON_ALL_IMPLS
@@ -454,21 +455,21 @@ _python_export() {
local d
case ${impl} in
python2.7)
- PYTHON_PKG_DEP='>=dev-lang/python-2.7.5-r2:2.7';;
+ PYTHON_PKG_DEP='>=dev-lang/python-2.7.10_p15: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.13:3.8";;
python3.9)
- PYTHON_PKG_DEP=">=dev-lang/python-3.9.9-r1:3.9";;
+ PYTHON_PKG_DEP=">=dev-lang/python-3.9.12:3.9";;
python3.10)
- PYTHON_PKG_DEP=">=dev-lang/python-3.10.0_p1-r1:3.10";;
+ PYTHON_PKG_DEP=">=dev-lang/python-3.10.4:3.10";;
python3.11)
- PYTHON_PKG_DEP=">=dev-lang/python-3.11.0_beta1-r1:3.11";;
+ PYTHON_PKG_DEP=">=dev-lang/python-3.11.0_beta4:3.11";;
python*)
PYTHON_PKG_DEP="dev-lang/python:${impl#python}";;
pypy)
- PYTHON_PKG_DEP='>=dev-python/pypy-7.3.0:0=';;
+ PYTHON_PKG_DEP='>=dev-python/pypy-7.3.9:0=';;
pypy3)
- PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.7-r1:0=';;
+ PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.9_p1:0=';;
*)
die "Invalid implementation: ${impl}"
esac
@@ -1330,6 +1331,9 @@ epytest() {
# sterilize pytest-markdown as it runs code snippets from all
# *.md files found without any warning
-p no:markdown
+ # pytest-sugar undoes everything that's good about pytest output
+ # and makes it hard to read logs
+ -p no:sugar
)
local x
for x in "${EPYTEST_DESELECT[@]}"; do
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 86082a07f4b..c6cb5dd3682 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -107,11 +107,15 @@ if [[ ${PN} != qtwebengine ]]; then
*9999 )
inherit kde.org # kde/5.15 branch
;;
- 5.15.[3-9]* | 5.15.??* )
+ 5.15.[5-9]* | 5.15.??* )
# official stable release
_QT5_P=${QT5_MODULE}-everywhere-opensource-src-${PV}
HOMEPAGE="https://www.qt.io/"
SRC_URI="https://download.qt.io/official_releases/qt/${PV%.*}/${PV}/submodules/${_QT5_P}.tar.xz"
+ if [[ ${QT5_MODULE} == qtbase ]]; then
+ _QT5_GENTOOPATCHSET_REV=1
+ SRC_URI+=" https://dev.gentoo.org/~asturm/distfiles/qtbase-5.15-gentoo-patchset-${_QT5_GENTOOPATCHSET_REV}.tar.xz"
+ fi
# KDE Qt5PatchCollection on top of tag v${PV}-lts-lgpl
if [[ -n ${QT5_KDEPATCHSET_REV} ]]; then
HOMEPAGE+=" https://invent.kde.org/qt/qt/${QT5_MODULE} https://community.kde.org/Qt5PatchCollection"
@@ -122,11 +126,6 @@ if [[ ${PN} != qtwebengine ]]; then
esac
fi
-if [[ ${QT5_MODULE} == qtbase ]] && [[ ${PV} == 5.15.[5-9]* ]]; then
- _QT5_GENTOOPATCHSET_REV=1
- SRC_URI+=" https://dev.gentoo.org/~asturm/distfiles/qtbase-5.15-gentoo-patchset-${_QT5_GENTOOPATCHSET_REV}.tar.xz"
-fi
-
# @ECLASS_VARIABLE: QT5_BUILD_DIR
# @OUTPUT_VARIABLE
# @DESCRIPTION:
@@ -187,7 +186,7 @@ qt5-build_src_prepare() {
-e '/echo "Done."/a fi' configure || die "sed failed (skip qmake bootstrap)"
# Respect CC, CXX, *FLAGS, MAKEOPTS and EXTRA_EMAKE when bootstrapping qmake
- sed -i -e "/outpath\/qmake\".*\"\$MAKE\")/ s|)| \
+ sed -i -e "/outpath\/qmake\".*\"*\$MAKE\"*)/ s|)| \
${MAKEOPTS} ${EXTRA_EMAKE} 'CC=$(tc-getCC)' 'CXX=$(tc-getCXX)' \
'QMAKE_CFLAGS=${CFLAGS}' 'QMAKE_CXXFLAGS=${CXXFLAGS}' 'QMAKE_LFLAGS=${LDFLAGS}'&|" \
-e 's/\(setBootstrapVariable\s\+\|EXTRA_C\(XX\)\?FLAGS=.*\)QMAKE_C\(XX\)\?FLAGS_\(DEBUG\|RELEASE\).*/:/' \
diff --git a/eclass/qt6-build.eclass b/eclass/qt6-build.eclass
new file mode 100644
index 00000000000..c8313e255a0
--- /dev/null
+++ b/eclass/qt6-build.eclass
@@ -0,0 +1,161 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: qt6-build.eclass
+# @MAINTAINER:
+# qt@gentoo.org
+# @SUPPORTED_EAPIS: 8
+# @BLURB: Eclass for Qt6 split ebuilds.
+# @DESCRIPTION:
+# This eclass contains various functions that are used when building Qt6.
+# Requires EAPI 8.
+
+if [[ ${CATEGORY} != dev-qt ]]; then
+ die "qt6-build.eclass is only to be used for building Qt 6"
+fi
+
+case ${EAPI} in
+ 8) : ;;
+ *) die "qt6-build.eclass: unsupported EAPI=${EAPI:-0}" ;;
+esac
+
+# @ECLASS_VARIABLE: QT6_MODULE
+# @PRE_INHERIT
+# @DESCRIPTION:
+# The upstream name of the module this package belongs to. Used for
+# SRC_URI and EGIT_REPO_URI. Must be set before inheriting the eclass.
+: ${QT6_MODULE:=${PN}}
+
+# @ECLASS_VARIABLE: VIRTUALX_REQUIRED
+# @DESCRIPTION:
+# For proper description see virtualx.eclass man page.
+# Here we redefine default value to be manual, if your package needs virtualx
+# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
+: ${VIRTUALX_REQUIRED:=manual}
+
+inherit cmake virtualx
+
+HOMEPAGE="https://www.qt.io/"
+LICENSE="|| ( GPL-2 GPL-3 LGPL-3 ) FDL-1.3"
+SLOT=6/$(ver_cut 1-2)
+
+QT6_MINOR_VERSION=$(ver_cut 2)
+readonly QT6_MINOR_VERSION
+
+case ${PV} in
+ 6.9999)
+ # git dev branch
+ QT6_BUILD_TYPE="live"
+ EGIT_BRANCH="dev"
+ ;;
+ 6.?.9999|6.??.9999)
+ # git stable branch
+ QT6_BUILD_TYPE="live"
+ EGIT_BRANCH=${PV%.9999}
+ ;;
+ *_alpha*|*_beta*|*_rc*)
+ # development release
+ QT6_BUILD_TYPE="release"
+ MY_P=${QT6_MODULE}-everywhere-src-${PV/_/-}
+ SRC_URI="https://download.qt.io/development_releases/qt/${PV%.*}/${PV/_/-}/submodules/${MY_P}.tar.xz"
+ S=${WORKDIR}/${MY_P}
+ ;;
+ *)
+ # official stable release
+ QT6_BUILD_TYPE="release"
+ MY_P=${QT6_MODULE}-everywhere-src-${PV}
+ SRC_URI="https://download.qt.io/official_releases/qt/${PV%.*}/${PV}/submodules/${MY_P}.tar.xz"
+ S=${WORKDIR}/${MY_P}
+ ;;
+esac
+readonly QT6_BUILD_TYPE
+
+EGIT_REPO_URI=(
+ "https://code.qt.io/qt/${QT6_MODULE}.git"
+ "https://github.com/qt/${QT6_MODULE}.git"
+)
+[[ ${QT6_BUILD_TYPE} == live ]] && inherit git-r3
+
+# @ECLASS_VARIABLE: QT6_BUILD_DIR
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# Build directory for out-of-source builds.
+: ${QT6_BUILD_DIR:=${S}_build}
+
+IUSE="debug test"
+
+if [[ ${QT6_BUILD_TYPE} == release ]]; then
+ RESTRICT="test" # bug 457182
+else
+ RESTRICT="!test? ( test )"
+fi
+
+BDEPEND="
+ dev-lang/perl
+ virtual/pkgconfig
+"
+# TODO: Tests have not been split from qtbase.
+#if [[ ${PN} != qttest ]]; then
+# DEPEND+=" test? ( ~dev-qt/qttest-${PV} )"
+#fi
+
+EXPORT_FUNCTIONS src_prepare src_configure
+
+###### Phase functions ######
+
+# @FUNCTION: qt6-build_src_prepare
+# @DESCRIPTION:
+# Prepares the environment and patches the sources if necessary.
+qt6-build_src_prepare() {
+ qt6_prepare_env
+
+ cmake_src_prepare
+}
+
+# @FUNCTION: qt6-build_src_configure
+# @DESCRIPTION:
+# Configures sources.
+qt6-build_src_configure() {
+ cmake_src_configure
+}
+
+###### Public helpers ######
+
+# @FUNCTION: qt_feature
+# @USAGE: <flag> [feature]
+# @DESCRIPTION:
+# <flag> is the name of a flag in IUSE.
+qt_feature() {
+ [[ $# -ge 1 ]] || die "${FUNCNAME}() requires at least one argument"
+ echo "-DQT_FEATURE_${2:-$1}=$(usex $1 ON OFF)"
+}
+
+###### Internal functions ######
+
+# @FUNCTION: qt6_prepare_env
+# @INTERNAL
+# @DESCRIPTION:
+# Prepares the environment for building Qt.
+qt6_prepare_env() {
+ # setup installation directories
+ # note: keep paths in sync with qmake-utils.eclass
+ QT6_PREFIX=${EPREFIX}/usr
+ QT6_HEADERDIR=${QT6_PREFIX}/include/qt6
+ QT6_LIBDIR=${QT6_PREFIX}/$(get_libdir)
+ QT6_ARCHDATADIR=${QT6_PREFIX}/$(get_libdir)/qt6
+ QT6_BINDIR=${QT6_ARCHDATADIR}/bin
+ QT6_PLUGINDIR=${QT6_ARCHDATADIR}/plugins
+ QT6_LIBEXECDIR=${QT6_ARCHDATADIR}/libexec
+ QT6_IMPORTDIR=${QT6_ARCHDATADIR}/imports
+ QT6_QMLDIR=${QT6_ARCHDATADIR}/qml
+ QT6_DATADIR=${QT6_PREFIX}/share/qt6
+ QT6_DOCDIR=${QT6_PREFIX}/share/qt6-doc
+ QT6_TRANSLATIONDIR=${QT6_DATADIR}/translations
+ QT6_EXAMPLESDIR=${QT6_DATADIR}/examples
+ QT6_TESTSDIR=${QT6_DATADIR}/tests
+ QT6_SYSCONFDIR=${EPREFIX}/etc/xdg
+ readonly QT6_PREFIX QT6_HEADERDIR QT6_LIBDIR QT6_ARCHDATADIR \
+ QT6_BINDIR QT6_PLUGINDIR QT6_LIBEXECDIR QT6_IMPORTDIR \
+ QT6_QMLDIR QT6_DATADIR QT6_DOCDIR QT6_TRANSLATIONDIR \
+ QT6_EXAMPLESDIR QT6_TESTSDIR QT6_SYSCONFDIR
+}
diff --git a/eclass/ros-catkin.eclass b/eclass/ros-catkin.eclass
index feded640abf..24e9857f3fc 100644
--- a/eclass/ros-catkin.eclass
+++ b/eclass/ros-catkin.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: ros-catkin.eclass
@@ -13,9 +13,9 @@
# Provides function for building ROS packages on Gentoo.
# It supports selectively building messages, single-python installation, live ebuilds (git only).
-case "${EAPI:-0}" in
+case ${EAPI} in
7) ;;
- *) die "EAPI='${EAPI}' is not supported" ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @ECLASS_VARIABLE: ROS_REPO_URI
@@ -36,17 +36,14 @@ EGIT_REPO_URI="${ROS_REPO_URI}"
# @DESCRIPTION:
# Set to enable in-source build.
-SCM=""
-if [ "${PV#9999}" != "${PV}" ] ; then
- SCM="git-r3"
-fi
+[[ ${PV} == *9999 ]] && inherit git-r3
# ROS only really works with one global python version and the target
# version depends on the release. Noetic targets 3.7 and 3.8.
# py3.9 or later are ok to add there as long as dev-ros/* have their deps satisfied.
PYTHON_COMPAT=( python3_{8..10} )
-inherit ${SCM} python-single-r1 cmake flag-o-matic
+inherit python-single-r1 cmake flag-o-matic
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
@@ -54,8 +51,8 @@ IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="${PYTHON_DEPS}"
DEPEND="${RDEPEND}
- $(python_gen_cond_dep "dev-util/catkin[\${PYTHON_USEDEP}]")
- $(python_gen_cond_dep "dev-python/empy[\${PYTHON_USEDEP}]")
+ $(python_gen_cond_dep 'dev-util/catkin[${PYTHON_USEDEP}]')
+ $(python_gen_cond_dep 'dev-python/empy[${PYTHON_USEDEP}]')
"
# @ECLASS_VARIABLE: CATKIN_HAS_MESSAGES
@@ -70,7 +67,7 @@ DEPEND="${RDEPEND}
# Some messages have dependencies on other messages.
# In that case, CATKIN_MESSAGES_TRANSITIVE_DEPS should contain a space-separated list of atoms
# representing those dependencies. The eclass uses it to ensure proper dependencies on these packages.
-if [ -n "${CATKIN_HAS_MESSAGES}" ] ; then
+if [[ -n ${CATKIN_HAS_MESSAGES} ]] ; then
IUSE="${IUSE} +ros_messages_python +ros_messages_cxx ros_messages_eus ros_messages_lisp ros_messages_nodejs"
RDEPEND="${RDEPEND}
ros_messages_cxx? ( dev-ros/gencpp:=[${PYTHON_SINGLE_USEDEP}] )
@@ -84,12 +81,13 @@ if [ -n "${CATKIN_HAS_MESSAGES}" ] ; then
dev-ros/message_generation
dev-ros/genmsg[${PYTHON_SINGLE_USEDEP}]
"
- if [ -n "${CATKIN_MESSAGES_TRANSITIVE_DEPS}" ] ; then
+ if [[ -n ${CATKIN_MESSAGES_TRANSITIVE_DEPS} ]] ; then
for i in ${CATKIN_MESSAGES_TRANSITIVE_DEPS} ; do
ds="${i}[ros_messages_python(-)?,ros_messages_cxx(-)?,ros_messages_lisp(-)?,ros_messages_eus(-)?,ros_messages_nodejs(-)?] ros_messages_python? ( ${i}[${PYTHON_SINGLE_USEDEP}] )"
RDEPEND="${RDEPEND} ${ds}"
DEPEND="${DEPEND} ${ds}"
done
+ unset i
fi
fi
@@ -118,9 +116,9 @@ CATKIN_MESSAGES_EUS_USEDEP="ros_messages_eus(-)"
# Use it as cat/pkg[${CATKIN_MESSAGES_NODEJS_USEDEP}] to indicate a dependency on the nodejs messages of cat/pkg.
CATKIN_MESSAGES_NODEJS_USEDEP="ros_messages_nodejs(-)"
-if [ "${PV#9999}" != "${PV}" ] ; then
- SRC_URI=""
- KEYWORDS=""
+if [[ ${PV} == *9999 ]] ; then
+ unset SRC_URI
+ unset KEYWORDS
S=${WORKDIR}/${P}/${ROS_SUBDIR}
else
SRC_URI="${ROS_REPO_URI}/archive/${VER_PREFIX}${PV%_*}${VER_SUFFIX}.tar.gz -> ${ROS_REPO_URI##*/}-${PV}.tar.gz"
@@ -135,11 +133,11 @@ HOMEPAGE="https://wiki.ros.org/${PN} ${ROS_REPO_URI}"
# by installing a recursive CMakeLists.txt to handle bundles.
ros-catkin_src_prepare() {
# If no multibuild, just use cmake IN_SOURCE support
- [ -n "${CATKIN_IN_SOURCE_BUILD}" ] && export CMAKE_IN_SOURCE_BUILD=yes
+ [[ -n ${CATKIN_IN_SOURCE_BUILD} ]] && export CMAKE_IN_SOURCE_BUILD=yes
cmake_src_prepare
- if [ ! -f "${S}/CMakeLists.txt" ] ; then
+ if [[ ! -f ${S}/CMakeLists.txt ]] ; then
catkin_init_workspace || die
fi
@@ -162,7 +160,7 @@ ros-catkin_src_configure() {
export ROS_ROOT="${EPREFIX}/usr/share/ros"
export ROS_PYTHON_VERSION="${EPYTHON#python}"
- if [ -n "${CATKIN_HAS_MESSAGES}" ] ; then
+ if [[ -n ${CATKIN_HAS_MESSAGES} ]] ; then
ROS_LANG_DISABLE=""
use ros_messages_cxx || ROS_LANG_DISABLE="${ROS_LANG_DISABLE}:gencpp"
use ros_messages_eus || ROS_LANG_DISABLE="${ROS_LANG_DISABLE}:geneus"
@@ -184,7 +182,7 @@ ros-catkin_src_configure() {
-DPYTHON_EXECUTABLE="${PYTHON}"
-DPYTHON_INSTALL_DIR="${sitedir#${EPREFIX}/usr/}"
)
- if [ -n "${CATKIN_IN_SOURCE_BUILD}" ] ; then
+ if [[ -n ${CATKIN_IN_SOURCE_BUILD} ]] ; then
export CMAKE_USE_DIR="${BUILD_DIR}"
fi
@@ -205,7 +203,7 @@ ros-catkin_src_test() {
cd "${BUILD_DIR}" || die
# Regenerate env for tests, PYTHONPATH is not set properly otherwise...
- if [ -f catkin_generated/generate_cached_setup.py ] ; then
+ if [[ -f catkin_generated/generate_cached_setup.py ]] ; then
einfo "Regenerating setup_cached.sh for tests"
${PYTHON:-python} catkin_generated/generate_cached_setup.py || die
fi
@@ -218,7 +216,7 @@ ros-catkin_src_test() {
# @DESCRIPTION:
# Installs a catkin-based package.
ros-catkin_src_install() {
- if [ -n "${CATKIN_IN_SOURCE_BUILD}" ] ; then
+ if [[ -n ${CATKIN_IN_SOURCE_BUILD} ]] ; then
export CMAKE_USE_DIR="${BUILD_DIR}"
fi
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index f0d6c4f6f6c..06548392a50 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -8,7 +8,7 @@
# Author: Diego E. Pettenò <flameeyes@gentoo.org>
# Author: Alex Legler <a3li@gentoo.org>
# Author: Hans de Graaff <graaff@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: An eclass for installing Ruby packages with proper support for multiple Ruby slots.
# @DESCRIPTION:
# The Ruby eclass is designed to allow an easier installation of Ruby packages
@@ -67,11 +67,8 @@
# passed to "grep -E" to remove reporting of these shared objects.
case ${EAPI} in
- 5)
- inherit eutils toolchain-funcs
- ;;
6)
- inherit estack toolchain-funcs
+ inherit eqawarn estack toolchain-funcs
;;
*)
inherit estack
@@ -86,7 +83,7 @@ EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_i
S="${WORKDIR}"
case ${EAPI} in
- 5|6|7|8) ;;
+ 6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -214,7 +211,7 @@ ruby_add_rdepend() {
1) ;;
2)
case ${EAPI} in
- 5|6)
+ 6)
[[ "${GENTOO_DEV}" == "yes" ]] && eqawarn "You can now use the usual syntax in ruby_add_rdepend for $CATEGORY/$PF"
ruby_add_rdepend "$(_ruby_wrap_conditions "$1" "$2")"
return
@@ -236,7 +233,7 @@ ruby_add_rdepend() {
# Add the dependency as a test-dependency since we're going to
# execute the code during test phase.
case ${EAPI} in
- 5|6) DEPEND="${DEPEND} test? ( ${dependency} )" ;;
+ 6) DEPEND="${DEPEND} test? ( ${dependency} )" ;;
*) BDEPEND="${BDEPEND} test? ( ${dependency} )" ;;
esac
if ! has test "$IUSE"; then
@@ -261,7 +258,7 @@ ruby_add_bdepend() {
1) ;;
2)
case ${EAPI} in
- 5|6)
+ 6)
[[ "${GENTOO_DEV}" == "yes" ]] && eqawarn "You can now use the usual syntax in ruby_add_bdepend for $CATEGORY/$PF"
ruby_add_bdepend "$(_ruby_wrap_conditions "$1" "$2")"
return
@@ -279,7 +276,7 @@ ruby_add_bdepend() {
local dependency=$(_ruby_atoms_samelib "$1")
case ${EAPI} in
- 5|6) DEPEND="${DEPEND} $dependency" ;;
+ 6) DEPEND="${DEPEND} $dependency" ;;
*) BDEPEND="${BDEPEND} $dependency" ;;
esac
RDEPEND="${RDEPEND}"
@@ -294,7 +291,7 @@ ruby_add_depend() {
debug-print-function ${FUNCNAME} "${@}"
case ${EAPI} in
- 5|6) die "only available in EAPI 7 and newer" ;;
+ 6) die "only available in EAPI 7 and newer" ;;
*) ;;
esac
@@ -368,7 +365,7 @@ if [[ ${RUBY_OPTIONAL} != yes ]]; then
RDEPEND="${RDEPEND} $(ruby_implementations_depend)"
REQUIRED_USE+=" || ( $(ruby_get_use_targets) )"
case ${EAPI} in
- 5|6) ;;
+ 6) ;;
*) BDEPEND="${BDEPEND} $(ruby_implementations_depend)" ;;
esac
fi
@@ -410,9 +407,8 @@ _ruby_invoke_environment() {
pushd "${WORKDIR}" &>/dev/null || die
fi
- ebegin "Running ${_PHASE:-${EBUILD_PHASE}} phase for $environment"
+ einfo "Running ${_PHASE:-${EBUILD_PHASE}} phase for $environment"
"$@"
- eend $?
popd &>/dev/null || die
S=${old_S}
@@ -477,17 +473,6 @@ ruby-ng_src_unpack() {
_ruby_apply_patches() {
case ${EAPI} in
- 5)
- for patch in "${RUBY_PATCHES[@]}"; do
- if [ -f "${patch}" ]; then
- epatch "${patch}"
- elif [ -f "${FILESDIR}/${patch}" ]; then
- epatch "${FILESDIR}/${patch}"
- else
- die "Cannot find patch ${patch}"
- fi
- done
- ;;
6)
if [[ -n ${RUBY_PATCHES[@]} ]]; then
eqawarn "RUBY_PATCHES is no longer supported, use PATCHES instead"
@@ -526,13 +511,7 @@ ruby-ng_src_prepare() {
find . -name '._*' -delete
# Handle PATCHES and user supplied patches via the default phase
- case ${EAPI} in
- 5)
- ;;
- *)
- _ruby_invoke_environment all default
- ;;
- esac
+ _ruby_invoke_environment all default
_ruby_invoke_environment all _ruby_apply_patches
diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass
index fb033d64201..80ec269eaf8 100644
--- a/eclass/ruby-utils.eclass
+++ b/eclass/ruby-utils.eclass
@@ -33,10 +33,10 @@ if [[ ! ${_RUBY_UTILS} ]]; then
# provide for a better first installation experience.
# All stable RUBY_TARGETS
-RUBY_TARGETS_PREFERENCE="ruby26 "
+RUBY_TARGETS_PREFERENCE="ruby27 "
# All other active ruby targets
-RUBY_TARGETS_PREFERENCE+="ruby27 ruby30 ruby31"
+RUBY_TARGETS_PREFERENCE+="ruby30 ruby31"
_ruby_implementation_depend() {
diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
index 81d982f749c..7b6f9aac6eb 100644
--- a/eclass/selinux-policy-2.eclass
+++ b/eclass/selinux-policy-2.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 for installing SELinux policy, and optionally
@@ -159,7 +159,7 @@ selinux-policy-2_src_prepare() {
if [[ -n ${BASEPOL} ]] && [[ "${BASEPOL}" != "9999" ]]; then
cd "${S}"
einfo "Applying SELinux policy updates ... "
- eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch"
+ eapply -p0 -- "${WORKDIR}/0001-full-patch-against-stable-release.patch"
fi
# Call in eapply_user. We do this early on as we start moving
@@ -180,9 +180,9 @@ selinux-policy-2_src_prepare() {
# Apply the additional patches refered to by the module ebuild.
# But first some magic to differentiate between bash arrays and strings
if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" == "declare -a"* ]]; then
- [[ -n ${POLICY_PATCH[*]} ]] && eapply -d "${S}/refpolicy/policy/modules" "${POLICY_PATCH[@]}"
+ [[ -n ${POLICY_PATCH[*]} ]] && eapply -d "${S}/refpolicy/policy/modules" -- "${POLICY_PATCH[@]}"
else
- [[ -n ${POLICY_PATCH} ]] && eapply -d "${S}/refpolicy/policy/modules" ${POLICY_PATCH}
+ [[ -n ${POLICY_PATCH} ]] && eapply -d "${S}/refpolicy/policy/modules" -- ${POLICY_PATCH}
fi
# Collect only those files needed for this particular module
@@ -368,4 +368,3 @@ selinux-policy-2_pkg_postrm() {
done
fi
}
-
diff --git a/eclass/stardict.eclass b/eclass/stardict.eclass
index 74a93b3f7c5..1ca6d10d6d7 100644
--- a/eclass/stardict.eclass
+++ b/eclass/stardict.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: stardict.eclass
@@ -6,7 +6,7 @@
# No maintainer <maintainer-needed@gentoo.org>
# @AUTHOR:
# Alastair Tse <liquidx@gentoo.org>
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 8
# @BLURB: Convenience class to do stardict dictionary installations.
# @DESCRIPTION:
# Usage:
@@ -14,42 +14,51 @@
# * FROM_LANG - From this language
# * TO_LANG - To this language
# * DICT_PREFIX - SRC_URI prefix, like "dictd_www.mova.org_"
-# * DICT_SUFFIX - SRC_URI after the prefix.
+# * DICT_SUFFIX - SRC_URI after the prefix.
-case ${EAPI:-0} in
- [67]) ;;
+case ${EAPI} in
+ 8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-EXPORT_FUNCTIONS src_compile src_install
-
if [[ -z ${_STARDICT_ECLASS} ]] ; then
_STARDICT_ECLASS=1
+inherit edo
+
RESTRICT="strip"
-[ -z "${DICT_SUFFIX}" ] && DICT_SUFFIX=${PN#stardict-[[:lower:]]*-}
-[ -z "${DICT_P}" ] && DICT_P=stardict-${DICT_PREFIX}${DICT_SUFFIX}-${PV}
+# @ECLASS_VARIABLE: DICT_SUFFIX
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Suffix used for dictionaries.
+: ${DICT_SUFFIX:=${PN#stardict-[[:lower:]]*-}}
+
+# @ECLASS_VARIABLE: DICT_P
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The filestem used for downloading dictionaries from SourceForge.
+: ${DICT_P:=stardict-${DICT_PREFIX}${DICT_SUFFIX}-${PV}}
-if [ -n "${FROM_LANG}" -a -n "${TO_LANG}" ]; then
+: ${DESCRIPTION:="Another Stardict Dictionary"}
+if [[ -n ${FROM_LANG} && -n ${TO_LANG} ]]; then
DESCRIPTION="Stardict Dictionary ${FROM_LANG} to ${TO_LANG}"
-elif [ -z "${DESCRIPTION}" ]; then
- DESCRIPTION="Another Stardict Dictionary"
fi
HOMEPAGE="http://stardict.sourceforge.net/"
SRC_URI="mirror://sourceforge/stardict/${DICT_P}.tar.bz2"
-S="${WORKDIR}"/${DICT_P}
+S="${WORKDIR}/${DICT_P}"
LICENSE="GPL-2"
SLOT="0"
IUSE="+zlib"
-DEPEND="
+BDEPEND="
|| (
>=app-text/stardict-2.4.2
app-text/sdcv
- app-text/goldendict
)
zlib? (
app-arch/gzip
@@ -57,12 +66,13 @@ DEPEND="
)"
stardict_src_compile() {
+ local file
if use zlib; then
for file in *.idx; do
- [[ -f $file ]] && gzip ${file}
+ [[ -f ${file} ]] && edo gzip "${file}"
done
for file in *.dict; do
- [[ -f $file ]] && dictzip ${file}
+ [[ -f ${file} ]] && edo dictzip "${file}"
done
fi
}
@@ -75,3 +85,5 @@ stardict_src_install() {
}
fi
+
+EXPORT_FUNCTIONS src_compile src_install
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 54d4b0912a6..48bf11606c4 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -4,7 +4,7 @@
# @ECLASS: toolchain-funcs.eclass
# @MAINTAINER:
# Toolchain Ninjas <toolchain@gentoo.org>
-# @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
@@ -453,6 +452,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
@@ -483,6 +485,9 @@ tc-ld-is-gold() {
tc-ld-is-lld() {
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} == *"LLD"* ]] ; then
@@ -595,8 +600,8 @@ _tc-has-openmp() {
}
# @FUNCTION: tc-has-openmp
-# @DEPRECATED: tc-check-openmp
# @USAGE: [toolchain prefix]
+# @DEPRECATED: tc-check-openmp
# @DESCRIPTION:
# See if the toolchain supports OpenMP. This function is deprecated and will be
# removed on 2023-01-01.
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index c83678f41d2..fe1e209fb2d 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -371,11 +371,14 @@ if [[ ${TOOLCHAIN_SET_S} == yes ]] ; then
fi
gentoo_urls() {
+ # the list is sorted by likelihood of getting the patches tarball from
+ # respective devspace
# slyfox's distfiles are mirrored to sam's devspace
declare -A devspace_urls=(
[soap]=HTTP~soap/distfiles/URI
[sam]=HTTP~sam/distfiles/sys-devel/gcc/URI
[slyfox]=HTTP~sam/distfiles/URI
+ [xen0n]=HTTP~xen0n/distfiles/sys-devel/gcc/URI
[tamiko]=HTTP~tamiko/distfiles/URI
[zorry]=HTTP~zorry/patches/gcc/URI
[vapier]=HTTP~vapier/dist/URI
@@ -877,6 +880,12 @@ toolchain_src_configure() {
downgrade_arch_flags
gcc_do_filter_flags
+ if tc_version_is_between 10 11 && [[ $(gcc-major-version) -ge 12 ]] ; then
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105695
+ # bug #849359
+ export ac_cv_std_swap_in_utility=no
+ fi
+
einfo "CFLAGS=\"${CFLAGS}\""
einfo "CXXFLAGS=\"${CXXFLAGS}\""
einfo "LDFLAGS=\"${LDFLAGS}\""
@@ -1876,12 +1885,39 @@ toolchain_src_test() {
# 'asan' wants to be preloaded first, so does 'sandbox'.
# To make asan tests work disable sandbox for all of test suite.
# 'backtrace' tests also does not like 'libsandbox.so' presence.
- SANDBOX_ON=0 LD_PRELOAD= emake -k check
+ #
+ # Nonfatal here as we die if compare_tests failed
+ SANDBOX_ON=0 LD_PRELOAD= nonfatal emake -k check
+ local success_tests=$?
+
+ if [[ ! -d "${BROOT}"/var/cache/gcc/${SLOT} ]] && ! [[ ${success_tests} -eq 0 ]] ; then
+ # We have no reference data saved from a previous run to know if
+ # the failures are tolerable or not, so we bail out.
+ eerror "Reference test data does NOT exist at ${BROOT}/var/cache/gcc/${SLOT}"
+ eerror "Tests failed and nothing to compare with, so this is a fatal error."
+ eerror "(Set GCC_TESTS_IGNORE_NO_BASELINE=1 to make this non-fatal for initial run.)"
+
+ if [[ -z ${GCC_TESTS_IGNORE_NO_BASELINE} ]] ; then
+ die "Tests failed (failures occurred with no reference data)"
+ fi
+ fi
- einfo "Testing complete."
+ einfo "Testing complete! Review the following output to check for success or failure."
einfo "Please ignore any 'mail' lines in the summary output below (no mail is sent)."
einfo "Summary:"
"${S}"/contrib/test_summary
+
+ # If previous results exist on the system, compare with it
+ # TODO: Distribute some baseline results in e.g. gcc-patches.git?
+ if [[ -d "${BROOT}"/var/cache/gcc/${SLOT} ]] ; then
+ einfo "Comparing with previous cached results at ${BROOT}/var/cache/gcc/${SLOT}"
+
+ # Exit with the following values:
+ # 0 if there is nothing of interest
+ # 1 if there are errors when comparing single test case files
+ # N for the number of errors found when comparing directories
+ "${S}"/contrib/compare_tests "${BROOT}"/var/cache/gcc/${SLOT}/ . || die "Comparison for tests results failed, error code: $?"
+ fi
}
#---->> src_install <<----
@@ -2117,6 +2153,19 @@ toolchain_src_install() {
pax-mark -m "${ED}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/ecj1"
pax-mark -m "${ED}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}/gij"
fi
+
+ if use test ; then
+ # TODO: In future, install orphaned to allow comparison across
+ # more versions even after unmerged? Also would be useful for
+ # historical records and tracking down regressions a while
+ # after they first appeared, but were only just reported.
+ einfo "Copying test results to ${EPREFIX}/var/cache/gcc/${SLOT} for future comparison"
+ (
+ dodir /var/cache/gcc/${SLOT}
+ cd "${WORKDIR}"/build || die
+ find . -name \*.sum -exec cp --parents -v {} "${ED}"/var/cache/gcc/${SLOT} \;
+ )
+ fi
}
# Move around the libs to the right location. For some reason,
diff --git a/eclass/tree-sitter-grammar.eclass b/eclass/tree-sitter-grammar.eclass
index 69ad467f8be..acdb8a7ad73 100644
--- a/eclass/tree-sitter-grammar.eclass
+++ b/eclass/tree-sitter-grammar.eclass
@@ -76,11 +76,17 @@ tree-sitter-grammar_src_compile() {
fi
local soname=lib${PN}$(get_libname $(_get_tsg_abi_ver))
+
+ local soname_args="-Wl,--soname=${soname}"
+ if [[ ${CHOST} == *darwin* ]] ; then
+ soname_args="-Wl,-install_name,${EPREFIX}/usr/$(get_libdir)/${soname}"
+ fi
+
edo ${link} ${LDFLAGS} \
-shared \
*.o \
- -Wl,--soname=${soname} \
- -o "${WORKDIR}"/${soname} || die
+ ${soname_args} \
+ -o "${WORKDIR}"/${soname}
}
# @FUNCTION: tree-sitter-grammar_src_install
diff --git a/eclass/user.eclass b/eclass/user.eclass
index 906e84e83c6..d5b827d2e76 100644
--- a/eclass/user.eclass
+++ b/eclass/user.eclass
@@ -123,13 +123,13 @@ enewuser() {
# handle uid
local euid=${1}; shift
if [[ -n ${euid} && ${euid} != -1 ]] ; then
- if [[ ${euid} -gt 0 ]] ; then
+ if [[ ${euid} -ge 0 ]] ; then
if [[ -n $(egetent passwd ${euid}) ]] ; then
[[ -n ${force_uid} ]] && die "${FUNCNAME}: UID ${euid} already taken"
euid="next"
fi
else
- eerror "Userid given but is not greater than 0!"
+ eerror "Userid given but is not greater than or equal to 0!"
die "${euid} is not a valid UID"
fi
else
@@ -289,13 +289,13 @@ enewgroup() {
# handle gid
local egid=${1}; shift
if [[ -n ${egid} && ${egid} != -1 ]] ; then
- if [[ ${egid} -gt 0 ]] ; then
+ if [[ ${egid} -ge 0 ]] ; then
if [[ -n $(egetent group ${egid}) ]] ; then
[[ -n ${force_gid} ]] && die "${FUNCNAME}: GID ${egid} already taken"
egid="next available; requested gid taken"
fi
else
- eerror "Groupid given but is not greater than 0!"
+ eerror "Groupid given but is not greater than or equal to 0!"
die "${egid} is not a valid GID"
fi
else
diff --git a/eclass/vala.eclass b/eclass/vala.eclass
index 076ef906606..4e668d939fa 100644
--- a/eclass/vala.eclass
+++ b/eclass/vala.eclass
@@ -49,11 +49,10 @@ vala_api_versions() {
local minimal_supported_minor_version minor_version
# Dependency atoms are not generated for Vala versions older than 0.${minimal_supported_minor_version}.
- minimal_supported_minor_version="46"
+ minimal_supported_minor_version="50"
for ((minor_version = ${VALA_MAX_API_VERSION#*.}; minor_version >= ${VALA_MIN_API_VERSION#*.}; minor_version = minor_version - 2)); do
- # 0.42 is EOL and removed from tree; remove special case once minimal_support_minor_version >= 44
- if ((minor_version >= minimal_supported_minor_version)) && ((minor_version != 42)); then
+ if ((minor_version >= minimal_supported_minor_version)); then
echo "0.${minor_version}"
fi
done
diff --git a/eclass/vcs-snapshot.eclass b/eclass/vcs-snapshot.eclass
index 64bc1da040f..1b7299b92a3 100644
--- a/eclass/vcs-snapshot.eclass
+++ b/eclass/vcs-snapshot.eclass
@@ -43,7 +43,8 @@
# in ${WORKDIR}/${P} and ${WORKDIR}/${P}-otherstuff respectively.
case ${EAPI} in
- 6|7|8) ;;
+ 6) inherit eqawarn ;;
+ 7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index b7a25c897b4..e04834d39bd 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -53,7 +53,7 @@ case ${VIRTUALX_REQUIRED} in
*)
BDEPEND="${VIRTUALX_REQUIRED}? ( ${VIRTUALX_DEPEND} )"
IUSE="${VIRTUALX_REQUIRED}"
- [[ ${VIRTUALX_REQUIRED} == test ]] &&
+ [[ ${VIRTUALX_REQUIRED} == "test" ]] &&
RESTRICT+=" !test? ( test )"
;;
esac
@@ -107,68 +107,37 @@ virtx() {
local i=0
local retval=0
- local OLD_SANDBOX_ON="${SANDBOX_ON}"
- local XVFB XHOST XDISPLAY
- local xvfbargs="-screen 0 1280x1024x24 +extension RANDR"
- XVFB=$(type -p Xvfb) || die
- XHOST=$(type -p xhost) || die
+ local xvfbargs=( -screen 0 1280x1024x24 +extension RANDR )
debug-print "${FUNCNAME}: running Xvfb hack"
export XAUTHORITY=
- # The following is derived from Mandrake's hack to allow
- # compiling without the X display
-
- einfo "Scanning for an open DISPLAY to start Xvfb ..."
- # If we are in a chrooted environment, and there is already a
- # X server started outside of the chroot, Xvfb will fail to start
- # on the same display (most cases this is :0 ), so make sure
- # Xvfb is started, else bump the display number
- #
- # Azarah - 5 May 2002
- # GNOME GDM may have started X on DISPLAY :0 with a
- # lock file /tmp/.X1024-lock, therefore start the search at 1.
- # Else a leftover /tmp/.X1-lock will prevent finding an available display.
- XDISPLAY=$(i=1; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i})
- debug-print "${FUNCNAME}: XDISPLAY=${XDISPLAY}"
-
- # We really do not want SANDBOX enabled here
- export SANDBOX_ON="0"
-
- debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs}"
- ${XVFB} :${XDISPLAY} ${xvfbargs} &>/dev/null &
- sleep 2
-
- local start=${XDISPLAY}
- while [[ ! -f /tmp/.X${XDISPLAY}-lock ]]; do
- # Stop trying after 15 tries
- if ((XDISPLAY - start > 15)) ; then
- eerror "'${XVFB} :${XDISPLAY} ${xvfbargs}' returns:"
- echo
- ${XVFB} :${XDISPLAY} ${xvfbargs}
- echo
- eerror "If possible, correct the above error and try your emerge again."
- die "Unable to start Xvfb"
- fi
- ((XDISPLAY++))
- debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs}"
- ${XVFB} :${XDISPLAY} ${xvfbargs} &>/dev/null &
- sleep 2
- done
-
- # Now enable SANDBOX again if needed.
- export SANDBOX_ON="${OLD_SANDBOX_ON}"
-
- einfo "Starting Xvfb on \$DISPLAY=${XDISPLAY} ..."
-
- export DISPLAY=:${XDISPLAY}
- # Do not break on error, but setup $retval, as we need
- # to kill Xvfb
+
+ einfo "Starting Xvfb ..."
+
+ debug-print "${FUNCNAME}: Xvfb -displayfd 1 ${xvfbargs[*]}"
+ local logfile=${T}/Xvfb.log
+ local pidfile=${T}/Xvfb.pid
+ # NB: bash command substitution blocks until Xvfb prints fd to stdout
+ # and then closes the fd; only then it backgrounds properly
+ export DISPLAY=:$(
+ Xvfb -displayfd 1 "${xvfbargs[@]}" 2>"${logfile}" &
+ echo "$!" > "${pidfile}"
+ )
+
+ if [[ ${DISPLAY} == : ]]; then
+ eerror "Xvfb failed to start, reprinting error log"
+ cat "${logfile}"
+ die "Xvfb failed to start"
+ fi
+
+ # Do not break on error, but setup $retval, as we need to kill Xvfb
+ einfo "Xvfb started on DISPLAY=${DISPLAY}"
debug-print "${FUNCNAME}: $@"
nonfatal "$@"
retval=$?
# Now kill Xvfb
- kill $(cat /tmp/.X${XDISPLAY}-lock)
+ kill "$(<"${pidfile}")"
# die if our command failed
[[ ${retval} -ne 0 ]] && die "Failed to run '$@'"
diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index d7ff91417ca..e120d23efd4 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -377,7 +377,7 @@ xorg-3_src_configure() {
# Check if package supports disabling of dep tracking
# Fixes warnings like:
# WARNING: unrecognized options: --disable-dependency-tracking
- if grep -q -s "disable-depencency-tracking" ${ECONF_SOURCE:-.}/configure; then
+ if grep -q -s "disable-dependency-tracking" ${ECONF_SOURCE:-.}/configure; then
local dep_track="--disable-dependency-tracking"
fi