summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin36137 -> 35978 bytes
-rw-r--r--eclass/bzr.eclass290
-rw-r--r--eclass/ghc-package.eclass8
-rw-r--r--eclass/gnome-python-common-r1.eclass1
-rw-r--r--eclass/kernel-2.eclass8
-rw-r--r--eclass/kernel-build.eclass17
-rw-r--r--eclass/kernel-install.eclass12
-rw-r--r--eclass/linux-info.eclass6
-rw-r--r--eclass/llvm.eclass39
-rw-r--r--eclass/mozcoreconf-v6.eclass2
-rw-r--r--eclass/multilib.eclass32
-rw-r--r--eclass/postgres.eclass2
-rw-r--r--eclass/python-utils-r1.eclass4
-rw-r--r--eclass/qt5-build.eclass34
-rw-r--r--eclass/ros-catkin.eclass4
-rw-r--r--eclass/subversion.eclass7
-rwxr-xr-xeclass/tests/llvm.sh138
-rwxr-xr-xeclass/tests/python-utils-r1.sh16
-rw-r--r--eclass/toolchain-funcs.eclass13
-rw-r--r--eclass/twisted-r1.eclass238
20 files changed, 300 insertions, 571 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index 9bdd44ac4406..bc66db753e81 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
deleted file mode 100644
index 1c1e7dfa415e..000000000000
--- a/eclass/bzr.eclass
+++ /dev/null
@@ -1,290 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @DEAD
-# @ECLASS: bzr.eclass
-# @MAINTAINER:
-# Ulrich Müller <ulm@gentoo.org>
-# @AUTHOR:
-# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
-# Mark Lee <bzr-gentoo-overlay@lazymalevolence.com>
-# Ulrich Müller <ulm@gentoo.org>
-# Christian Faulhammer <fauli@gentoo.org>
-# @SUPPORTED_EAPIS: 2 3 4 5 6 7
-# @BLURB: generic fetching functions for the Bazaar VCS
-# @DESCRIPTION:
-# The bzr.eclass provides functions to fetch and unpack sources from
-# repositories of the Bazaar distributed version control system.
-# The eclass was originally derived from git.eclass.
-#
-# Note: Just set EBZR_REPO_URI to the URI of the branch and src_unpack()
-# of this eclass will export the branch to ${WORKDIR}/${P}.
-
-EBZR="bzr.eclass"
-
-PROPERTIES+=" live"
-
-if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then
- DEPEND=">=dev-vcs/bzr-2.6.0[sftp]"
-else
- DEPEND=">=dev-vcs/bzr-2.6.0"
-fi
-
-case ${EAPI:-0} in
- 2|3|4|5|6) ;;
- 7) BDEPEND="${DEPEND}"; DEPEND="" ;;
- *) die "${EBZR}: EAPI ${EAPI:-0} is not supported" ;;
-esac
-
-EXPORT_FUNCTIONS src_unpack
-
-# @ECLASS-VARIABLE: EBZR_STORE_DIR
-# @DESCRIPTION:
-# The directory to store all fetched Bazaar live sources.
-: ${EBZR_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/bzr-src}
-
-# @ECLASS-VARIABLE: EBZR_UNPACK_DIR
-# @DESCRIPTION:
-# The working directory where the sources are copied to.
-: ${EBZR_UNPACK_DIR:=${WORKDIR}/${P}}
-
-# @ECLASS-VARIABLE: EBZR_INIT_REPO_CMD
-# @DESCRIPTION:
-# The Bazaar command to initialise a shared repository.
-: ${EBZR_INIT_REPO_CMD:="bzr init-repository --no-trees"}
-
-# @ECLASS-VARIABLE: EBZR_FETCH_CMD
-# @DESCRIPTION:
-# The Bazaar command to fetch the sources.
-: ${EBZR_FETCH_CMD:="bzr branch --no-tree"}
-
-# @ECLASS-VARIABLE: EBZR_UPDATE_CMD
-# @DESCRIPTION:
-# The Bazaar command to update the sources.
-: ${EBZR_UPDATE_CMD:="bzr pull --overwrite-tags"}
-
-# @ECLASS-VARIABLE: EBZR_EXPORT_CMD
-# @DESCRIPTION:
-# The Bazaar command to export a branch.
-: ${EBZR_EXPORT_CMD:="bzr export"}
-
-# @ECLASS-VARIABLE: EBZR_CHECKOUT_CMD
-# @DESCRIPTION:
-# The Bazaar command to checkout a branch.
-: ${EBZR_CHECKOUT_CMD:="bzr checkout --lightweight -q"}
-
-# @ECLASS-VARIABLE: EBZR_REVNO_CMD
-# @DESCRIPTION:
-# The Bazaar command to list a revision number of the branch.
-: ${EBZR_REVNO_CMD:="bzr revno"}
-
-# @ECLASS-VARIABLE: EBZR_OPTIONS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The options passed to the fetch and update commands.
-
-# @ECLASS-VARIABLE: EBZR_REPO_URI
-# @DEFAULT_UNSET
-# @REQUIRED
-# @DESCRIPTION:
-# The repository URI for the source package.
-#
-# Note: If the ebuild uses an sftp:// URI, then the eclass will depend
-# on dev-vcs/bzr[sftp].
-
-# @ECLASS-VARIABLE: EBZR_INITIAL_URI
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The URI used for initial branching of the source repository. If this
-# variable is set, the initial branch will be cloned from the location
-# specified, followed by a pull from ${EBZR_REPO_URI}. This is intended
-# for special cases, e.g. when download from the original repository is
-# slow, but a fast mirror exists but may be out of date.
-#
-# Normally, this variable needs not be set.
-
-# @ECLASS-VARIABLE: EBZR_PROJECT
-# @DESCRIPTION:
-# The project name of your ebuild. Normally, the branch will be stored
-# in the ${EBZR_STORE_DIR}/${EBZR_PROJECT} directory.
-#
-# If EBZR_BRANCH is set (see below), then a shared repository will be
-# created in that directory, and the branch will be located in
-# ${EBZR_STORE_DIR}/${EBZR_PROJECT}/${EBZR_BRANCH}.
-: ${EBZR_PROJECT:=${PN}}
-
-# @ECLASS-VARIABLE: EBZR_BRANCH
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The directory where to store the branch within a shared repository,
-# relative to ${EBZR_STORE_DIR}/${EBZR_PROJECT}.
-#
-# This variable should be set if there are several live ebuilds for
-# different branches of the same upstream project. The branches can
-# then share the same repository in EBZR_PROJECT, which will save both
-# data traffic volume and disk space.
-#
-# If there is only a live ebuild for one single branch, EBZR_BRANCH
-# needs not be set. In this case, the branch will be stored in a
-# stand-alone repository directly in EBZR_PROJECT.
-
-# @ECLASS-VARIABLE: EBZR_REVISION
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Revision to fetch, defaults to the latest
-# (see http://bazaar-vcs.org/BzrRevisionSpec or bzr help revisionspec).
-
-# @ECLASS-VARIABLE: EBZR_OFFLINE
-# @DESCRIPTION:
-# Set this variable to a non-empty value to disable automatic updating
-# of a bzr source tree. This is intended to be set outside the ebuild
-# by users.
-: ${EBZR_OFFLINE=${EVCS_OFFLINE}}
-
-# @ECLASS-VARIABLE: EVCS_UMASK
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Set this variable to a custom umask. This is intended to be set by
-# users. By setting this to something like 002, it can make life easier
-# for people who do development as non-root (but are in the portage
-# group), and then switch over to building with FEATURES=userpriv.
-# Or vice-versa. Shouldn't be a security issue here as anyone who has
-# portage group write access already can screw the system over in more
-# creative ways.
-
-# @ECLASS-VARIABLE: EBZR_WORKDIR_CHECKOUT
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# If this variable is set to a non-empty value, EBZR_CHECKOUT_CMD will
-# be used instead of EBZR_EXPORT_CMD to copy the sources to WORKDIR.
-
-# @FUNCTION: bzr_initial_fetch
-# @USAGE: <repository URI> <branch directory>
-# @DESCRIPTION:
-# Internal function, retrieves the source code from a repository for the
-# first time, using ${EBZR_FETCH_CMD}.
-bzr_initial_fetch() {
- local repo_uri=$1 branch_dir=$2
-
- if [[ -n "${EBZR_OFFLINE}" ]]; then
- ewarn "EBZR_OFFLINE cannot be used when there is no local branch yet."
- fi
-
- # fetch branch
- einfo "bzr branch start -->"
- einfo " repository: ${repo_uri} => ${branch_dir}"
-
- ${EBZR_FETCH_CMD} ${EBZR_OPTIONS} "${repo_uri}" "${branch_dir}" \
- || die "${EBZR}: can't branch from ${repo_uri}"
-}
-
-# @FUNCTION: bzr_update
-# @USAGE: <repository URI> <branch directory>
-# @DESCRIPTION:
-# Internal function, updates the source code from a repository, using
-# ${EBZR_UPDATE_CMD}.
-bzr_update() {
- local repo_uri=$1 branch_dir=$2
-
- if [[ -n "${EBZR_OFFLINE}" ]]; then
- einfo "skipping bzr pull -->"
- einfo " repository: ${repo_uri}"
- else
- # update branch
- einfo "bzr pull start -->"
- einfo " repository: ${repo_uri}"
-
- pushd "${branch_dir}" > /dev/null \
- || die "${EBZR}: can't chdir to ${branch_dir}"
- ${EBZR_UPDATE_CMD} ${EBZR_OPTIONS} "${repo_uri}" \
- || die "${EBZR}: can't pull from ${repo_uri}"
- popd > /dev/null || die "${EBZR}: popd failed"
- fi
-}
-
-# @FUNCTION: bzr_fetch
-# @DESCRIPTION:
-# Wrapper function to fetch sources from a Bazaar repository with
-# bzr branch or bzr pull, depending on whether there is an existing
-# working copy.
-bzr_fetch() {
- local repo_dir branch_dir
- local save_sandbox_write=${SANDBOX_WRITE} save_umask
-
- [[ -n ${EBZR_REPO_URI} ]] || die "${EBZR}: EBZR_REPO_URI is empty"
-
- if [[ ! -d ${EBZR_STORE_DIR} ]] ; then
- addwrite /
- mkdir -p "${EBZR_STORE_DIR}" \
- || die "${EBZR}: can't mkdir ${EBZR_STORE_DIR}"
- SANDBOX_WRITE=${save_sandbox_write}
- fi
-
- pushd "${EBZR_STORE_DIR}" > /dev/null \
- || die "${EBZR}: can't chdir to ${EBZR_STORE_DIR}"
-
- repo_dir=${EBZR_STORE_DIR}/${EBZR_PROJECT}
- branch_dir=${repo_dir}${EBZR_BRANCH:+/${EBZR_BRANCH}}
-
- if [[ -n ${EVCS_UMASK} ]]; then
- save_umask=$(umask)
- umask "${EVCS_UMASK}" || die
- fi
- addwrite "${EBZR_STORE_DIR}"
-
- if [[ ! -d ${branch_dir}/.bzr ]]; then
- if [[ ${repo_dir} != "${branch_dir}" && ! -d ${repo_dir}/.bzr ]]; then
- einfo "creating shared bzr repository: ${repo_dir}"
- ${EBZR_INIT_REPO_CMD} "${repo_dir}" \
- || die "${EBZR}: can't create shared repository"
- fi
-
- if [[ -z ${EBZR_INITIAL_URI} ]]; then
- bzr_initial_fetch "${EBZR_REPO_URI}" "${branch_dir}"
- else
- # Workaround for faster initial download. This clones the
- # branch from a fast server (which may be out of date), and
- # subsequently pulls from the slow original repository.
- bzr_initial_fetch "${EBZR_INITIAL_URI}" "${branch_dir}"
- if [[ ${EBZR_REPO_URI} != "${EBZR_INITIAL_URI}" ]]; then
- EBZR_UPDATE_CMD="${EBZR_UPDATE_CMD} --remember --overwrite" \
- EBZR_OFFLINE="" \
- bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
- fi
- fi
- else
- bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
- fi
-
- # Restore sandbox environment and umask
- SANDBOX_WRITE=${save_sandbox_write}
- if [[ -n ${save_umask} ]]; then
- umask "${save_umask}" || die
- fi
-
- cd "${branch_dir}" || die "${EBZR}: can't chdir to ${branch_dir}"
-
- # Save revision number in environment. #311101
- export EBZR_REVNO=$(${EBZR_REVNO_CMD})
-
- if [[ -n ${EBZR_WORKDIR_CHECKOUT} ]]; then
- einfo "checking out ..."
- ${EBZR_CHECKOUT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
- . "${EBZR_UNPACK_DIR}" || die "${EBZR}: checkout failed"
- else
- einfo "exporting ..."
- ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
- "${EBZR_UNPACK_DIR}" . || die "${EBZR}: export failed"
- fi
- einfo \
- "revision ${EBZR_REVISION:-${EBZR_REVNO}} is now in ${EBZR_UNPACK_DIR}"
-
- popd > /dev/null || die "${EBZR}: popd failed"
-}
-
-# @FUNCTION: bzr_src_unpack
-# @DESCRIPTION:
-# Default src_unpack(), calls bzr_fetch.
-bzr_src_unpack() {
- bzr_fetch
-}
diff --git a/eclass/ghc-package.eclass b/eclass/ghc-package.eclass
index 5361f09af1e9..72d668ca0e2e 100644
--- a/eclass/ghc-package.eclass
+++ b/eclass/ghc-package.eclass
@@ -18,6 +18,14 @@ case "${EAPI:-0}" in
*) ;;
esac
+# GHC uses it's own native code generator. Portage's
+# QA check generates false positive because it assumes
+# presence of GCC-specific sections.
+#
+# Workaround false positiove by disabling the check completely.
+# bug #722078, bug #677600
+QA_FLAGS_IGNORED='.*'
+
# @FUNCTION: ghc-getghc
# @DESCRIPTION:
# returns the name of the ghc executable
diff --git a/eclass/gnome-python-common-r1.eclass b/eclass/gnome-python-common-r1.eclass
index 9fe793767708..f4a52bde8148 100644
--- a/eclass/gnome-python-common-r1.eclass
+++ b/eclass/gnome-python-common-r1.eclass
@@ -1,6 +1,7 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+# @DEAD
# @ECLASS: gnome-python-common-r1.eclass
# @MAINTAINER:
# GNOME team <gnome@gentoo.org>
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 07af8d8ab2c5..930bcf22e29e 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -1015,7 +1015,7 @@ postinst_sources() {
# K_SECURITY_UNSUPPORTED=deblob
# if we are to forcably symlink, delete it if it already exists first.
- if [[ ${K_SYMLINK} > 0 ]]; then
+ if [[ ${K_SYMLINK} -gt 0 ]]; then
[[ -h ${EROOT}usr/src/linux ]] && { rm "${EROOT}"usr/src/linux || die; }
MAKELINK=1
fi
@@ -1078,7 +1078,7 @@ postinst_sources() {
KV_PATCH=$(ver_cut 3 ${OKV})
if [[ "$(tc-arch)" = "sparc" ]]; then
if [[ $(gcc-major-version) -lt 4 && $(gcc-minor-version) -lt 4 ]]; then
- if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.24 ]] ; then
+ if [[ ${KV_MAJOR} -ge 3 ]] || ver_test ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} -gt 2.6.24 ; then
echo
elog "NOTE: Since 2.6.25 the kernel Makefile has changed in a way that"
elog "you now need to do"
@@ -1272,7 +1272,7 @@ unipatch() {
# do not apply fbcondecor patch to sparc/sparc64 as it breaks boot
# bug #272676
if [[ "$(tc-arch)" = "sparc" || "$(tc-arch)" = "sparc64" ]]; then
- if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.28 ]]; then
+ if [[ ${KV_MAJOR} -ge 3 ]] || ver_test ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} -gt 2.6.28 ; then
if [[ ! -z ${K_WANT_GENPATCHES} ]] ; then
UNIPATCH_DROP="${UNIPATCH_DROP} *_fbcondecor*.patch"
echo
@@ -1521,7 +1521,7 @@ kernel-2_src_unpack() {
# fix a problem on ppc where TOUT writes to /usr/src/linux breaking sandbox
# only do this for kernel < 2.6.27 since this file does not exist in later
# kernels
- if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]] ; then
+ if [[ -n ${KV_MINOR} ]] && ver_test ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} -lt 2.6.27 ; then
sed -i \
-e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \
"${S}"/arch/ppc/Makefile
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 028f0da8148e..7239737810f1 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -74,8 +74,8 @@ kernel-build_src_configure() {
ARCH=$(tc-arch-kernel)
)
- [[ -f .config ]] || die "Ebuild error: please copy default config into .config"
restore_config .config
+ [[ -f .config ]] || die "Ebuild error: please copy default config into .config"
mkdir -p "${WORKDIR}"/modprep || die
mv .config "${WORKDIR}"/modprep/ || die
@@ -99,9 +99,14 @@ kernel-build_src_compile() {
# from kernel-install.eclass with the correct paths.
kernel-build_src_test() {
debug-print-function ${FUNCNAME} "${@}"
+ local targets=( modules_install )
+ # on arm or arm64 you also need dtb
+ if use arm || use arm64; then
+ targets+=( dtbs_install )
+ fi
emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
- INSTALL_MOD_PATH="${T}" modules_install
+ INSTALL_MOD_PATH="${T}" INSTALL_PATH="${ED}/boot" "${targets[@]}"
kernel-install_test "${PV}" \
"${WORKDIR}/build/$(kernel-install_get_image_path)" \
@@ -117,8 +122,14 @@ kernel-build_src_install() {
# do not use 'make install' as it behaves differently based
# on what kind of installkernel is installed
+ local targets=( modules_install )
+ # on arm or arm64 you also need dtb
+ if use arm || use arm64; then
+ targets+=( dtbs_install )
+ fi
+
emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
- INSTALL_MOD_PATH="${ED}" modules_install
+ INSTALL_MOD_PATH="${ED}" INSTALL_PATH="${ED}/boot" "${targets[@]}"
# note: we're using mv rather than doins to save space and time
# install main and arch-specific headers first, and scripts
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index c26af5c2e88b..efccd70608c0 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -92,6 +92,12 @@ kernel-install_get_image_path() {
amd64|x86)
echo arch/x86/boot/bzImage
;;
+ arm64)
+ echo arch/arm64/boot/Image.gz
+ ;;
+ arm)
+ echo arch/arm/boot/zImage
+ ;;
*)
die "${FUNCNAME}: unsupported ARCH=${ARCH}"
;;
@@ -176,6 +182,12 @@ kernel-install_get_qemu_arch() {
x86)
echo i386
;;
+ arm)
+ echo arm
+ ;;
+ arm64)
+ echo aarch64
+ ;;
*)
die "${FUNCNAME}: unsupported ARCH=${ARCH}"
;;
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 44eebcf52a92..405ef5571e1c 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -813,7 +813,7 @@ check_extra_config() {
linux_chkconfig_present ${config} || error=1
fi
- if [[ ${error} > 0 ]]; then
+ if [[ ${error} -gt 0 ]]; then
local report_func="eerror" local_error
local_error="ERROR_${config}"
local_error="${!local_error}"
@@ -848,14 +848,14 @@ check_extra_config() {
fi
done
- if [[ ${hard_errors_count} > 0 ]]; then
+ if [[ ${hard_errors_count} -gt 0 ]]; then
eerror "Please check to make sure these options are set correctly."
eerror "Failure to do so may cause unexpected problems."
eerror "Once you have satisfied these options, please try merging"
eerror "this package again."
export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
die "Incorrect kernel configuration options"
- elif [[ ${soft_errors_count} > 0 ]]; then
+ elif [[ ${soft_errors_count} -gt 0 ]]; then
ewarn "Please check to make sure these options are set correctly."
ewarn "Failure to do so may cause unexpected problems."
else
diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
index a2da231b035a..61b34d4985eb 100644
--- a/eclass/llvm.eclass
+++ b/eclass/llvm.eclass
@@ -71,6 +71,10 @@ EXPORT_FUNCTIONS pkg_setup
if [[ ! ${_LLVM_ECLASS} ]]; then
+# make sure that the versions installing straight into /usr/bin
+# are uninstalled
+DEPEND="!!sys-devel/llvm:0"
+
# @ECLASS-VARIABLE: LLVM_MAX_SLOT
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -173,13 +177,6 @@ get_llvm_prefix() {
die "${FUNCNAME}: invalid max_slot=${max_slot}"
fi
- # fallback to :0
- # assume it's always <= 4 (the lower max_slot allowed)
- if has_version ${hv_switch} "sys-devel/llvm:0"; then
- echo "${prefix}/usr"
- return
- fi
-
die "No LLVM slot${1:+ <= ${1}} found installed!"
}
@@ -201,13 +198,29 @@ llvm_pkg_setup() {
debug-print-function ${FUNCNAME} "${@}"
if [[ ${MERGE_TYPE} != binary ]]; then
- local llvm_prefix=$(get_llvm_prefix "${LLVM_MAX_SLOT}")
+ local llvm_path=$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin
+ local IFS=:
+ local split_path=( ${PATH} )
+ local new_path=()
+ local x added=
+
+ # prepend new path before first LLVM version found
+ for x in "${split_path[@]}"; do
+ if [[ ${x} == */usr/lib/llvm/*/bin ]]; then
+ if [[ ${x} != ${llvm_path} ]]; then
+ new_path+=( "${llvm_path}" )
+ elif [[ ${added} && ${x} == ${llvm_path} ]]; then
+ # deduplicate
+ continue
+ fi
+ added=1
+ fi
+ new_path+=( "${x}" )
+ done
+ # ...or to the end of PATH
+ [[ ${added} ]] || new_path+=( "${llvm_path}" )
- # do not prepend /usr/bin, it's not necessary and breaks other
- # prepends, https://bugs.gentoo.org/622866
- if [[ ${llvm_prefix} != ${EPREFIX}/usr ]]; then
- export PATH=${llvm_prefix}/bin:${PATH}
- fi
+ export PATH=${new_path[*]}
fi
}
diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass
index 03ffac7914dc..04320849a747 100644
--- a/eclass/mozcoreconf-v6.eclass
+++ b/eclass/mozcoreconf-v6.eclass
@@ -203,7 +203,7 @@ mozconfig_init() {
case "${ARCH}" in
arm | ppc64)
# Reduce the memory requirements for linking
- if use clang ; then
+ if [[ "${PN}" != seamonkey ]] && use clang ; then
# Nothing to do
:;
elif tc-ld-is-gold; then
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index bbaab709b4fa..ed54568aa2d9 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -456,9 +456,27 @@ multilib_toolchain_setup() {
export ABI=$1
+ local save_restore_variables=(
+ CBUILD
+ CHOST
+ AR
+ CC
+ CXX
+ F77
+ FC
+ LD
+ NM
+ OBJDUMP
+ RANLIB
+ READELF
+ STRIP
+ PKG_CONFIG_LIBDIR
+ PKG_CONFIG_PATH
+ )
+
# First restore any saved state we have laying around.
if [[ ${_DEFAULT_ABI_SAVED} == "true" ]] ; then
- for v in CHOST CBUILD AS CC CXX F77 FC LD PKG_CONFIG_{LIBDIR,PATH} ; do
+ for v in "${save_restore_variables[@]}" ; do
vv="_abi_saved_${v}"
[[ ${!vv+set} == "set" ]] && export ${v}="${!vv}" || unset ${v}
unset ${vv}
@@ -466,11 +484,9 @@ multilib_toolchain_setup() {
unset _DEFAULT_ABI_SAVED
fi
- # We want to avoid the behind-the-back magic of gcc-config as it
- # screws up ccache and distcc. See #196243 for more info.
if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then
# Back that multilib-ass up so we can restore it later
- for v in CHOST CBUILD AS CC CXX F77 FC LD PKG_CONFIG_{LIBDIR,PATH} ; do
+ for v in "${save_restore_variables[@]}" ; do
vv="_abi_saved_${v}"
[[ ${!v+set} == "set" ]] && export ${vv}="${!v}" || unset ${vv}
done
@@ -483,12 +499,20 @@ multilib_toolchain_setup() {
# Set the CHOST native first so that we pick up the native
# toolchain and not a cross-compiler by accident #202811.
+ #
+ # Make sure ${save_restore_variables[@]} list matches below.
export CHOST=$(get_abi_CHOST ${DEFAULT_ABI})
+ export AR="$(tc-getAR)" # Avoid 'ar', use '${CHOST}-ar'
export CC="$(tc-getCC) $(get_abi_CFLAGS)"
export CXX="$(tc-getCXX) $(get_abi_CFLAGS)"
export F77="$(tc-getF77) $(get_abi_CFLAGS)"
export FC="$(tc-getFC) $(get_abi_CFLAGS)"
export LD="$(tc-getLD) $(get_abi_LDFLAGS)"
+ export NM="$(tc-getNM)" # Avoid 'nm', use '${CHOST}-nm'
+ export OBJDUMP="$(tc-getOBJDUMP)" # Avoid 'objdump', use '${CHOST}-objdump'
+ export RANLIB="$(tc-getRANLIB)" # Avoid 'ranlib', use '${CHOST}-ranlib'
+ export READELF="$(tc-getREADELF)" # Avoid 'readelf', use '${CHOST}-readelf'
+ export STRIP="$(tc-getSTRIP)" # Avoid 'strip', use '${CHOST}-strip'
export CHOST=$(get_abi_CHOST $1)
export PKG_CONFIG_LIBDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig
export PKG_CONFIG_PATH=${EPREFIX}/usr/share/pkgconfig
diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
index fd12245bb460..2e2ac85ead6f 100644
--- a/eclass/postgres.eclass
+++ b/eclass/postgres.eclass
@@ -27,7 +27,7 @@ esac
# @DESCRIPTION:
# List of versions to reverse sort POSTGRES_COMPAT slots
-_POSTGRES_ALL_VERSIONS=( 13 12 11 10 9.6 9.5 9.4 9.3 9.2 )
+_POSTGRES_ALL_VERSIONS=( 9999 13 12 11 10 9.6 9.5 9.4 9.3 9.2 )
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 4af710da363b..1067d2367aba 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -41,7 +41,7 @@ inherit toolchain-funcs
_PYTHON_ALL_IMPLS=(
pypy3
python2_7
- python3_6 python3_7 python3_8
+ python3_6 python3_7 python3_8 python3_9
)
readonly _PYTHON_ALL_IMPLS
@@ -77,7 +77,7 @@ _python_impl_supported() {
# keep in sync with _PYTHON_ALL_IMPLS!
# (not using that list because inline patterns shall be faster)
case "${impl}" in
- python2_7|python3_[678]|pypy3)
+ python2_7|python3_[6789]|pypy3)
return 0
;;
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[56]|python3_[12345])
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 9a757ccedf2f..cd2e19b0aa6a 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -194,6 +194,9 @@ qt5-build_src_configure() {
if [[ ${QT5_MODULE} == qtbase ]]; then
qt5_base_configure
fi
+ if [[ ${QT5_MINOR_VERSION} -ge 15 ]] && [[ ${QT5_MODULE} == qttools ]] && [[ -z ${QT5_TARGET_SUBDIRS[@]} ]]; then
+ qt5_tools_configure
+ fi
qt5_foreach_target_subdir qt5_qmake
}
@@ -565,7 +568,7 @@ qt5_base_configure() {
-no-libpng -no-libjpeg
-no-freetype -no-harfbuzz
-no-openssl -no-libproxy
- $([[ ${QT5_MINOR_VERSION} -ge 14 ]] && echo -no-feature-gssapi)
+ -no-feature-gssapi
-no-xcb-xlib
# bug 672340
@@ -615,7 +618,6 @@ qt5_base_configure() {
# disable all platform plugins by default, override in qtgui
-no-xcb -no-eglfs -no-kms -no-gbm -no-directfb -no-linuxfb
- $([[ ${QT5_MINOR_VERSION} -lt 14 ]] && echo -no-mirclient)
# disable undocumented X11-related flags, override in qtgui
# (not shown in ./configure -help output)
@@ -670,6 +672,34 @@ qt5_base_configure() {
}
+# @FUNCTION: qt5_tools_configure
+# @INTERNAL
+# @DESCRIPTION:
+# Disables modules other than ${PN} belonging to qttools.
+qt5_tools_configure() {
+ # configure arguments
+ local qmakeargs=(
+ --
+ # not packaged in Gentoo
+ -no-feature-distancefieldgenerator
+ -no-feature-kmap2qmap
+ -no-feature-macdeployqt
+ -no-feature-makeqpf
+ -no-feature-qev
+ -no-feature-qtattributionsscanner
+ -no-feature-windeployqt
+ -no-feature-winrtrunner
+ )
+
+ local i
+ for i in assistant designer linguist pixeltool qdbus qdoc qtdiag qtpaths qtplugininfo; do
+ [[ ${PN} == ${i} ]] || qmakeargs+=( -no-feature-${i} )
+ done
+
+ # allow the ebuild to override what we set here
+ myqmakeargs=( "${qmakeargs[@]}" "${myqmakeargs[@]}" )
+}
+
# @FUNCTION: qt5_qmake_args
# @INTERNAL
# @DESCRIPTION:
diff --git a/eclass/ros-catkin.eclass b/eclass/ros-catkin.eclass
index ee5def361146..a79cef7bd217 100644
--- a/eclass/ros-catkin.eclass
+++ b/eclass/ros-catkin.eclass
@@ -57,7 +57,7 @@ fi
# version. The idea here is to have a ROS_COMPAT in the same vein as
# PYTHON_COMPAT where packages would define what distro they can work on, then
# we'd have ros_distro_gentoo_python_2_7 & co plus the OSRF ones (lunar, etc.).
-# Note that this uncondtionally pulls python but in the ROS world there will
+# Note that this unconditionally pulls python but in the ROS world there will
# most certainly be something pulling python anyway.
PYTHON_COMPAT=( python3_6 )
@@ -158,7 +158,7 @@ ros-catkin_src_prepare() {
# Most packages require C++11 these days. Do it here, in src_prepare so that
# ebuilds can override it in src_configure.
- append-cxxflags '-std=c++11'
+ append-cxxflags '-std=c++14'
}
# @FUNCTION: ros-catkin_python_setup
diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass
index d809a496f526..36b1fbb0c685 100644
--- a/eclass/subversion.eclass
+++ b/eclass/subversion.eclass
@@ -30,11 +30,8 @@ esac
PROPERTIES+=" live"
-DEPEND="|| (
- dev-vcs/subversion[http]
- dev-vcs/subversion[webdav-neon]
- dev-vcs/subversion[webdav-serf]
- )
+DEPEND="
+ dev-vcs/subversion[http(+)]
net-misc/rsync"
case ${EAPI} in
diff --git a/eclass/tests/llvm.sh b/eclass/tests/llvm.sh
new file mode 100755
index 000000000000..8527d81765dd
--- /dev/null
+++ b/eclass/tests/llvm.sh
@@ -0,0 +1,138 @@
+#!/bin/bash
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+source tests-common.sh
+
+inherit llvm
+
+# llvm_check_deps override to disable has_version use.
+# in: ${LLVM_SLOT}
+# returns 0 if installed (i.e. == LLVM_INSTALLED_SLOT), 1 otherwise
+llvm_check_deps() {
+ [[ ${LLVM_SLOT} == ${LLVM_INSTALLED_SLOT} ]]
+}
+
+# check_prefix <expected> [<args>...]
+# Check output of `get_llvm_prefix <args>...`.
+check_prefix() {
+ local expected=${1}
+ shift
+
+ tbegin "get_llvm_prefix ${*}; inst=${LLVM_INSTALLED_SLOT} -> ${expected}"
+ prefix=$(get_llvm_prefix "${@}")
+ [[ ${prefix} == ${expected} ]] ||
+ eerror "got: ${prefix} != exp: ${expected}"
+ tend ${?}
+}
+
+# check_setup_path <expected>
+# Check PATH after pkg_setup.
+check_setup_path() {
+ local expected=${1}
+ shift
+
+ tbegin "pkg_setup; max=${LLVM_MAX_SLOT}; inst=${LLVM_INSTALLED_SLOT} -> PATH=${expected}"
+ path=$(llvm_pkg_setup; echo "${PATH}")
+ [[ ${path} == ${expected} ]] ||
+ eerror "got: ${path} != exp: ${expected}"
+ tend ${?}
+}
+
+
+EAPI=7
+BROOT=/broot
+SYSROOT=/sysroot
+ESYSROOT=/sysroot/eprefix
+ROOT=/root
+EROOT=/root/eprefix
+
+ebegin "Testing check_setup_path without max slot"
+eindent
+ LLVM_INSTALLED_SLOT=11 \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/11
+ LLVM_INSTALLED_SLOT=10 \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/10
+eoutdent
+
+ebegin "Testing check_setup_path with max slot"
+eindent
+ LLVM_INSTALLED_SLOT=1* \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/11 11
+ LLVM_INSTALLED_SLOT=1* \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/10 10
+ LLVM_INSTALLED_SLOT=10 \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/10 11
+eoutdent
+
+ebegin "Testing check_setup_path option switches"
+eindent
+ LLVM_INSTALLED_SLOT=11 \
+ check_prefix /broot/usr/lib/llvm/11 -b
+ LLVM_INSTALLED_SLOT=11 \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/11 -d
+eoutdent
+
+ebegin "Testing check_setup_path EAPI 6 API"
+eindent
+ EAPI=6 \
+ LLVM_INSTALLED_SLOT=11 \
+ check_prefix /usr/lib/llvm/11 -d
+eoutdent
+
+BASEPATH=/usr/lib/ccache/bin:/usr/bin:/usr/sbin:/bin:/sbin
+
+# TODO: cross support?
+ESYSROOT=
+
+ebegin "Testing pkg_setup with all installed LLVM versions in PATH"
+eindent
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH}:/usr/lib/llvm/11/bin \
+ check_setup_path "${BASEPATH}:/usr/lib/llvm/11/bin"
+
+ LLVM_MAX_SLOT=10 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH}:/usr/lib/llvm/11/bin:/usr/lib/llvm/10/bin \
+ check_setup_path "${BASEPATH}:/usr/lib/llvm/10/bin:/usr/lib/llvm/11/bin"
+
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=10 \
+ PATH=${BASEPATH}:/usr/lib/llvm/10/bin \
+ check_setup_path "${BASEPATH}:/usr/lib/llvm/10/bin"
+eoutdent
+
+ebegin "Testing pkg_setup with the other LLVM version in PATH"
+eindent
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH}:/usr/lib/llvm/10/bin \
+ check_setup_path "${BASEPATH}:/usr/lib/llvm/11/bin:/usr/lib/llvm/10/bin"
+
+ LLVM_MAX_SLOT=10 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH}:/usr/lib/llvm/11/bin \
+ check_setup_path "${BASEPATH}:/usr/lib/llvm/10/bin:/usr/lib/llvm/11/bin"
+eoutdent
+
+ebegin "Testing pkg_setup with LLVM missing from PATH"
+eindent
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH} \
+ check_setup_path "${BASEPATH}:/usr/lib/llvm/11/bin"
+
+ LLVM_MAX_SLOT=10 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH} \
+ check_setup_path "${BASEPATH}:/usr/lib/llvm/10/bin"
+
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=10 \
+ PATH=${BASEPATH} \
+ check_setup_path "${BASEPATH}:/usr/lib/llvm/10/bin"
+eoutdent
+
+texit
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 192c1183e800..86b87ec173d4 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -115,6 +115,20 @@ fi
test_var PYTHON_PKG_DEP python3_8 '*dev-lang/python*:3.8'
test_var PYTHON_SCRIPTDIR python3_8 /usr/lib/python-exec/python3.8
+test_var EPYTHON python3_9 python3.9
+test_var PYTHON python3_9 /usr/bin/python3.9
+if [[ -x /usr/bin/python3.9 ]]; then
+ abiflags=$(/usr/bin/python3.9 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+ test_var PYTHON_SITEDIR python3_9 "/usr/lib/python3.9/site-packages"
+ test_var PYTHON_INCLUDEDIR python3_9 "/usr/include/python3.9${abiflags}"
+ test_var PYTHON_LIBPATH python3_9 "/usr/lib*/libpython3.9${abiflags}$(get_libname)"
+ test_var PYTHON_CONFIG python3_9 "/usr/bin/python3.9${abiflags}-config"
+ test_var PYTHON_CFLAGS python3_9 "*-I/usr/include/python3.9*"
+ test_var PYTHON_LIBS python3_9 "*-lpython3.9*"
+fi
+test_var PYTHON_PKG_DEP python3_9 '*dev-lang/python*:3.9'
+test_var PYTHON_SCRIPTDIR python3_9 /usr/lib/python-exec/python3.9
+
test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 1bc6cbbc1088..a88d9a114ff0 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -83,8 +83,12 @@ tc-getSTRIP() { tc-getPROG STRIP strip "$@"; }
tc-getNM() { tc-getPROG NM nm "$@"; }
# @FUNCTION: tc-getRANLIB
# @USAGE: [toolchain prefix]
-# @RETURN: name of the archiver indexer
+# @RETURN: name of the archive indexer
tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; }
+# @FUNCTION: tc-getREADELF
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the ELF reader
+tc-getREADELF() { tc-getPROG READELF readelf "$@"; }
# @FUNCTION: tc-getOBJCOPY
# @USAGE: [toolchain prefix]
# @RETURN: name of the object copier
@@ -156,8 +160,12 @@ tc-getBUILD_STRIP() { tc-getBUILD_PROG STRIP strip "$@"; }
tc-getBUILD_NM() { tc-getBUILD_PROG NM nm "$@"; }
# @FUNCTION: tc-getBUILD_RANLIB
# @USAGE: [toolchain prefix]
-# @RETURN: name of the archiver indexer for building binaries to run on the build machine
+# @RETURN: name of the archive indexer for building binaries to run on the build machine
tc-getBUILD_RANLIB() { tc-getBUILD_PROG RANLIB ranlib "$@"; }
+# @FUNCTION: tc-getBUILD_READELF
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the ELF reader for building binaries to run on the build machine
+tc-getBUILD_READELF() { tc-getBUILD_PROG READELF readelf "$@"; }
# @FUNCTION: tc-getBUILD_OBJCOPY
# @USAGE: [toolchain prefix]
# @RETURN: name of the object copier for building binaries to run on the build machine
@@ -376,6 +384,7 @@ tc-env_build() {
NM=$(tc-getBUILD_NM) \
PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG) \
RANLIB=$(tc-getBUILD_RANLIB) \
+ READELF=$(tc-getBUILD_READELF) \
"$@"
}
diff --git a/eclass/twisted-r1.eclass b/eclass/twisted-r1.eclass
deleted file mode 100644
index 16faf25866c0..000000000000
--- a/eclass/twisted-r1.eclass
+++ /dev/null
@@ -1,238 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @DEAD
-# @ECLASS: twisted-r1.eclass
-# @MAINTAINER:
-# Gentoo Python Project <python@gentoo.org>
-# @AUTHOR:
-# Author: Michał Górny <mgorny@gentoo.org>
-# Author: Jan Matejka <yac@gentoo.org>
-# @SUPPORTED_EAPIS: 4 5
-# @BLURB: Eclass for Twisted packages
-# @DESCRIPTION:
-# The twisted eclass defines phase functions for Twisted packages.
-
-case "${EAPI:-0}" in
- 0|1|2|3)
- die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
- ;;
- 4|5)
- ;;
- *)
- die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
- ;;
-esac
-
-if [[ ! ${_TWISTED_R1} ]]; then
-
-inherit distutils-r1 versionator
-
-fi # ! ${_TWISTED_R1}
-
-EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
-
-if [[ ! ${_TWISTED_R1} ]]; then
-
-# @FUNCTION: _twisted-r1_camelcase
-# @USAGE: <pn>
-# @DESCRIPTION:
-# Convert dash-separated <pn> to CamelCase name suitable for Twisted.
-# In pure bash, therefore safe for global scope execution.
-_twisted-r1_camelcase() {
- local IFS=-
-
- # IFS=- splits words by -.
- local words=( ${1} )
-
- # we can't keep '-' as it collides with [a-z] check
- # and '' is used by bash-4 words[*], so let's just set globally
- IFS=
-
- if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
- echo "${words[*]^}"
- return
- fi
-
- local w LC_COLLATE=C uc='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-
- local out
- for w in "${words[@]}"; do
- local fl=${w:0:1}
-
- # Danger: magic starts here. Please close your eyes.
- # In base 36, a..z represents digits 10..35. We substract 10
- # and get array subscripts for uc.
-
- [[ ${fl} == [a-z] ]] && fl=${uc:36#${fl} - 10:1}
-
- out+=${fl}${w:1}
- done
-
- echo "${out}"
-}
-
-# @ECLASS-VARIABLE: TWISTED_PN
-# @DESCRIPTION:
-# The real package name. Default to camel-case conversion of ${PN}.
-#
-# Example: TwistedCore
-: ${TWISTED_PN:=$(_twisted-r1_camelcase ${PN})}
-
-# @ECLASS-VARIABLE: TWISTED_P
-# @DESCRIPTION:
-# The real package name with version appended.
-#
-# It is used to build the default SRC_URI and S values.
-#
-# Example: TwistedCore-1.2.3
-: ${TWISTED_P:=${TWISTED_PN}-${PV}}
-
-# @ECLASS-VARIABLE: TWISTED_RELEASE
-# @DESCRIPTION:
-# The 'release' of Twisted. Defaults to the major & minor version
-# number from ${PV}.
-#
-# It is used to build the default SRC_URI. It may be also used
-# in dependencies against other Twisted packages.
-#
-# Example: 1.2
-: ${TWISTED_RELEASE:=$(get_version_component_range 1-2 ${PV})}
-
-HOMEPAGE="https://www.twistedmatrix.com/trac/"
-SRC_URI="https://twistedmatrix.com/Releases/${TWISTED_PN#Twisted}"
-SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE=""
-
-S=${WORKDIR}/${TWISTED_P}
-
-# @ECLASS-VARIABLE: TWISTED_PLUGINS
-# @DESCRIPTION:
-# An array of Twisted plugins, whose cache is regenerated
-# in pkg_postinst() and pkg_postrm() phases.
-#
-# If no plugins are installed, set to empty array.
-declare -p TWISTED_PLUGINS &>/dev/null || TWISTED_PLUGINS=( twisted.plugins )
-
-# @FUNCTION: twisted-r1_python_test
-# @DESCRIPTION:
-# The common python_test() implementation that suffices for Twisted
-# packages.
-twisted-r1_python_test() {
- local sitedir=$(python_get_sitedir)
-
- # Copy modules of other Twisted packages from site-packages
- # directory to the temporary directory.
- local libdir=${BUILD_DIR}/test/lib
- mkdir -p "${libdir}" || die
- cp -r "${ROOT}${sitedir}"/twisted "${libdir}" || die
- # Drop the installed module in case previous version conflicts with
- # the new one somehow.
- rm -fr "${libdir}/${PN/-//}" || die
-
- distutils_install_for_testing || die
-
- if [[ ${TEST_DIR} != ${BUILD_DIR}/test ]]; then
- eerror "twisted-r1 integrity check failed."
- eerror "TEST_DIR: ${TEST_DIR}"
- eerror "expected: ${BUILD_DIR}/test"
- die "TEST_DIR integrity check failed"
- fi
-
- cd "${TEST_DIR}"/lib || die
- trial ${PN/-/.} || die "Tests fail with ${EPYTHON}"
-}
-
-# @FUNCTION: python_test
-# @DESCRIPTION:
-# Default python_test() for Twisted packages. If you need to override
-# it, you can access the original implementation
-# via twisted-r1_python_test.
-python_test() {
- twisted-r1_python_test
-}
-
-# @FUNCTION: twisted-r1_src_install
-# @DESCRIPTION:
-# Default src_install() for Twisted packages. Automatically handles HTML
-# docs (unless HTML_DOCS is set explicitly) and manpages in Twisted
-# packages.
-twisted-r1_src_install() {
- [[ -d doc ]] && local HTML_DOCS=( "${HTML_DOCS[@]:-doc/.}" )
- [[ -d doc/man ]] && doman doc/man/*.[[:digit:]]
-
- distutils-r1_src_install
-}
-
-# @FUNCTION: _twisted-r1_create_caches
-# @USAGE: <packages>...
-# @DESCRIPTION:
-# Create dropin.cache for plugins in specified packages. The packages
-# are to be listed in standard dotted Python syntax.
-_twisted-r1_create_caches() {
- # http://twistedmatrix.com/documents/current/core/howto/plugin.html
- "${PYTHON}" -c \
-"import sys
-sys.path.insert(0, '${ROOT}$(python_get_sitedir)')
-
-fail = False
-
-try:
- from twisted.plugin import getPlugins, IPlugin
-except ImportError as e:
- if '${EBUILD_PHASE}' == 'postinst':
- raise
-else:
- for module in sys.argv[1:]:
- try:
- __import__(module, globals())
- except ImportError as e:
- if '${EBUILD_PHASE}' == 'postinst':
- raise
- else:
- list(getPlugins(IPlugin, sys.modules[module]))
-" \
- "${@}" || die "twisted plugin cache update failed"
-}
-
-# @FUNCTION: twisted-r1_update_plugin_cache
-# @DESCRIPTION:
-# Update and clean up plugin caches for packages listed
-# in TWISTED_PLUGINS.
-twisted-r1_update_plugin_cache() {
- [[ ${TWISTED_PLUGINS[@]} ]] || return
-
- local subdirs=( "${TWISTED_PLUGINS[@]//.//}" )
- local paths=( "${subdirs[@]/#/${ROOT}$(python_get_sitedir)/}" )
- local caches=( "${paths[@]/%//dropin.cache}" )
-
- # First, delete existing (possibly stray) caches.
- rm -f "${caches[@]}" || die
-
- # Now, let's see which ones we can regenerate.
- _twisted-r1_create_caches "${TWISTED_PLUGINS[@]}"
-
- # Finally, drop empty parent directories.
- rmdir -p "${paths[@]}" 2>/dev/null
-}
-
-# @FUNCTION: twisted-r1_pkg_postinst
-# @DESCRIPTION:
-# Post-installation hook for twisted-r1. Updates plugin caches.
-twisted-r1_pkg_postinst() {
- _distutils-r1_run_foreach_impl twisted-r1_update_plugin_cache
-}
-
-# @FUNCTION: twisted-r1_pkg_postrm
-# @DESCRIPTION:
-# Post-removal hook for twisted-r1. Updates plugin caches.
-twisted-r1_pkg_postrm() {
- _distutils-r1_run_foreach_impl twisted-r1_update_plugin_cache
-}
-
-_TWISTED_R1=1
-
-fi # ! ${_TWISTED_R1}