summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/acct-group.eclass41
-rw-r--r--eclass/acct-user.eclass148
-rw-r--r--eclass/alternatives.eclass2
-rw-r--r--eclass/ant-tasks.eclass2
-rw-r--r--eclass/apache-2.eclass71
-rw-r--r--eclass/apache-module.eclass2
-rw-r--r--eclass/aspell-dict-r1.eclass2
-rw-r--r--eclass/autotools.eclass27
-rw-r--r--eclass/bash-completion-r1.eclass2
-rw-r--r--eclass/cdrom.eclass2
-rw-r--r--eclass/common-lisp-3.eclass2
-rw-r--r--eclass/cvs.eclass2
-rw-r--r--eclass/db-use.eclass2
-rw-r--r--eclass/db.eclass30
-rw-r--r--eclass/dist-kernel-utils.eclass161
-rw-r--r--eclass/docs.eclass336
-rw-r--r--eclass/dotnet.eclass2
-rw-r--r--eclass/dune.eclass3
-rw-r--r--eclass/ecm.eclass25
-rw-r--r--eclass/estack.eclass2
-rw-r--r--eclass/fdo-mime.eclass43
-rw-r--r--eclass/findlib.eclass5
-rw-r--r--eclass/font-ebdftopcf.eclass2
-rw-r--r--eclass/gnome2-utils.eclass123
-rw-r--r--eclass/gnome2.eclass96
-rw-r--r--eclass/gnustep-2.eclass2
-rw-r--r--eclass/golang-base.eclass2
-rw-r--r--eclass/golang-build.eclass2
-rw-r--r--eclass/golang-vcs-snapshot.eclass2
-rw-r--r--eclass/haskell-cabal.eclass9
-rw-r--r--eclass/java-ant-2.eclass2
-rw-r--r--eclass/java-utils-2.eclass2
-rw-r--r--eclass/java-vm-2.eclass2
-rw-r--r--eclass/kde.org.eclass9
-rw-r--r--eclass/kernel-2.eclass14
-rw-r--r--eclass/kernel-build.eclass6
-rw-r--r--eclass/kernel-install.eclass144
-rw-r--r--eclass/linux-mod.eclass13
-rw-r--r--eclass/lua-utils.eclass70
-rw-r--r--eclass/meson.eclass19
-rw-r--r--eclass/mount-boot.eclass19
-rw-r--r--eclass/mozcoreconf-v5.eclass2
-rw-r--r--eclass/mozcoreconf-v6.eclass2
-rw-r--r--eclass/mozextension.eclass2
-rw-r--r--eclass/mozlinguas-v2.eclass5
-rw-r--r--eclass/multibuild.eclass2
-rw-r--r--eclass/myspell-r2.eclass2
-rw-r--r--eclass/nvidia-driver.eclass236
-rw-r--r--eclass/office-ext-r1.eclass135
-rw-r--r--eclass/opam.eclass3
-rw-r--r--eclass/openib.eclass2
-rw-r--r--eclass/optfeature.eclass7
-rw-r--r--eclass/pam.eclass47
-rw-r--r--eclass/php-pear-r2.eclass2
-rw-r--r--eclass/portability.eclass2
-rw-r--r--eclass/prefix.eclass2
-rw-r--r--eclass/python-any-r1.eclass69
-rw-r--r--eclass/python-r1.eclass56
-rw-r--r--eclass/python-utils-r1.eclass62
-rw-r--r--eclass/qmake-utils.eclass225
-rw-r--r--eclass/qt5-build.eclass3
-rw-r--r--eclass/ruby-utils.eclass6
-rw-r--r--eclass/s6.eclass2
-rw-r--r--eclass/ssl-cert.eclass2
-rw-r--r--eclass/stardict.eclass2
-rw-r--r--eclass/systemd.eclass2
-rwxr-xr-xeclass/tests/flag-o-matic.sh2
-rwxr-xr-xeclass/tests/python-utils-r1.sh18
-rw-r--r--eclass/tests/tests-common.sh2
-rwxr-xr-xeclass/tests/toolchain-funcs.sh5
-rwxr-xr-xeclass/tests/toolchain.sh2
-rw-r--r--eclass/toolchain-autoconf.eclass2
-rw-r--r--eclass/toolchain-funcs.eclass23
-rw-r--r--eclass/toolchain-glibc.eclass2
-rw-r--r--eclass/unpacker.eclass6
-rw-r--r--eclass/vala.eclass4
-rw-r--r--eclass/vim-doc.eclass2
-rw-r--r--eclass/waf-utils.eclass4
-rw-r--r--eclass/webapp.eclass2
-rw-r--r--eclass/xorg-2.eclass31
-rw-r--r--eclass/xorg-3.eclass31
81 files changed, 1399 insertions, 1067 deletions
diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
index 19a378e0b06..11a9f29e625 100644
--- a/eclass/acct-group.eclass
+++ b/eclass/acct-group.eclass
@@ -59,7 +59,8 @@ readonly ACCT_GROUP_NAME
# @REQUIRED
# @DESCRIPTION:
# Preferred GID for the new group. This variable is obligatory, and its
-# value must be unique across all group packages.
+# value must be unique across all group packages. This can be overriden
+# in make.conf through ACCT_GROUP_<UPPERCASE_USERNAME>_ID variable.
#
# Overlays should set this to -1 to dynamically allocate GID. Using -1
# in ::gentoo is prohibited by policy.
@@ -75,7 +76,7 @@ readonly ACCT_GROUP_NAME
# << Boilerplate ebuild variables >>
: ${DESCRIPTION:="System group: ${ACCT_GROUP_NAME}"}
: ${SLOT:=0}
-: ${KEYWORDS:=alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris}
+: ${KEYWORDS:=alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris}
S=${WORKDIR}
@@ -91,25 +92,33 @@ acct-group_pkg_pretend() {
# verify ACCT_GROUP_ID
[[ -n ${ACCT_GROUP_ID} ]] || die "Ebuild error: ACCT_GROUP_ID must be set!"
- [[ ${ACCT_GROUP_ID} -eq -1 ]] && return
- [[ ${ACCT_GROUP_ID} -ge 0 ]] || die "Ebuild errors: ACCT_GROUP_ID=${ACCT_GROUP_ID} invalid!"
+ [[ ${ACCT_GROUP_ID} -ge -1 ]] || die "Ebuild error: ACCT_GROUP_ID=${ACCT_GROUP_ID} invalid!"
+ local group_id=${ACCT_GROUP_ID}
+
+ # check for the override
+ local override_name=${ACCT_GROUP_NAME^^}
+ local override_var=ACCT_GROUP_${override_name//-/_}_ID
+ if [[ -n ${!override_var} ]]; then
+ group_id=${!override_var}
+ [[ ${group_id} -ge -1 ]] || die "${override_var}=${group_id} invalid!"
+ fi
# check for ACCT_GROUP_ID collisions early
- if [[ -n ${ACCT_GROUP_ENFORCE_ID} ]]; then
- local group_by_id=$(egetgroupname "${ACCT_GROUP_ID}")
+ if [[ ${group_id} -ne -1 && -n ${ACCT_GROUP_ENFORCE_ID} ]]; then
+ local group_by_id=$(egetgroupname "${group_id}")
local group_by_name=$(egetent group "${ACCT_GROUP_NAME}")
if [[ -n ${group_by_id} ]]; then
if [[ ${group_by_id} != ${ACCT_GROUP_NAME} ]]; then
eerror "The required GID is already taken by another group."
- eerror " GID: ${ACCT_GROUP_ID}"
+ eerror " GID: ${group_id}"
eerror " needed for: ${ACCT_GROUP_NAME}"
eerror " current group: ${group_by_id}"
- die "GID ${ACCT_GROUP_ID} taken already"
+ die "GID ${group_id} taken already"
fi
elif [[ -n ${group_by_name} ]]; then
eerror "The requested group exists already with wrong GID."
eerror " groupname: ${ACCT_GROUP_NAME}"
- eerror " requested GID: ${ACCT_GROUP_ID}"
+ eerror " requested GID: ${group_id}"
eerror " current entry: ${group_by_name}"
die "Group ${ACCT_GROUP_NAME} exists with wrong GID"
fi
@@ -122,11 +131,21 @@ acct-group_pkg_pretend() {
acct-group_src_install() {
debug-print-function ${FUNCNAME} "${@}"
+ # check for the override
+ local override_name=${ACCT_GROUP_NAME^^}
+ local override_var=ACCT_GROUP_${override_name//-/_}_ID
+ if [[ -n ${!override_var} ]]; then
+ ewarn "${override_var}=${!override_var} override in effect, support will not be provided."
+ _ACCT_GROUP_ID=${!override_var}
+ else
+ _ACCT_GROUP_ID=${ACCT_GROUP_ID}
+ fi
+
insinto /usr/lib/sysusers.d
newins - ${CATEGORY}-${ACCT_GROUP_NAME}.conf < <(
printf "g\t%q\t%q\n" \
"${ACCT_GROUP_NAME}" \
- "${ACCT_GROUP_ID/#-*/-}"
+ "${_ACCT_GROUP_ID/#-*/-}"
)
}
@@ -137,7 +156,7 @@ acct-group_pkg_preinst() {
debug-print-function ${FUNCNAME} "${@}"
enewgroup ${ACCT_GROUP_ENFORCE_ID:+-F} "${ACCT_GROUP_NAME}" \
- "${ACCT_GROUP_ID}"
+ "${_ACCT_GROUP_ID}"
}
fi
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index 56a4e83e8bf..ee4358b5c75 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -67,11 +67,17 @@ readonly ACCT_USER_NAME
# @REQUIRED
# @DESCRIPTION:
# Preferred UID for the new user. This variable is obligatory, and its
-# value must be unique across all user packages.
+# value must be unique across all user packages. This can be overriden
+# in make.conf through ACCT_USER_<UPPERCASE_USERNAME>_ID variable.
#
# Overlays should set this to -1 to dynamically allocate UID. Using -1
# in ::gentoo is prohibited by policy.
+# @ECLASS-VARIABLE: _ACCT_USER_ALREADY_EXISTS
+# @INTERNAL
+# @DESCRIPTION:
+# Status variable which indicates if user already exists.
+
# @ECLASS-VARIABLE: ACCT_USER_ENFORCE_ID
# @DESCRIPTION:
# If set to a non-null value, the eclass will require the user to have
@@ -79,10 +85,18 @@ readonly ACCT_USER_NAME
# the UID is taken by another user, the install will fail.
: ${ACCT_USER_ENFORCE_ID:=}
+# @ECLASS-VARIABLE: ACCT_USER_NO_MODIFY
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set to a non-null value, the eclass will not make any changes
+# to an already existing user.
+: ${ACCT_USER_NO_MODIFY:=}
+
# @ECLASS-VARIABLE: ACCT_USER_SHELL
# @DESCRIPTION:
# The shell to use for the user. If not specified, a 'nologin' variant
-# for the system is used.
+# for the system is used. This can be overriden in make.conf through
+# ACCT_USER_<UPPERCASE_USERNAME>_SHELL variable.
: ${ACCT_USER_SHELL:=-1}
# @ECLASS-VARIABLE: ACCT_USER_HOME
@@ -90,6 +104,8 @@ readonly ACCT_USER_NAME
# The home directory for the user. If not specified, /dev/null is used.
# The directory will be created with appropriate permissions if it does
# not exist. When updating, existing home directory will not be moved.
+# This can be overriden in make.conf through
+# ACCT_USER_<UPPERCASE_USERNAME>_HOME variable.
: ${ACCT_USER_HOME:=/dev/null}
# @ECLASS-VARIABLE: ACCT_USER_HOME_OWNER
@@ -97,11 +113,14 @@ readonly ACCT_USER_NAME
# @DESCRIPTION:
# The ownership to use for the home directory, in chown ([user][:group])
# syntax. Defaults to the newly created user, and its primary group.
+# This can be overriden in make.conf through
+# ACCT_USER_<UPPERCASE_USERNAME>_HOME_OWNER variable.
# @ECLASS-VARIABLE: ACCT_USER_HOME_PERMS
# @DESCRIPTION:
# The permissions to use for the home directory, in chmod (octal
-# or verbose) form.
+# or verbose) form. This can be overriden in make.conf through
+# ACCT_USER_<UPPERCASE_USERNAME>_HOME_PERMS variable.
: ${ACCT_USER_HOME_PERMS:=0755}
# @ECLASS-VARIABLE: ACCT_USER_GROUPS
@@ -110,12 +129,18 @@ readonly ACCT_USER_NAME
# List of groups the user should belong to. This must be a bash
# array. The first group specified is the user's primary group, while
# the remaining groups (if any) become supplementary groups.
+#
+# This can be overriden in make.conf through
+# ACCT_USER_<UPPERCASE_USERNAME>_GROUPS variable, or appended to
+# via ACCT_USER_<UPPERCASE_USERNAME>_GROUPS_ADD. Please note that
+# due to technical limitations, the override variables are not arrays
+# but space-separated lists.
# << Boilerplate ebuild variables >>
: ${DESCRIPTION:="System user: ${ACCT_USER_NAME}"}
: ${SLOT:=0}
-: ${KEYWORDS:=alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris}
+: ${KEYWORDS:=alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris}
S=${WORKDIR}
@@ -152,7 +177,7 @@ acct-user_add_deps() {
eislocked() {
[[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
- if [[ ${EUID} != 0 ]] ; then
+ if [[ ${EUID} != 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -189,7 +214,7 @@ eislocked() {
elockuser() {
[[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
- if [[ ${EUID} != 0 ]] ; then
+ if [[ ${EUID} != 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -232,7 +257,7 @@ elockuser() {
eunlockuser() {
[[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
- if [[ ${EUID} != 0 ]] ; then
+ if [[ ${EUID} != 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -284,25 +309,33 @@ acct-user_pkg_pretend() {
# verify ACCT_USER_ID
[[ -n ${ACCT_USER_ID} ]] || die "Ebuild error: ACCT_USER_ID must be set!"
- [[ ${ACCT_USER_ID} -eq -1 ]] && return
- [[ ${ACCT_USER_ID} -ge 0 ]] || die "Ebuild errors: ACCT_USER_ID=${ACCT_USER_ID} invalid!"
+ [[ ${ACCT_USER_ID} -ge -1 ]] || die "Ebuild error: ACCT_USER_ID=${ACCT_USER_ID} invalid!"
+ local user_id=${ACCT_USER_ID}
+
+ # check for the override
+ local override_name=${ACCT_USER_NAME^^}
+ local override_var=ACCT_USER_${override_name//-/_}_ID
+ if [[ -n ${!override_var} ]]; then
+ user_id=${!override_var}
+ [[ ${user_id} -ge -1 ]] || die "${override_var}=${user_id} invalid!"
+ fi
# check for ACCT_USER_ID collisions early
- if [[ -n ${ACCT_USER_ENFORCE_ID} ]]; then
- local user_by_id=$(egetusername "${ACCT_USER_ID}")
+ if [[ ${user_id} -ne -1 && -n ${ACCT_USER_ENFORCE_ID} ]]; then
+ local user_by_id=$(egetusername "${user_id}")
local user_by_name=$(egetent passwd "${ACCT_USER_NAME}")
if [[ -n ${user_by_id} ]]; then
if [[ ${user_by_id} != ${ACCT_USER_NAME} ]]; then
eerror "The required UID is already taken by another user."
- eerror " UID: ${ACCT_USER_ID}"
+ eerror " UID: ${user_id}"
eerror " needed for: ${ACCT_USER_NAME}"
eerror " current user: ${user_by_id}"
- die "UID ${ACCT_USER_ID} taken already"
+ die "UID ${user_id} taken already"
fi
elif [[ -n ${user_by_name} ]]; then
eerror "The requested user exists already with wrong UID."
eerror " username: ${ACCT_USER_NAME}"
- eerror " requested UID: ${ACCT_USER_ID}"
+ eerror " requested UID: ${user_id}"
eerror " current entry: ${user_by_name}"
die "Username ${ACCT_USER_NAME} exists with wrong UID"
fi
@@ -316,23 +349,48 @@ acct-user_pkg_pretend() {
acct-user_src_install() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ${ACCT_USER_HOME} != /dev/null ]]; then
+ # serialize for override support
+ local ACCT_USER_GROUPS=${ACCT_USER_GROUPS[*]}
+
+ # support make.conf overrides
+ local override_name=${ACCT_USER_NAME^^}
+ override_name=${override_name//-/_}
+ local var
+ for var in ACCT_USER_{ID,SHELL,HOME{,_OWNER,_PERMS},GROUPS}; do
+ local var_name=ACCT_USER_${override_name}_${var#ACCT_USER_}
+ if [[ -n ${!var_name} ]]; then
+ ewarn "${var_name}=${!var_name} override in effect, support will not be provided."
+ else
+ var_name=${var}
+ fi
+ declare -g "_${var}=${!var_name}"
+ done
+ var_name=ACCT_USER_${override_name}_GROUPS_ADD
+ if [[ -n ${!var_name} ]]; then
+ ewarn "${var_name}=${!var_name} override in effect, support will not be provided."
+ _ACCT_USER_GROUPS+=" ${!var_name}"
+ fi
+
+ # deserialize into an array
+ local groups=( ${_ACCT_USER_GROUPS} )
+
+ if [[ ${_ACCT_USER_HOME} != /dev/null ]]; then
# note: we can't set permissions here since the user isn't
# created yet
- keepdir "${ACCT_USER_HOME}"
+ keepdir "${_ACCT_USER_HOME}"
fi
insinto /usr/lib/sysusers.d
newins - ${CATEGORY}-${ACCT_USER_NAME}.conf < <(
printf "u\t%q\t%q\t%q\t%q\t%q\n" \
"${ACCT_USER_NAME}" \
- "${ACCT_USER_ID/#-*/-}:${ACCT_USER_GROUPS[0]}" \
+ "${_ACCT_USER_ID/#-*/-}:${groups[0]}" \
"${DESCRIPTION//[:,=]/;}" \
- "${ACCT_USER_HOME}" \
- "${ACCT_USER_SHELL/#-*/-}"
- if [[ ${#ACCT_USER_GROUPS[@]} -gt 1 ]]; then
+ "${_ACCT_USER_HOME}" \
+ "${_ACCT_USER_SHELL/#-*/-}"
+ if [[ ${#groups[@]} -gt 1 ]]; then
printf "m\t${ACCT_USER_NAME}\t%q\n" \
- "${ACCT_USER_GROUPS[@]:1}"
+ "${groups[@]:1}"
fi
)
}
@@ -344,26 +402,33 @@ acct-user_src_install() {
acct-user_pkg_preinst() {
debug-print-function ${FUNCNAME} "${@}"
- local groups=${ACCT_USER_GROUPS[*]}
+ # check if user already exists
+ _ACCT_USER_ALREADY_EXISTS=
+ if [[ -n $(egetent passwd "${ACCT_USER_NAME}") ]]; then
+ _ACCT_USER_ALREADY_EXISTS=1
+ fi
+ readonly _ACCT_USER_ALREADY_EXISTS
+
enewuser ${ACCT_USER_ENFORCE_ID:+-F} -M "${ACCT_USER_NAME}" \
- "${ACCT_USER_ID}" "${ACCT_USER_SHELL}" "${ACCT_USER_HOME}" \
- "${groups// /,}"
+ "${_ACCT_USER_ID}" "${_ACCT_USER_SHELL}" "${_ACCT_USER_HOME}" \
+ "${_ACCT_USER_GROUPS// /,}"
- if [[ ${ACCT_USER_HOME} != /dev/null ]]; then
+ if [[ ${_ACCT_USER_HOME} != /dev/null ]]; then
# default ownership to user:group
- if [[ -z ${ACCT_USER_HOME_OWNER} ]]; then
- ACCT_USER_HOME_OWNER=${ACCT_USER_NAME}:${ACCT_USER_GROUPS[0]}
+ if [[ -z ${_ACCT_USER_HOME_OWNER} ]]; then
+ local group_array=( ${_ACCT_USER_GROUPS} )
+ _ACCT_USER_HOME_OWNER=${ACCT_USER_NAME}:${group_array[0]}
fi
# Path might be missing due to INSTALL_MASK, etc.
# https://bugs.gentoo.org/691478
- if [[ ! -e "${ED}/${ACCT_USER_HOME#/}" ]]; then
+ if [[ ! -e "${ED}/${_ACCT_USER_HOME#/}" ]]; then
eerror "Home directory is missing from the installation image:"
- eerror " ${ACCT_USER_HOME}"
+ eerror " ${_ACCT_USER_HOME}"
eerror "Check INSTALL_MASK for entries that would cause this."
- die "${ACCT_USER_HOME} does not exist"
+ die "${_ACCT_USER_HOME} does not exist"
fi
- fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}"
- fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}"
+ fowners "${_ACCT_USER_HOME_OWNER}" "${_ACCT_USER_HOME}"
+ fperms "${_ACCT_USER_HOME_PERMS}" "${_ACCT_USER_HOME}"
fi
}
@@ -374,16 +439,23 @@ acct-user_pkg_preinst() {
acct-user_pkg_postinst() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ${EUID} != 0 ]] ; then
+ if [[ ${EUID} != 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
+ if [[ -n ${ACCT_USER_NO_MODIFY} && -n ${_ACCT_USER_ALREADY_EXISTS} ]]; then
+ eunlockuser "${ACCT_USER_NAME}"
+
+ ewarn "User ${ACCT_USER_NAME} already exists; Not touching existing user"
+ ewarn "due to set ACCT_USER_NO_MODIFY."
+ return 0
+ fi
+
# NB: eset* functions check current value
- esethome "${ACCT_USER_NAME}" "${ACCT_USER_HOME}"
- esetshell "${ACCT_USER_NAME}" "${ACCT_USER_SHELL}"
- local groups=${ACCT_USER_GROUPS[*]}
- esetgroups "${ACCT_USER_NAME}" "${groups// /,}"
+ esethome "${ACCT_USER_NAME}" "${_ACCT_USER_HOME}"
+ esetshell "${ACCT_USER_NAME}" "${_ACCT_USER_SHELL}"
+ esetgroups "${ACCT_USER_NAME}" "${_ACCT_USER_GROUPS// /,}"
# comment field can not contain colons
esetcomment "${ACCT_USER_NAME}" "${DESCRIPTION//[:,=]/;}"
eunlockuser "${ACCT_USER_NAME}"
@@ -395,7 +467,7 @@ acct-user_pkg_postinst() {
acct-user_pkg_prerm() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ${EUID} != 0 ]] ; then
+ if [[ ${EUID} != 0 ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
diff --git a/eclass/alternatives.eclass b/eclass/alternatives.eclass
index fd99bd85acd..79f14d81b13 100644
--- a/eclass/alternatives.eclass
+++ b/eclass/alternatives.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: alternatives.eclass
diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
index c882196e775..42f801a84d7 100644
--- a/eclass/ant-tasks.eclass
+++ b/eclass/ant-tasks.eclass
@@ -1,4 +1,4 @@
-# Copyright 2007-2019 Gentoo Authors
+# Copyright 2007-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ant-tasks.eclass
diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass
index 07f2cd6af87..0177b5987d4 100644
--- a/eclass/apache-2.eclass
+++ b/eclass/apache-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: apache-2.eclass
@@ -10,7 +10,7 @@
# This eclass handles apache-2.x ebuild functions such as LoadModule generation
# and inter-module dependency checking.
-inherit autotools flag-o-matic multilib ssl-cert user toolchain-funcs eapi7-ver
+inherit autotools flag-o-matic multilib ssl-cert user toolchain-funcs
[[ ${CATEGORY}/${PN} != www-servers/apache ]] \
&& die "Do not use this eclass with anything else than www-servers/apache ebuilds!"
@@ -19,13 +19,20 @@ case ${EAPI:-0} in
0|1|2|3|4|5)
die "This eclass is banned for EAPI<6"
;;
+ 6)
+ inherit eapi7-ver
+ ;;
+ *)
+ LUA_COMPAT=( lua5-{1..4} )
+ inherit lua-single
+ ;;
esac
# settings which are version specific go in here:
case $(ver_cut 1-2) in
2.4)
DEFAULT_MPM_THREADED="event" #509922
- CDEPEND=">=dev-libs/apr-1.5.1:=
+ COMMON_DEPEND=">=dev-libs/apr-1.5.1:=
!www-apache/mod_macro" #492578 #477702
;;
*)
@@ -88,10 +95,18 @@ SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2
# built-in modules
IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}"
-IUSE="${IUSE} debug doc gdbm ldap libressl selinux ssl static suexec threads"
+IUSE="${IUSE} debug doc gdbm ldap libressl selinux ssl static suexec +suexec-caps suexec-syslog split-usr threads"
for module in ${IUSE_MODULES} ; do
- IUSE="${IUSE} apache2_modules_${module}"
+ case ${module} in
+ # Enable http2 by default (bug #563452)
+ http2)
+ IUSE+=" +apache2_modules_${module}"
+ ;;
+ *)
+ IUSE+=" apache2_modules_${module}"
+ ;;
+ esac
done
_apache2_set_mpms() {
@@ -121,23 +136,52 @@ _apache2_set_mpms() {
_apache2_set_mpms
unset -f _apache2_set_mpms
-DEPEND="${CDEPEND}
+# Dependencies
+RDEPEND="
dev-lang/perl
=dev-libs/apr-util-1*:=[gdbm=,ldap?]
dev-libs/libpcre
+ apache2_modules_brotli? ( >=app-arch/brotli-0.6.0:= )
apache2_modules_deflate? ( sys-libs/zlib )
+ apache2_modules_http2? (
+ >=net-libs/nghttp2-1.2.1
+ kernel_linux? ( sys-apps/util-linux )
+ )
+ apache2_modules_md? ( >=dev-libs/jansson-2.10 )
apache2_modules_mime? ( app-misc/mime-types )
+ apache2_modules_proxy_http2? (
+ >=net-libs/nghttp2-1.2.1
+ kernel_linux? ( sys-apps/util-linux )
+ )
+ apache2_modules_session_crypto? (
+ libressl? ( dev-libs/apr-util[libressl] )
+ !libressl? ( dev-libs/apr-util[openssl] )
+ )
gdbm? ( sys-libs/gdbm:= )
ldap? ( =net-nds/openldap-2* )
+ selinux? ( sec-policy/selinux-apache )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.2:0= )
libressl? ( dev-libs/libressl:0= )
+ kernel_linux? ( sys-apps/util-linux )
)
- !=www-servers/apache-1*"
-RDEPEND+=" ${DEPEND}
- selinux? ( sec-policy/selinux-apache )"
+"
+
+DEPEND="${RDEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+ suexec? ( suexec-caps? ( sys-libs/libcap ) )
+"
+if [[ ${EAPI} == 6 ]] ; then
+ DEPEND+=" ${BDEPEND}"
+fi
PDEPEND="~app-admin/apache-tools-${PV}"
+REQUIRED_USE+="
+ apache2_modules_http2? ( ssl )
+ apache2_modules_md? ( ssl )
+"
+
S="${WORKDIR}/httpd-${PV}"
# @VARIABLE: MODULE_DEPENDS
@@ -254,7 +298,10 @@ setup_modules() {
MY_MODS=()
if use ldap ; then
- MY_CONF+=( --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type} )
+ MY_CONF+=(
+ --enable-authnz_ldap=${mod_type}
+ --enable-ldap=${mod_type}
+ )
MY_MODS+=( ldap authnz_ldap )
else
MY_CONF+=( --disable-authnz_ldap --disable-ldap )
@@ -413,6 +460,10 @@ apache-2_pkg_setup() {
fi
elog
fi
+
+ if [[ "${EAPI}" -ge 7 ]] && use apache2_modules_lua ; then
+ lua-single_pkg_setup
+ fi
}
# @FUNCTION: apache-2_src_prepare
diff --git a/eclass/apache-module.eclass b/eclass/apache-module.eclass
index ff97b6c70f3..e192a745427 100644
--- a/eclass/apache-module.eclass
+++ b/eclass/apache-module.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: apache-module.eclass
diff --git a/eclass/aspell-dict-r1.eclass b/eclass/aspell-dict-r1.eclass
index d633d991c5e..b07af61fdf1 100644
--- a/eclass/aspell-dict-r1.eclass
+++ b/eclass/aspell-dict-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: aspell-dict-r1.eclass
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 625abd0e9d1..08c72cd7795 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: autotools.eclass
@@ -54,6 +54,8 @@ inherit libtool
# CONSTANT!
# The latest major unstable and stable version/slot of automake available
# on each arch.
+# Only add unstable version if it is in a different slot than latest stable
+# version.
# List latest unstable version first to boost testing adoption rate because
# most package manager dependency resolver will pick the first suitable
# version.
@@ -65,7 +67,7 @@ inherit libtool
# Do NOT change this variable in your ebuilds!
# If you want to force a newer minor version, you can specify the correct
# WANT value by using a colon: <PV>:<WANT_AUTOMAKE>
-_LATEST_AUTOMAKE=( 1.16.1:1.16 1.15.1:1.15 )
+_LATEST_AUTOMAKE=( 1.16.2-r1:1.16 )
_automake_atom="sys-devel/automake"
_autoconf_atom="sys-devel/autoconf"
@@ -136,6 +138,12 @@ unset _automake_atom _autoconf_atom
# Additional options to pass to automake during
# eautoreconf call.
+# @ECLASS-VARIABLE: AT_NOEAUTOHEADER
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Don't run eautoheader command if set to 'yes'; only used to work around
+# packages that don't want their headers being modified.
+
# @ECLASS-VARIABLE: AT_NOEAUTOMAKE
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -236,7 +244,7 @@ eautoreconf() {
else
eautoconf --force
fi
- eautoheader
+ [[ ${AT_NOEAUTOHEADER} != "yes" ]] && eautoheader
[[ ${AT_NOEAUTOMAKE} != "yes" ]] && FROM_EAUTORECONF="yes" eautomake ${AM_OPTS}
if [[ ${AT_NOELIBTOOLIZE} != "yes" ]] ; then
@@ -357,6 +365,19 @@ eautoconf() {
eqawarn "when it finds this file. See https://bugs.gentoo.org/426262 for details."
fi
+ # Install config.guess and config.sub which are required by many macros
+ # in Autoconf >=2.70.
+ local _gnuconfig
+ case ${EAPI:-0} in
+ 0|1|2|3|4|5|6)
+ _gnuconfig="${EPREFIX}/usr/share/gnuconfig"
+ ;;
+ *)
+ _gnuconfig="${BROOT}/usr/share/gnuconfig"
+ ;;
+ esac
+ cp "${_gnuconfig}"/config.{guess,sub} . || die
+
autotools_run_tool --at-m4flags autoconf "$@"
}
diff --git a/eclass/bash-completion-r1.eclass b/eclass/bash-completion-r1.eclass
index 636371df9d6..70d40a25969 100644
--- a/eclass/bash-completion-r1.eclass
+++ b/eclass/bash-completion-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: bash-completion-r1.eclass
diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass
index 77b9d6ceb20..4bbe6aa3175 100644
--- a/eclass/cdrom.eclass
+++ b/eclass/cdrom.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cdrom.eclass
diff --git a/eclass/common-lisp-3.eclass b/eclass/common-lisp-3.eclass
index 65ad5a58a34..5d5b68e6f10 100644
--- a/eclass/common-lisp-3.eclass
+++ b/eclass/common-lisp-3.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: common-lisp-3.eclass
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index 26706cd74d1..dd3cbe135a3 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cvs.eclass
diff --git a/eclass/db-use.eclass b/eclass/db-use.eclass
index 83ae94799ca..7633425bac3 100644
--- a/eclass/db-use.eclass
+++ b/eclass/db-use.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# This is a common location for functions that aid the use of sys-libs/db
#
diff --git a/eclass/db.eclass b/eclass/db.eclass
index 01c2f9d9f1f..96669c6d893 100644
--- a/eclass/db.eclass
+++ b/eclass/db.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: db.eclass
@@ -23,13 +23,15 @@ db_fix_so() {
cd "${LIB}" || die
# first clean up old symlinks
- find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so' -delete || die
- find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so.[23]' -delete || die
+ local soext=$(get_libname)
+ find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"${soext#.}" -delete || die
+ soext=$(get_libname "[23]")
+ find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"${soext#.}" -delete || die
find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die
# now rebuild all the correct ones
local ext
- for ext in so a; do
+ for ext in so dylib a; do
for name in libdb libdb_{cxx,tcl,java,sql,stl}; do
target="$(find . -maxdepth 1 -type f -name "${name}-*.${ext}" |sort -V |tail -n 1)"
[[ -n "${target}" ]] && ln -sf ${target//.\//} ${name}.${ext}
@@ -37,17 +39,17 @@ db_fix_so() {
done;
# db[23] gets some extra-special stuff
- if [[ -f libdb1.so.2 ]]; then
- ln -sf libdb1.so.2 libdb.so.2
- ln -sf libdb1.so.2 libdb1.so
- ln -sf libdb1.so.2 libdb-1.so
+ if [[ -f libdb1$(get_libname 2) ]]; then
+ ln -sf libdb1$(get_libname 2) libdb$(get_libname 2)
+ ln -sf libdb1$(get_libname 2) libdb1$(get_libname)
+ ln -sf libdb1$(get_libname 2) libdb-1$(get_libname)
fi
# what do we do if we ever get 3.3 ?
local i
for i in libdb libdb_{cxx,tcl,java,sql,stl}; do
- if [[ -f ${i}-3.2.so ]]; then
- ln -sf ${i}-3.2.so ${i}-3.so
- ln -sf ${i}-3.2.so ${i}.so.3
+ if [[ -f $i-3.2$(get_libname) ]]; then
+ ln -sf $i-3.2$(get_libname) $i-3$(get_libname)
+ ln -sf $i-3.2$(get_libname) $i$(get_libname 3)
fi
done
@@ -143,8 +145,10 @@ db_src_install_usrlibcleanup() {
mv "${LIB}/libdb_cxx.a" "${LIB}/libdb_cxx-${SLOT}.a" || die
fi
- find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so' -delete || die
- find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so.[23]' -delete || die
+ local soext=$(get_libname)
+ find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"${soext#.}" -delete || die
+ soext=$(get_libname "[23]")
+ find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"${soext#.}" -delete || die
einfo "removing unversioned static archives"
find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die
diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass
new file mode 100644
index 00000000000..9ab65b097b3
--- /dev/null
+++ b/eclass/dist-kernel-utils.eclass
@@ -0,0 +1,161 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: dist-kernel-utils.eclass
+# @MAINTAINER:
+# Distribution Kernel Project <dist-kernel@gentoo.org>
+# @AUTHOR:
+# Michał Górny <mgorny@gentoo.org>
+# @SUPPORTED_EAPIS: 7
+# @BLURB: Utility functions related to Distribution Kernels
+# @DESCRIPTION:
+# This eclass provides various utility functions related to Distribution
+# Kernels.
+
+if [[ ! ${_DIST_KERNEL_UTILS} ]]; then
+
+case "${EAPI:-0}" in
+ 0|1|2|3|4|5|6)
+ die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
+ ;;
+ 7)
+ ;;
+ *)
+ die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
+ ;;
+esac
+
+# @FUNCTION: dist-kernel_build_initramfs
+# @USAGE: <output> <version>
+# @DESCRIPTION:
+# Build an initramfs for the kernel. <output> specifies the absolute
+# path where initramfs will be created, while <version> specifies
+# the kernel version, used to find modules.
+#
+# Note: while this function uses dracut at the moment, other initramfs
+# variants may be supported in the future.
+dist-kernel_build_initramfs() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments"
+ local output=${1}
+ local version=${2}
+
+ local rel_image_path=$(dist-kernel_get_image_path)
+ local image=${output%/*}/${rel_image_path##*/}
+
+ local args=(
+ --force
+ # if uefi=yes is used, dracut needs to locate the kernel image
+ --kernel-image "${image}"
+
+ # positional arguments
+ "${output}" "${version}"
+ )
+
+ ebegin "Building initramfs via dracut"
+ dracut "${args[@]}"
+ eend ${?} || die -n "Building initramfs failed"
+}
+
+# @FUNCTION: dist-kernel_get_image_path
+# @DESCRIPTION:
+# Get relative kernel image path specific to the current ${ARCH}.
+dist-kernel_get_image_path() {
+ case ${ARCH} in
+ amd64|x86)
+ echo arch/x86/boot/bzImage
+ ;;
+ arm64)
+ echo arch/arm64/boot/Image.gz
+ ;;
+ arm)
+ echo arch/arm/boot/zImage
+ ;;
+ ppc64)
+ # ./ is required because of ${image_path%/*}
+ # substitutions in the code
+ echo ./vmlinux
+ ;;
+ *)
+ die "${FUNCNAME}: unsupported ARCH=${ARCH}"
+ ;;
+ esac
+}
+
+# @FUNCTION: dist-kernel_install_kernel
+# @USAGE: <version> <image> <system.map>
+# @DESCRIPTION:
+# Install kernel using installkernel tool. <version> specifies
+# the kernel version, <image> full path to the image, <system.map>
+# full path to System.map.
+dist-kernel_install_kernel() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments"
+ local version=${1}
+ local image=${2}
+ local map=${3}
+
+ # if dracut is used in uefi=yes mode, initrd will actually
+ # be a combined kernel+initramfs UEFI executable. we can easily
+ # recognize it by PE magic (vs cpio for a regular initramfs)
+ local initrd=${image%/*}/initrd
+ local magic
+ [[ -s ${initrd} ]] && read -n 2 magic < "${initrd}"
+ if [[ ${magic} == MZ ]]; then
+ einfo "Combined UEFI kernel+initramfs executable found"
+ # install the combined executable in place of kernel
+ image=${initrd}.uefi
+ mv "${initrd}" "${image}" || die
+ # put an empty file in place of initrd. installing a duplicate
+ # file would waste disk space, and removing it entirely provokes
+ # kernel-install to regenerate it via dracut.
+ > "${initrd}"
+ fi
+
+ ebegin "Installing the kernel via installkernel"
+ # note: .config is taken relatively to System.map;
+ # initrd relatively to bzImage
+ installkernel "${version}" "${image}" "${map}"
+ eend ${?} || die -n "Installing the kernel failed"
+}
+
+# @FUNCTION: dist-kernel_reinstall_initramfs
+# @USAGE: <kv-dir> <kv-full>
+# @DESCRIPTION:
+# Rebuild and install initramfs for the specified dist-kernel.
+# <kv-dir> is the kernel source directory (${KV_DIR} from linux-info),
+# while <kv-full> is the full kernel version (${KV_FULL}).
+# The function will determine whether <kernel-dir> is actually
+# a dist-kernel, and whether initramfs was used.
+#
+# This function is to be used in pkg_postinst() of ebuilds installing
+# kernel modules that are included in the initramfs.
+dist-kernel_reinstall_initramfs() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments"
+ local kernel_dir=${1}
+ local ver=${2}
+
+ local image_path=${kernel_dir}/$(dist-kernel_get_image_path)
+ local initramfs_path=${image_path%/*}/initrd
+ if [[ ! -f ${image_path} ]]; then
+ eerror "Kernel install missing, image not found:"
+ eerror " ${image_path}"
+ eerror "Initramfs will not be updated. Please reinstall your kernel."
+ return
+ fi
+ if [[ ! -f ${initramfs_path} ]]; then
+ einfo "No initramfs found at ${initramfs_path}"
+ return
+ fi
+
+ dist-kernel_build_initramfs "${initramfs_path}" "${ver}"
+ dist-kernel_install_kernel "${ver}" "${image_path}" \
+ "${kernel_dir}/System.map"
+}
+
+_DIST_KERNEL_UTILS=1
+fi
diff --git a/eclass/docs.eclass b/eclass/docs.eclass
new file mode 100644
index 00000000000..adacae4abda
--- /dev/null
+++ b/eclass/docs.eclass
@@ -0,0 +1,336 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: docs.eclass
+# @MAINTAINER:
+# Andrew Ammerlaan <andrewammerlaan@riseup.net>
+# @AUTHOR:
+# Author: Andrew Ammerlaan <andrewammerlaan@riseup.net>
+# Based on the work of: Michał Górny <mgorny@gentoo.org>
+# @SUPPORTED_EAPIS: 6 7
+# @BLURB: A simple eclass to build documentation.
+# @DESCRIPTION:
+# A simple eclass providing functions to build documentation.
+#
+# Please note that docs sets RDEPEND and DEPEND unconditionally
+# for you.
+#
+# This eclass also appends "doc" to IUSE, and sets HTML_DOCS
+# to the location of the compiled documentation
+#
+# The aim of this eclass is to make it easy to add additional
+# doc builders. To do this, add a <DOCS_BUILDER>-deps and
+# <DOCS_BUILDER>-build function for your doc builder.
+# For python based doc builders you can use the
+# python_append_deps function to append [${PYTHON_USEDEP}]
+# automatically to additional dependencies.
+
+case "${EAPI:-0}" in
+ 0|1|2|3|4|5)
+ die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
+ ;;
+ 6|7)
+ ;;
+ *)
+ die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
+ ;;
+esac
+
+# @ECLASS-VARIABLE: DOCS_BUILDER
+# @REQUIRED
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Sets the doc builder to use, currently supports
+# sphinx, mkdocs and doxygen.
+# PYTHON_COMPAT should be set for python based
+# doc builders: sphinx and mkdocs
+
+# @ECLASS-VARIABLE: DOCS_DIR
+# @DESCRIPTION:
+# Path containing the doc builder config file(s).
+#
+# For sphinx this is the location of "conf.py"
+# For mkdocs this is the location of "mkdocs.yml"
+#
+# Note that mkdocs.yml often does not reside
+# in the same directory as the actual doc files
+#
+# Defaults to ${S}
+
+# @ECLASS-VARIABLE: DOCS_DEPEND
+# @DEFAULT_UNSET
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Sets additional dependencies to build docs.
+# For sphinx and mkdocs these dependencies should
+# be specified without [${PYTHON_USEDEP}], this
+# is added by the eclass. E.g. to depend on mkdocs-material:
+#
+# DOCS_DEPEND="dev-python/mkdocs-material"
+#
+# This eclass appends to this variable, so you can
+# call it later in your ebuild again if necessary.
+
+# @ECLASS-VARIABLE: DOCS_AUTODOC
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Sets whether to use sphinx.ext.autodoc/mkautodoc
+# Defaults to 1 (True) for sphinx, and 0 (False) for mkdocs
+
+# @ECLASS-VARIABLE: DOCS_OUTDIR
+# @DESCRIPTION:
+# Sets where the compiled files will be put.
+# There's no real reason to change this, but this
+# variable is useful if you want to overwrite the HTML_DOCS
+# added by this eclass. E.g.:
+#
+# HTML_DOCS=( "${yourdocs}" "${DOCS_OUTDIR}/." )
+#
+# Defaults to ${S}/_build/html
+
+# @ECLASS-VARIABLE: DOCS_CONFIG_NAME
+# @DESCRIPTION:
+# Name of the doc builder config file.
+#
+# Only relevant for doxygen, as it allows
+# config files with non-standard names
+#
+# Defaults to Doxyfile for doxygen
+
+if [[ ! ${_DOCS} ]]; then
+
+# For the python based DOCS_BUILDERS we need to inherit python-any-r1
+case ${DOCS_BUILDER} in
+ "sphinx"|"mkdocs")
+ # We need the python_gen_any_dep function
+ if [[ ! ${_PYTHON_R1} && ! ${_PYTHON_ANY_R1} ]]; then
+ die "python-r1 or python-any-r1 needs to be inherited as well to use python based documentation builders"
+ fi
+ ;;
+ "doxygen")
+ # do not need to inherit anything for doxygen
+ ;;
+ "")
+ die "DOCS_BUILDER unset, should be set to use ${ECLASS}"
+ ;;
+ *)
+ die "Unsupported DOCS_BUILDER=${DOCS_BUILDER} (unknown) for ${ECLASS}"
+ ;;
+esac
+
+# @FUNCTION: python_append_dep
+# @DESCRIPTION:
+# Appends [\${PYTHON_USEDEP}] to all dependencies
+# for python based DOCS_BUILDERs such as mkdocs or
+# sphinx.
+python_append_deps() {
+ debug-print-function ${FUNCNAME}
+
+ local temp
+ local dep
+ for dep in ${DOCS_DEPEND[@]}; do
+ temp+=" ${dep}[\${PYTHON_USEDEP}]"
+ done
+ DOCS_DEPEND=${temp}
+}
+
+# @FUNCTION: sphinx_deps
+# @DESCRIPTION:
+# Sets dependencies for sphinx
+sphinx_deps() {
+ debug-print-function ${FUNCNAME}
+
+ : ${DOCS_AUTODOC:=1}
+
+ if [[ ${DOCS_AUTODOC} == 0 ]]; then
+ if [[ -n "${DOCS_DEPEND}" ]]; then
+ die "${FUNCNAME}: do not set DOCS_AUTODOC to 0 if external plugins are used"
+ else
+ DOCS_DEPEND="$(python_gen_any_dep "
+ dev-python/sphinx[\${PYTHON_USEDEP}]")"
+ fi
+ elif [[ ${DOCS_AUTODOC} == 1 ]]; then
+ DOCS_DEPEND="$(python_gen_any_dep "
+ dev-python/sphinx[\${PYTHON_USEDEP}]
+ ${DOCS_DEPEND}")"
+ else
+ die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1"
+ fi
+}
+
+# @FUNCTION: sphinx_compile
+# @DESCRIPTION:
+# Calls sphinx to build docs.
+#
+# If you overwrite src_compile or python_compile_all
+# do not call this function, call docs_compile instead
+sphinx_compile() {
+ debug-print-function ${FUNCNAME}
+ use doc || return
+
+ local confpy=${DOCS_DIR}/conf.py
+ [[ -f ${confpy} ]] ||
+ die "${FUNCNAME}: ${confpy} not found, DOCS_DIR=${DOCS_DIR} call wrong"
+
+ if [[ ${DOCS_AUTODOC} == 0 ]]; then
+ if grep -F -q 'sphinx.ext.autodoc' "${confpy}"; then
+ die "${FUNCNAME}: autodoc disabled but sphinx.ext.autodoc found in ${confpy}"
+ fi
+ elif [[ ${DOCS_AUTODOC} == 1 ]]; then
+ if ! grep -F -q 'sphinx.ext.autodoc' "${confpy}"; then
+ die "${FUNCNAME}: sphinx.ext.autodoc not found in ${confpy}, set DOCS_AUTODOC=0"
+ fi
+ fi
+
+ sed -i -e 's:^intersphinx_mapping:disabled_&:' \
+ "${DOCS_DIR}"/conf.py || die
+ # not all packages include the Makefile in pypi tarball
+ sphinx-build -b html -d "${DOCS_OUTDIR}"/_build/doctrees "${DOCS_DIR}" \
+ "${DOCS_OUTDIR}" || die "${FUNCNAME}: sphinx-build failed"
+}
+
+# @FUNCTION: mkdocs_deps
+# @DESCRIPTION:
+# Sets dependencies for mkdocs
+mkdocs_deps() {
+ debug-print-function ${FUNCNAME}
+
+ : ${DOCS_AUTODOC:=0}
+
+ if [[ ${DOCS_AUTODOC} == 1 ]]; then
+ DOCS_DEPEND="$(python_gen_any_dep "
+ dev-python/mkdocs[\${PYTHON_USEDEP}]
+ dev-python/mkautodoc[\${PYTHON_USEDEP}]
+ ${DOCS_DEPEND}")"
+ elif [[ ${DOCS_AUTODOC} == 0 ]]; then
+ DOCS_DEPEND="$(python_gen_any_dep "
+ dev-python/mkdocs[\${PYTHON_USEDEP}]
+ ${DOCS_DEPEND}")"
+ else
+ die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1"
+ fi
+}
+
+# @FUNCTION: mkdocs_compile
+# @DESCRIPTION:
+# Calls mkdocs to build docs.
+#
+# If you overwrite src_compile or python_compile_all
+# do not call this function, call docs_compile instead
+mkdocs_compile() {
+ debug-print-function ${FUNCNAME}
+ use doc || return
+
+ local mkdocsyml=${DOCS_DIR}/mkdocs.yml
+ [[ -f ${mkdocsyml} ]] ||
+ die "${FUNCNAME}: ${mkdocsyml} not found, DOCS_DIR=${DOCS_DIR} wrong"
+
+ pushd "${DOCS_DIR}" || die
+ mkdocs build -d "${DOCS_OUTDIR}" || die "${FUNCNAME}: mkdocs build failed"
+ popd || die
+
+ # remove generated .gz variants
+ # mkdocs currently has no option to disable this
+ # and portage complains: "Colliding files found by ecompress"
+ rm "${DOCS_OUTDIR}"/*.gz || die
+}
+
+# @FUNCTION: doxygen_deps
+# @DESCRIPTION:
+# Sets dependencies for doxygen
+doxygen_deps() {
+ debug-print-function ${FUNCNAME}
+
+ DOCS_DEPEND="app-doc/doxygen
+ ${DOCS_DEPEND}"
+}
+
+# @FUNCTION: doxygen_compile
+# @DESCRIPTION:
+# Calls doxygen to build docs.
+#
+# If you overwrite src_compile or python_compile_all
+# do not call this function, call docs_compile instead
+doxygen_compile() {
+ debug-print-function ${FUNCNAME}
+ use doc || return
+
+ : ${DOCS_CONFIG_NAME:="Doxyfile"}
+
+ local doxyfile=${DOCS_DIR}/${DOCS_CONFIG_NAME}
+ [[ -f ${doxyfile} ]] ||
+ die "${FUNCNAME}: ${doxyfile} not found, DOCS_DIR=${DOCS_DIR} or DOCS_CONFIG_NAME=${DOCS_CONFIG_NAME} wrong"
+
+ # doxygen wants the HTML_OUTPUT dir to already exist
+ mkdir -p "${DOCS_OUTDIR}" || die
+
+ pushd "${DOCS_DIR}" || die
+ (cat "${DOCS_CONFIG_NAME}" ; echo "HTML_OUTPUT=${DOCS_OUTDIR}") | doxygen - || die "${FUNCNAME}: doxygen failed"
+ popd || die
+}
+
+# @FUNCTION: docs_compile
+# @DESCRIPTION:
+# Calls DOCS_BUILDER and sets HTML_DOCS
+#
+# This function must be called in global scope. Take care not to
+# overwrite the variables set by it. Has support for distutils-r1
+# eclass, but only if this eclass is inherited *after*
+# distutils-r1. If you need to extend src_compile() or
+# python_compile_all(), you can call the original implementation
+# as docs_compile.
+docs_compile() {
+ debug-print-function ${FUNCNAME}
+ use doc || return
+
+ # Set a sensible default as DOCS_DIR
+ : ${DOCS_DIR:="${S}"}
+
+ # Where to put the compiled files?
+ : ${DOCS_OUTDIR:="${S}/_build/html"}
+
+ ${DOCS_BUILDER}_compile
+
+ HTML_DOCS+=( "${DOCS_OUTDIR}/." )
+
+ # we need to ensure successful return in case we're called last,
+ # otherwise Portage may wrongly assume sourcing failed
+ return 0
+}
+
+
+# This is where we setup the USE/(B)DEPEND variables
+# and call the doc builder specific setup functions
+IUSE+=" doc"
+
+# Call the correct setup function
+case ${DOCS_BUILDER} in
+ "sphinx")
+ python_append_deps
+ sphinx_deps
+ ;;
+ "mkdocs")
+ python_append_deps
+ mkdocs_deps
+ ;;
+ "doxygen")
+ doxygen_deps
+ ;;
+esac
+
+if [[ ${EAPI} == [7] ]]; then
+ BDEPEND+=" doc? ( ${DOCS_DEPEND} )"
+else
+ DEPEND+=" doc? ( ${DOCS_DEPEND} )"
+fi
+
+# If this is a python package using distutils-r1
+# then put the compile function in the specific
+# python function, else docs_compile should be manually
+# added to src_compile
+if [[ ${_DISTUTILS_R1} && ( ${DOCS_BUILDER}="mkdocs" || ${DOCS_BUILDER}="sphinx" ) ]]; then
+ python_compile_all() { docs_compile; }
+fi
+
+_DOCS=1
+fi
diff --git a/eclass/dotnet.eclass b/eclass/dotnet.eclass
index 55e10645deb..ae861daf6e7 100644
--- a/eclass/dotnet.eclass
+++ b/eclass/dotnet.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: dotnet.eclass
diff --git a/eclass/dune.eclass b/eclass/dune.eclass
index 334fbfbf791..da1813def53 100644
--- a/eclass/dune.eclass
+++ b/eclass/dune.eclass
@@ -23,6 +23,9 @@ case ${EAPI:-0} in
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
+# Do not complain about CFLAGS etc since ml projects do not use them.
+QA_FLAGS_IGNORED='.*'
+
EXPORT_FUNCTIONS src_compile src_test src_install
RDEPEND=">=dev-lang/ocaml-4:=[ocamlopt?]"
diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass
index 8d358a91f98..c763957bf89 100644
--- a/eclass/ecm.eclass
+++ b/eclass/ecm.eclass
@@ -19,13 +19,6 @@
#
# This eclass's phase functions are not intended to be mixed and matched, so if
# any phase functions are overridden the version here should also be called.
-#
-# Porting from kde5.class
-# - Convert all add_*_dep dependency functions to regular dependencies
-# - Manually set LICENSE
-# - Manually set SLOT
-# - Rename vars and function names as needed, see kde5.eclass PORTING comments
-# - Instead of FRAMEWORKS_MINIMAL, define KFMIN in ebuilds and use it for deps
if [[ -z ${_ECM_ECLASS} ]]; then
_ECM_ECLASS=1
@@ -267,24 +260,6 @@ DEPEND+=" ${COMMONDEPEND}"
RDEPEND+=" ${COMMONDEPEND}"
unset COMMONDEPEND
-# @FUNCTION: _ecm_banned_var
-# @INTERNAL
-# @DESCRIPTION:
-# Banned kde5*.eclass variables are banned.
-_ecm_banned_var() {
- die "$1 is banned. use $2 instead."
-}
-
-if [[ -z ${_KDE5_ECLASS} ]] ; then
- [[ -n ${KDE_DEBUG} ]] && _ecm_banned_var KDE_DEBUG ECM_DEBUG
- [[ -n ${KDE_EXAMPLES} ]] && _ecm_banned_var KDE_EXAMPLES ECM_EXAMPLES
- [[ -n ${KDE_HANDBOOK} ]] && _ecm_banned_var KDE_HANDBOOK ECM_HANDBOOK
- [[ -n ${KDE_DOC_DIR} ]] && _ecm_banned_var KDE_DOC_DIR ECM_HANDBOOK_DIR
- [[ -n ${KDE_PO_DIRS} ]] && _ecm_banned_var KDE_PO_DIRS ECM_PO_DIRS
- [[ -n ${KDE_QTHELP} ]] && _ecm_banned_var KDE_QTHELP ECM_QTHELP
- [[ -n ${KDE_TEST} ]] && _ecm_banned_var KDE_TEST ECM_TEST
-fi
-
# @ECLASS-VARIABLE: KDE_GCC_MINIMAL
# @DEFAULT_UNSET
# @DESCRIPTION:
diff --git a/eclass/estack.eclass b/eclass/estack.eclass
index 3f444ee3b70..c0823adb03f 100644
--- a/eclass/estack.eclass
+++ b/eclass/estack.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: estack.eclass
diff --git a/eclass/fdo-mime.eclass b/eclass/fdo-mime.eclass
deleted file mode 100644
index 3aa45919b37..00000000000
--- a/eclass/fdo-mime.eclass
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @DEAD
-# No consumers left. Removal in 30 days.
-
-# @ECLASS: fdo-mime.eclass
-# @MAINTAINER:
-# freedesktop-bugs@gentoo.org
-# @AUTHOR:
-# Original author: foser <foser@gentoo.org>
-# @BLURB: Utility eclass to update the desktop mime info as laid out in the freedesktop specs & implementations
-# @DEPRECATED: xdg-utils
-# @DESCRIPTION:
-# This eclass is DEPRECATED. Please use xdg-utils or xdg instead.
-
-# @FUNCTION: fdo-mime_desktop_database_update
-# @DESCRIPTION:
-# Updates the desktop database.
-# Generates a list of mimetypes linked to applications that can handle them
-fdo-mime_desktop_database_update() {
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
- if [ -x "${EPREFIX}/usr/bin/update-desktop-database" ]
- then
- einfo "Updating desktop mime database ..."
- "${EPREFIX}/usr/bin/update-desktop-database" -q "${EROOT}usr/share/applications"
- fi
-}
-
-# @FUNCTION: fdo-mime_mime_database_update
-# @DESCRIPTION:
-# Update the mime database.
-# Creates a general list of mime types from several sources
-fdo-mime_mime_database_update() {
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
- if [ -x "${EPREFIX}/usr/bin/update-mime-database" ]
- then
- einfo "Updating shared mime info database ..."
- "${EPREFIX}/usr/bin/update-mime-database" "${EROOT}usr/share/mime"
- fi
-}
diff --git a/eclass/findlib.eclass b/eclass/findlib.eclass
index 3a165cfb4b4..8090d6ce5c2 100644
--- a/eclass/findlib.eclass
+++ b/eclass/findlib.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: findlib.eclass
@@ -10,7 +10,8 @@
# @DESCRIPTION:
# ocamlfind (a.k.a. findlib) eclass
-
+# Do not complain about CFLAGS etc since ml projects do not use them.
+QA_FLAGS_IGNORED='.*'
# From this findlib version there is proper stublibs support.
DEPEND=">=dev-ml/findlib-1.0.4-r1"
diff --git a/eclass/font-ebdftopcf.eclass b/eclass/font-ebdftopcf.eclass
index c36cd14256f..29568e56013 100644
--- a/eclass/font-ebdftopcf.eclass
+++ b/eclass/font-ebdftopcf.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Author: Robin H. Johnson <robbat2@gentoo.org>
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 06643db0f60..8513de0af4d 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -4,7 +4,7 @@
# @ECLASS: gnome2-utils.eclass
# @MAINTAINER:
# gnome@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: Auxiliary functions commonly used by Gnome packages.
# @DESCRIPTION:
# This eclass provides a set of auxiliary functions needed by most Gnome
@@ -14,13 +14,14 @@
# * GConf schemas management
# * scrollkeeper (old Gnome help system) management
-[[ ${EAPI:-0} == [012345] ]] && inherit multilib
+[[ ${EAPI} == 5 ]] && inherit multilib
# eutils.eclass: emktemp
+# toolchain-funs.eclass: tc-is-cross-compiler
# xdg-utils.eclass: xdg_environment_reset, xdg_icon_cache_update
-inherit eutils xdg-utils
+inherit eutils toolchain-funcs xdg-utils
-case "${EAPI:-0}" in
- 0|1|2|3|4|5|6|7) ;;
+case ${EAPI} in
+ 5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
@@ -95,7 +96,7 @@ gnome2_environment_reset() {
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
- if has ${EAPI:-0} 6 7; then
+ if has ${EAPI} 6 7; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
@@ -110,7 +111,6 @@ gnome2_environment_reset() {
# in the GNOME2_ECLASS_SCHEMAS environment variable.
# This function should be called from pkg_preinst.
gnome2_gconf_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null)
popd > /dev/null || die
@@ -122,16 +122,23 @@ gnome2_gconf_savelist() {
# using gconftool-2.
# This function should be called from pkg_postinst.
gnome2_gconf_install() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
- if [[ ! -x "${updater}" ]]; then
- debug-print "${updater} is not executable"
+ if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
+ debug-print "No GNOME 2 GConf schemas found"
return
fi
- if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
- debug-print "No GNOME 2 GConf schemas found"
+ if tc-is-cross-compiler ; then
+ ewarn "Updating of GNOME 2 GConf schemas skipped due to cross-compilation."
+ ewarn "You might want to run gconftool-2 manually on the target for"
+ ewarn "your final image and re-run it when packages installing"
+ ewarn "GNOME 2 GConf schemas get upgraded or added to the image."
+ return
+ fi
+
+ if [[ ! -x "${updater}" ]]; then
+ debug-print "${updater} is not executable"
return
fi
@@ -163,16 +170,22 @@ gnome2_gconf_install() {
# Removes schema files previously installed by the current ebuild from Gconf's
# database.
gnome2_gconf_uninstall() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
- if [[ ! -x "${updater}" ]]; then
- debug-print "${updater} is not executable"
+ if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
+ debug-print "No GNOME 2 GConf schemas found"
return
fi
- if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
- debug-print "No GNOME 2 GConf schemas found"
+ if tc-is-cross-compiler ; then
+ ewarn "Removal of GNOME 2 GConf schemas skipped due to cross-compilation."
+ ewarn "You might want to run gconftool-2 manually on the target for"
+ ewarn "your final image to uninstall this package's schemas."
+ return
+ fi
+
+ if [[ ! -x "${updater}" ]]; then
+ debug-print "${updater} is not executable"
return
fi
@@ -255,7 +268,6 @@ gnome2_omf_fix() {
# in the GNOME2_ECLASS_SCROLLS environment variable.
# This function should be called from pkg_preinst.
gnome2_scrollkeeper_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name "*.omf" 2> /dev/null)
popd > /dev/null || die
@@ -266,16 +278,23 @@ gnome2_scrollkeeper_savelist() {
# Updates the global scrollkeeper database.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_scrollkeeper_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
- if [[ ! -x "${updater}" ]] ; then
- debug-print "${updater} is not executable"
+ if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
+ debug-print "No scroll cache to update"
return
fi
- if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
- debug-print "No scroll cache to update"
+ if tc-is-cross-compiler ; then
+ ewarn "Updating of scrollkeeper database skipped due to cross-compilation."
+ ewarn "You might want to run scrollkeeper-update manually on the target"
+ ewarn "for your final image and re-run it when packages installing"
+ ewarn "scrollkeeper OMF files get upgraded or added to the image."
+ return
+ fi
+
+ if [[ ! -x "${updater}" ]] ; then
+ debug-print "${updater} is not executable"
return
fi
@@ -291,7 +310,6 @@ gnome2_scrollkeeper_update() {
# implementations that call gnome2_schemas_update conditionally.
# This function should be called from pkg_preinst.
gnome2_schemas_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null)
popd > /dev/null || die
@@ -302,9 +320,16 @@ gnome2_schemas_savelist() {
# Updates GSettings schemas.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_schemas_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
+ if tc-is-cross-compiler ; then
+ ewarn "Updating of GSettings schemas skipped due to cross-compilation."
+ ewarn "You might want to run glib-compile-schemas manually on the target"
+ ewarn "for your final image and re-run it when packages installing"
+ ewarn "GSettings schemas get upgraded or added to the image."
+ return
+ fi
+
if [[ ! -x ${updater} ]]; then
debug-print "${updater} is not executable"
return
@@ -321,7 +346,6 @@ gnome2_schemas_update() {
# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
# This function should be called from pkg_preinst.
gnome2_gdk_pixbuf_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find usr/lib*/gdk-pixbuf-2.0 -type f 2>/dev/null)
popd > /dev/null || die
@@ -332,20 +356,24 @@ gnome2_gdk_pixbuf_savelist() {
# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_gdk_pixbuf_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
+ [[ -x ${updater} ]] || updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
- if [[ ! -x ${updater} ]]; then
- updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
+ if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
+ debug-print "gdk-pixbuf loader cache does not need an update"
+ return
fi
- if [[ ! -x ${updater} ]]; then
- debug-print "${updater} is not executable"
+ if tc-is-cross-compiler ; then
+ ewarn "Updating of gdk-pixbuf loader cache skipped due to cross-compilation."
+ ewarn "You might want to run gdk-pixbuf-query-loaders manually on the target"
+ ewarn "for your final image and re-run it when packages installing"
+ ewarn "gdk-pixbuf loaders get upgraded or added to the image."
return
fi
- if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
- debug-print "gdk-pixbuf loader cache does not need an update"
+ if [[ ! -x ${updater} ]]; then
+ debug-print "${updater} is not executable"
return
fi
@@ -363,7 +391,12 @@ gnome2_gdk_pixbuf_update() {
# Updates gtk2 immodules/gdk-pixbuf loaders listing.
gnome2_query_immodules_gtk2() {
local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-2.0
- [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
+ [[ -x ${updater} ]] || updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
+
+ if [[ ! -x ${updater} ]]; then
+ debug-print "${updater} is not executable"
+ return
+ fi
ebegin "Updating gtk2 input method module cache"
GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
@@ -376,7 +409,12 @@ gnome2_query_immodules_gtk2() {
# Updates gtk3 immodules/gdk-pixbuf loaders listing.
gnome2_query_immodules_gtk3() {
local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-3.0
- [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
+ [[ -x ${updater} ]] || updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
+
+ if [[ ! -x ${updater} ]]; then
+ debug-print "${updater} is not executable"
+ return
+ fi
ebegin "Updating gtk3 input method module cache"
GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
@@ -389,11 +427,15 @@ gnome2_query_immodules_gtk3() {
# Updates glib's gio modules cache.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_giomodule_cache_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
+ [[ -x ${updater} ]] || updater="${EROOT%/}/usr/bin/gio-querymodules"
- if [[ ! -x ${updater} ]]; then
- updater="${EROOT%/}/usr/bin/gio-querymodules"
+ if tc-is-cross-compiler ; then
+ ewarn "Updating of GIO modules cache skipped due to cross-compilation."
+ ewarn "You might want to run gio-querymodules manually on the target for"
+ ewarn "your final image for performance reasons and re-run it when packages"
+ ewarn "installing GIO modules get upgraded or added to the image."
+ return
fi
if [[ ! -x ${updater} ]]; then
@@ -446,8 +488,8 @@ gnome2_disable_deprecation_warning() {
done
}
-case ${EAPI:-0} in
-0|1|2|3|4|5|6)
+case ${EAPI} in
+5|6)
# @FUNCTION: gnome2_icon_savelist
# @DESCRIPTION:
@@ -457,7 +499,6 @@ case ${EAPI:-0} in
# gnome2_icon_cache_update conditionally.
# This function should be called from pkg_preinst.
gnome2_icon_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
popd > /dev/null || die
diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 1a4ff451df3..27ea9f96c0d 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -4,7 +4,7 @@
# @ECLASS: gnome2.eclass
# @MAINTAINER:
# gnome@gentoo.org
-# @SUPPORTED_EAPIS: 4 5 6
+# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: Provides phases for Gnome/Gtk+ based packages.
# @DESCRIPTION:
# Exports portage base functions used by ebuilds written for packages using the
@@ -17,25 +17,19 @@
GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
[[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
-inherit eutils libtool ltprune gnome.org gnome2-utils xdg
+[[ ${EAPI} == [56] ]] && inherit eutils ltprune
+inherit libtool gnome.org gnome2-utils xdg
-case "${EAPI:-0}" in
- 4|5)
+case ${EAPI:-0} in
+ 5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
- 6)
+ 6|7)
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
-# @ECLASS-VARIABLE: DOCS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# String containing documents passed to dodoc command for eapi4.
-# In eapi5 we rely on einstalldocs (from eutils.eclass) and for newer EAPIs we
-# follow PMS spec.
-
# @ECLASS-VARIABLE: ELTCONF
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -48,7 +42,7 @@ ELTCONF=${ELTCONF:-""}
# Extra configure opts passed to econf.
# Deprecated, pass extra arguments to gnome2_src_configure.
# Banned in eapi6 and newer.
-if has ${EAPI:-0} 4 5; then
+if has ${EAPI} 5; then
G2CONF=${G2CONF:-""}
fi
@@ -64,7 +58,7 @@ fi
#
# Banned since eapi6 as upstream is moving away from this obsolete macro in favor
# of autoconf-archive macros, that do not expose this issue (bug #270919)
-if has ${EAPI:-0} 4 5; then
+if has ${EAPI} 5; then
if [[ ${GCONF_DEBUG} != "no" ]]; then
IUSE="debug"
fi
@@ -77,27 +71,22 @@ fi
# @ECLASS-VARIABLE: GNOME2_LA_PUNT
# @DESCRIPTION:
-# For eapi4 it sets if we should delete ALL or none of the .la files
-# For eapi5 and newer it relies on prune_libtool_files (from eutils.eclass)
-# for this. Available values for GNOME2_LA_PUNT:
+# In EAPIs 5 and 6, it relies on prune_libtool_files (from ltprune.eclass) for
+# this. Later EAPIs use find ... -delete. Available values for GNOME2_LA_PUNT:
# - "no": will not clean any .la files
# - "yes": will run prune_libtool_files --modules
# - If it is not set, it will run prune_libtool_files
-if has ${EAPI:-0} 4; then
- GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
-else
- GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
-fi
+GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
# @FUNCTION: gnome2_src_unpack
# @DESCRIPTION:
# Stub function for old EAPI.
gnome2_src_unpack() {
- if has ${EAPI:-0} 4 5; then
+ if has ${EAPI} 5; then
unpack ${A}
cd "${S}"
else
- die "gnome2_src_unpack is banned from eapi6"
+ die "gnome2_src_unpack is banned since eapi6"
fi
}
@@ -115,7 +104,7 @@ gnome2_src_prepare() {
# We stop to run it from eapi6 as scrollkeeper helpers from
# rarian are not running anything and, then, access violations
# shouldn't occur.
- has ${EAPI:-0} 4 5 && gnome2_omf_fix
+ has ${EAPI} 5 && gnome2_omf_fix
# Disable all deprecation warnings
gnome2_disable_deprecation_warning
@@ -135,7 +124,7 @@ gnome2_src_prepare() {
gnome2_src_configure() {
# Deprecated for a long time now and banned since eapi6, see Gnome team policies
if [[ -n ${G2CONF} ]] ; then
- if has ${EAPI:-0} 4 5; then
+ if has ${EAPI} 5; then
eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
else
die "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
@@ -144,7 +133,7 @@ gnome2_src_configure() {
local g2conf=()
- if has ${EAPI:-0} 4 5; then
+ if has ${EAPI} 5; then
if [[ ${GCONF_DEBUG} != 'no' ]] ; then
if use debug ; then
g2conf+=( --enable-debug=yes )
@@ -156,19 +145,14 @@ gnome2_src_configure() {
fi
fi
- # Starting with EAPI=5, we consider packages installing gtk-doc to be
- # handled by adding DEPEND="dev-util/gtk-doc-am" which provides tools to
- # relink URLs in documentation to already installed documentation.
- # This decision also greatly helps with constantly broken doc generation.
+ # We consider packages installing gtk-doc to be handled by adding
+ # DEPEND="dev-util/gtk-doc-am" which provides tools to relink URLs in
+ # documentation to already installed documentation. This decision also
+ # greatly helps with constantly broken doc generation.
# Remember to drop 'doc' USE flag from your package if it was only used to
# rebuild docs.
- # Preserve old behavior for older EAPI.
if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
- if has ${EAPI:-0} 4 && in_iuse doc ; then
- g2conf+=( $(use_enable doc gtk-doc) )
- else
- g2conf+=( --disable-gtk-doc )
- fi
+ g2conf+=( --disable-gtk-doc )
fi
# Pass --disable-maintainer-mode when needed
@@ -182,13 +166,6 @@ gnome2_src_configure() {
g2conf+=( --disable-scrollkeeper )
fi
- # Pass --disable-silent-rules when possible (not needed since eapi5), bug #429308
- if has ${EAPI:-0} 4; then
- if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
- g2conf+=( --disable-silent-rules )
- fi
- fi
-
# Pass --disable-schemas-install when possible
if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --disable-schemas-install )
@@ -210,20 +187,20 @@ gnome2_src_configure() {
fi
# Pass --docdir with proper directory, bug #482646 (not needed since eapi6)
- if has ${EAPI:-0} 4 5; then
+ if has ${EAPI} 5; then
if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
fi
fi
# Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
- if has ${EAPI:-0} 4 5; then
+ if has ${EAPI} 5; then
addwrite "$(unset HOME; echo ~)/.gnome2"
else
addpredict "$(unset HOME; echo ~)/.gnome2"
fi
- if has ${EAPI:-0} 4 5; then
+ if has ${EAPI} 5; then
econf ${g2conf[@]} ${G2CONF} "$@"
else
econf ${g2conf[@]} "$@"
@@ -234,7 +211,7 @@ gnome2_src_configure() {
# @DESCRIPTION:
# Only default src_compile for now
gnome2_src_compile() {
- if has ${EAPI:-0} 4 5; then
+ if has ${EAPI} 5; then
emake
else
default
@@ -255,7 +232,7 @@ gnome2_src_install() {
#
# if this is not present, scrollkeeper-update may segfault and
# create bogus directories in /var/lib/
- if has ${EAPI:-0} 4 5; then
+ if has ${EAPI} 5; then
dodir "${sk_tmp_dir}" || die "dodir failed"
emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
else
@@ -267,12 +244,7 @@ gnome2_src_install() {
# Handle documentation as 'default' for eapi5, bug #373131
# Since eapi6 this is handled by default on its own plus MAINTAINERS and HACKING
# files that are really common in gnome packages (bug #573390)
- if has ${EAPI:-0} 4; then
- # Manual document installation
- if [[ -n "${DOCS}" ]]; then
- dodoc ${DOCS} || die "dodoc failed"
- fi
- elif has ${EAPI:-0} 5; then
+ if has ${EAPI} 5; then
einstalldocs
else
local d
@@ -293,20 +265,16 @@ gnome2_src_install() {
rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
# Delete all .la files
- if has ${EAPI:-0} 4; then
- if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then
- ebegin "Removing .la files"
- if ! in_iuse static-libs || ! use static-libs ; then
- find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
- fi
- eend
- fi
- else
+ if has ${EAPI} 5 6; then
case "${GNOME2_LA_PUNT}" in
yes) prune_libtool_files --modules;;
no) ;;
*) prune_libtool_files;;
esac
+ else
+ if [[ ${GNOME2_LA_PUNT} != 'no' ]]; then
+ find "${ED}" -name '*.la' -delete || die
+ fi
fi
}
diff --git a/eclass/gnustep-2.eclass b/eclass/gnustep-2.eclass
index ddb1c29660d..d1acdc1dd4b 100644
--- a/eclass/gnustep-2.eclass
+++ b/eclass/gnustep-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnustep-2.eclass
diff --git a/eclass/golang-base.eclass b/eclass/golang-base.eclass
index cd36a269bf1..45603d76fd5 100644
--- a/eclass/golang-base.eclass
+++ b/eclass/golang-base.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: golang-base.eclass
diff --git a/eclass/golang-build.eclass b/eclass/golang-build.eclass
index c76a1865a48..d106a30eb58 100644
--- a/eclass/golang-build.eclass
+++ b/eclass/golang-build.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: golang-build.eclass
diff --git a/eclass/golang-vcs-snapshot.eclass b/eclass/golang-vcs-snapshot.eclass
index 3a35d7e1aa5..306db1f26c9 100644
--- a/eclass/golang-vcs-snapshot.eclass
+++ b/eclass/golang-vcs-snapshot.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: golang-vcs-snapshot.eclass
diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass
index 2fc797e764c..4908e4491e6 100644
--- a/eclass/haskell-cabal.eclass
+++ b/eclass/haskell-cabal.eclass
@@ -109,15 +109,6 @@ done
if [[ -n "${CABAL_USE_HADDOCK}" ]]; then
IUSE="${IUSE} doc"
- # don't require depend on itself to build docs.
- # ebuild bootstraps docs from just built binary
- #
- # starting from ghc-7.10.2 we install haddock bundled with
- # ghc to keep links to base and ghc library, otherwise
- # newer haddock versions change index format and can't
- # read index files for packages coming with ghc.
- [[ ${CATEGORY}/${PN} = "dev-haskell/haddock" ]] || \
- DEPEND="${DEPEND} doc? ( || ( dev-haskell/haddock >=dev-lang/ghc-7.10.2 ) )"
fi
if [[ -n "${CABAL_USE_HSCOLOUR}" ]]; then
diff --git a/eclass/java-ant-2.eclass b/eclass/java-ant-2.eclass
index 5be76953edd..733d1d1f6bf 100644
--- a/eclass/java-ant-2.eclass
+++ b/eclass/java-ant-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2018 Gentoo Foundation
+# Copyright 2004-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: java-ant-2.eclass
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index a33962f114d..b0d4d8acbef 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2018 Gentoo Authors
+# Copyright 2004-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: java-utils-2.eclass
diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass
index d71b7285996..6c6d14cc979 100644
--- a/eclass/java-vm-2.eclass
+++ b/eclass/java-vm-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: java-vm-2.eclass
diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
index b8fec445755..819b73d5dfa 100644
--- a/eclass/kde.org.eclass
+++ b/eclass/kde.org.eclass
@@ -8,7 +8,7 @@
# @BLURB: Support eclass for packages that are hosted on kde.org infrastructure.
# @DESCRIPTION:
# This eclass is mainly providing facilities for the upstream release groups
-# Frameworks, Plasma, Applications to assemble default SRC_URI for tarballs,
+# Frameworks, Plasma, Release Service 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, but it may
# be also used by any other package hosted on kde.org.
@@ -63,7 +63,7 @@ esac
# @ECLASS-VARIABLE: KDE_UNRELEASED
# @INTERNAL
-# @DESCRIPTION
+# @DESCRIPTION:
# An array of $CATEGORY-$PV pairs of packages that are unreleased upstream.
# Any package matching this will have fetch restriction enabled, and receive
# a proper error message via pkg_nofetch.
@@ -220,7 +220,10 @@ kde.org_pkg_nofetch() {
case ${CATEGORY} in
kde-frameworks) sched_uri+="/Frameworks" ;;
kde-plasma) sched_uri+="/Plasma_5" ;;
- kde-apps) sched_uri+="/Applications/$(ver_cut 1-2)_Release_Schedule" ;;
+ *)
+ [[ ${KDE_RELEASE_SERVICE} = true ]] &&
+ sched_uri+="/release_service/$(ver_cut 1-2)_Release_Schedule"
+ ;;
esac
eerror " _ _ _ _ ____ _____ _ _____ _ ____ _____ ____ "
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index a5e8c31b4ae..dccd39ec8f2 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kernel-2.eclass
@@ -53,10 +53,10 @@
# @ECLASS-VARIABLE: K_PREPATCHED
# @DEFAULT_UNSET
# @DESCRIPTION:
-# if the patchset is prepatched (ie: mm-sources,
-# ck-sources, ac-sources) it will use PR (ie: -r5) as
-# the patchset version for
-# and not use it as a true package revision
+# if the patchset is prepatched (ie: pf-sources,
+# zen-sources etc) it will use PR (ie: -r5) as the
+# patchset version for and not use it as a true package
+# revision
# @ECLASS-VARIABLE: K_EXTRAEINFO
# @DEFAULT_UNSET
@@ -1158,7 +1158,7 @@ unipatch() {
if echo ${i} | grep -qs -e "\.tar" -e "\.tbz" -e "\.tgz" ; then
if [ -n "${UNIPATCH_STRICTORDER}" ]; then
unset z
- STRICT_COUNT=$((10#${STRICT_COUNT} + 1))
+ STRICT_COUNT=$((10#${STRICT_COUNT:=0} + 1))
for((y=0; y<$((6 - ${#STRICT_COUNT})); y++));
do z="${z}0";
done
@@ -1207,7 +1207,7 @@ unipatch() {
if [ -n "${UNIPATCH_STRICTORDER}" ]; then
unset z
- STRICT_COUNT=$((10#${STRICT_COUNT} + 1))
+ STRICT_COUNT=$((10#${STRICT_COUNT:=0} + 1))
for((y=0; y<$((6 - ${#STRICT_COUNT})); y++));
do z="${z}0";
done
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 99279ba58a9..249f038fa10 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -1,4 +1,4 @@
-# Copyright 2020 Gentoo Authors
+# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kernel-build.eclass
@@ -117,7 +117,7 @@ kernel-build_src_test() {
local ver="${PV}${KV_LOCALVERSION}"
kernel-install_test "${ver}" \
- "${WORKDIR}/build/$(kernel-install_get_image_path)" \
+ "${WORKDIR}/build/$(dist-kernel_get_image_path)" \
"${T}/lib/modules/${ver}"
}
@@ -173,7 +173,7 @@ kernel-build_src_install() {
# install the kernel and files needed for module builds
insinto "/usr/src/linux-${ver}"
doins build/{System.map,Module.symvers}
- local image_path=$(kernel-install_get_image_path)
+ local image_path=$(dist-kernel_get_image_path)
cp -p "build/${image_path}" "${ED}/usr/src/linux-${ver}/${image_path}" || die
# building modules fails with 'vmlinux has no symtab?' if stripped
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index e826626e13f..b8109f47d0b 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -1,4 +1,4 @@
-# Copyright 2020 Gentoo Authors
+# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kernel-install.eclass
@@ -40,7 +40,7 @@ case "${EAPI:-0}" in
;;
esac
-inherit mount-boot toolchain-funcs
+inherit dist-kernel-utils mount-boot toolchain-funcs
SLOT="${PV}"
IUSE="+initramfs test"
@@ -70,70 +70,6 @@ BDEPEND="
x86? ( app-emulation/qemu[qemu_softmmu_targets_i386] )
)"
-# @FUNCTION: kernel-install_build_initramfs
-# @USAGE: <output> <version>
-# @DESCRIPTION:
-# Build an initramfs for the kernel. <output> specifies the absolute
-# path where initramfs will be created, while <version> specifies
-# the kernel version, used to find modules.
-kernel-install_build_initramfs() {
- debug-print-function ${FUNCNAME} "${@}"
-
- [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments"
- local output=${1}
- local version=${2}
-
- ebegin "Building initramfs via dracut"
- dracut --force "${output}" "${version}"
- eend ${?} || die "Building initramfs failed"
-}
-
-# @FUNCTION: kernel-install_get_image_path
-# @DESCRIPTION:
-# Get relative kernel image path specific to the current ${ARCH}.
-kernel-install_get_image_path() {
- case ${ARCH} in
- amd64|x86)
- echo arch/x86/boot/bzImage
- ;;
- arm64)
- echo arch/arm64/boot/Image.gz
- ;;
- arm)
- echo arch/arm/boot/zImage
- ;;
- ppc64)
- # ./ is required because of ${image_path%/*}
- # substitutions in the code
- echo ./vmlinux
- ;;
- *)
- die "${FUNCNAME}: unsupported ARCH=${ARCH}"
- ;;
- esac
-}
-
-# @FUNCTION: kernel-install_install_kernel
-# @USAGE: <version> <image> <system.map>
-# @DESCRIPTION:
-# Install kernel using installkernel tool. <version> specifies
-# the kernel version, <image> full path to the image, <system.map>
-# full path to System.map.
-kernel-install_install_kernel() {
- debug-print-function ${FUNCNAME} "${@}"
-
- [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments"
- local version=${1}
- local image=${2}
- local map=${3}
-
- ebegin "Installing the kernel via installkernel"
- # note: .config is taken relatively to System.map;
- # initrd relatively to bzImage
- installkernel "${version}" "${image}" "${map}"
- eend ${?} || die "Installing the kernel failed"
-}
-
# @FUNCTION: kernel-install_update_symlink
# @USAGE: <target> <version>
# @DESCRIPTION:
@@ -372,7 +308,7 @@ kernel-install_pkg_pretend() {
elog "If you decide to install linux-firmware later, you can rebuild"
elog "the initramfs via issuing a command equivalent to:"
elog
- elog " emerge --config ${CATEGORY}/${PN}"
+ elog " emerge --config ${CATEGORY}/${PN}:${SLOT}"
fi
fi
}
@@ -395,32 +331,64 @@ kernel-install_pkg_preinst() {
# (no-op)
}
-# @FUNCTION: kernel-install_pkg_postinst
+# @FUNCTION: kernel-install_install_all
+# @USAGE: <ver>
# @DESCRIPTION:
-# Build an initramfs for the kernel, install it and update
-# the /usr/src/linux symlink.
-kernel-install_pkg_postinst() {
+# Build an initramfs for the kernel and install the kernel. This is
+# called from pkg_postinst() and pkg_config(). <ver> is the full
+# kernel version.
+kernel-install_install_all() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ -z ${ROOT} ]]; then
- mount-boot_pkg_preinst
+ [[ ${#} -eq 1 ]] || die "${FUNCNAME}: invalid arguments"
+ local ver=${1}
- local ver="${PV}${KV_LOCALVERSION}"
- local image_path=$(kernel-install_get_image_path)
+ local success=
+ # not an actual loop but allows error handling with 'break'
+ while :; do
+ nonfatal mount-boot_check_status || break
+
+ local image_path=$(dist-kernel_get_image_path)
if use initramfs; then
# putting it alongside kernel image as 'initrd' makes
# kernel-install happier
- kernel-install_build_initramfs \
+ nonfatal dist-kernel_build_initramfs \
"${EROOT}/usr/src/linux-${ver}/${image_path%/*}/initrd" \
- "${ver}"
+ "${ver}" || break
fi
- kernel-install_install_kernel "${ver}" \
+ nonfatal dist-kernel_install_kernel "${ver}" \
"${EROOT}/usr/src/linux-${ver}/${image_path}" \
- "${EROOT}/usr/src/linux-${ver}/System.map"
+ "${EROOT}/usr/src/linux-${ver}/System.map" || break
+
+ success=1
+ break
+ done
+
+ if [[ ! ${success} ]]; then
+ eerror
+ eerror "The kernel files were copied to disk successfully but the kernel"
+ eerror "was not deployed successfully. Once you resolve the problems,"
+ eerror "please run the equivalent of the following command to try again:"
+ eerror
+ eerror " emerge --config ${CATEGORY}/${PN}:${SLOT}"
+ die "Kernel install failed, please fix the problems and run emerge --config ${CATEGORY}/${PN}:${SLOT}"
fi
+}
+
+# @FUNCTION: kernel-install_pkg_postinst
+# @DESCRIPTION:
+# Build an initramfs for the kernel, install it and update
+# the /usr/src/linux symlink.
+kernel-install_pkg_postinst() {
+ debug-print-function ${FUNCNAME} "${@}"
+ local ver="${PV}${KV_LOCALVERSION}"
kernel-install_update_symlink "${EROOT}/usr/src/linux" "${ver}"
+
+ if [[ -z ${ROOT} ]]; then
+ kernel-install_install_all "${ver}"
+ fi
}
# @FUNCTION: kernel-install_pkg_prerm
@@ -441,7 +409,7 @@ kernel-install_pkg_postrm() {
if [[ -z ${ROOT} ]] && use initramfs; then
local ver="${PV}${KV_LOCALVERSION}"
- local image_path=$(kernel-install_get_image_path)
+ local image_path=$(dist-kernel_get_image_path)
ebegin "Removing initramfs"
rm -f "${EROOT}/usr/src/linux-${ver}/${image_path%/*}/initrd" &&
find "${EROOT}/usr/src/linux-${ver}" -depth -type d -empty -delete
@@ -455,21 +423,7 @@ kernel-install_pkg_postrm() {
kernel-install_pkg_config() {
[[ -z ${ROOT} ]] || die "ROOT!=/ not supported currently"
- mount-boot_pkg_preinst
-
- local ver="${PV}${KV_LOCALVERSION}"
- local image_path=$(kernel-install_get_image_path)
- if use initramfs; then
- # putting it alongside kernel image as 'initrd' makes
- # kernel-install happier
- kernel-install_build_initramfs \
- "${EROOT}/usr/src/linux-${ver}/${image_path%/*}/initrd" \
- "${ver}"
- fi
-
- kernel-install_install_kernel "${ver}" \
- "${EROOT}/usr/src/linux-${ver}/${image_path}" \
- "${EROOT}/usr/src/linux-${ver}/System.map"
+ kernel-install_install_all "${PV}${KV_LOCALVERSION}"
}
_KERNEL_INSTALL_ECLASS=1
diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index f5a5a427636..e0444eacc61 100644
--- a/eclass/linux-mod.eclass
+++ b/eclass/linux-mod.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: linux-mod.eclass
@@ -144,9 +144,16 @@ esac
0) die "EAPI=${EAPI} is not supported with MODULES_OPTIONAL_USE_IUSE_DEFAULT due to lack of IUSE defaults" ;;
esac
-IUSE="kernel_linux ${MODULES_OPTIONAL_USE:+${_modules_optional_use_iuse_default}}${MODULES_OPTIONAL_USE}"
+IUSE="kernel_linux dist-kernel
+ ${MODULES_OPTIONAL_USE:+${_modules_optional_use_iuse_default}}${MODULES_OPTIONAL_USE}"
SLOT="0"
-RDEPEND="${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (} kernel_linux? ( sys-apps/kmod[tools] ) ${MODULES_OPTIONAL_USE:+)}"
+RDEPEND="
+ ${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (}
+ kernel_linux? (
+ sys-apps/kmod[tools]
+ dist-kernel? ( virtual/dist-kernel:= )
+ )
+ ${MODULES_OPTIONAL_USE:+)}"
DEPEND="${RDEPEND}
${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (}
sys-apps/sed
diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 100be14cb08..0589318ef51 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -344,6 +344,76 @@ _lua_export() {
done
}
+# @FUNCTION: lua_enable_tests
+# @USAGE: <test-runner> <test-directory>
+# @DESCRIPTION:
+# Set up IUSE, RESTRICT, BDEPEND and src_test() for running tests
+# with the specified test runner. Also copies the current value
+# of RDEPEND to test?-BDEPEND. The test-runner argument must be one of:
+#
+# - busted: dev-lua/busted
+#
+# Additionally, a second argument can be passed after <test-runner>,
+# so <test-runner> will use that directory to search for tests.
+# If not passed, a default directory of <test-runner> will be used.
+#
+# - busted: spec
+#
+# This function is meant as a helper for common use cases, and it only
+# takes care of basic setup. You still need to list additional test
+# dependencies manually. If you have uncommon use case, you should
+# not use it and instead enable tests manually.
+#
+# This function must be called in global scope, after RDEPEND has been
+# declared. Take care not to overwrite the variables set by it.
+lua_enable_tests() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ [[ ${#} -ge 1 ]] || die "${FUNCNAME} takes at least one argument: test-runner (test-directory)"
+ local test_directory
+ local test_pkg
+ case ${1} in
+ busted)
+ test_directory="${2:-spec}"
+ test_pkg="dev-lua/busted"
+ if [[ ! ${_LUA_SINGLE_R0} ]]; then
+ eval "lua_src_test() {
+ busted --lua=\"\${ELUA}\" --output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with \${ELUA}\"
+ }"
+ src_test() {
+ lua_foreach_impl lua_src_test
+ }
+ else
+ eval "src_test() {
+ busted --lua=\"\${ELUA}\" --output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with \${ELUA}\"
+ }"
+ fi
+ ;;
+ *)
+ die "${FUNCNAME}: unsupported argument: ${1}"
+ esac
+
+ local test_deps=${RDEPEND}
+ if [[ -n ${test_pkg} ]]; then
+ if [[ ! ${_LUA_SINGLE_R0} ]]; then
+ test_deps+=" ${test_pkg}[${LUA_USEDEP}]"
+ else
+ test_deps+=" $(lua_gen_cond_dep "
+ ${test_pkg}[\${LUA_USEDEP}]
+ ")"
+ fi
+ fi
+ if [[ -n ${test_deps} ]]; then
+ IUSE+=" test"
+ RESTRICT+=" !test? ( test )"
+ BDEPEND+=" test? ( ${test_deps} )"
+ fi
+
+ # we need to ensure successful return in case we're called last,
+ # otherwise Portage may wrongly assume sourcing failed
+ return 0
+}
+
# @FUNCTION: lua_get_CFLAGS
# @USAGE: [<impl>]
# @DESCRIPTION:
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 21338280df3..67b7ca831fd 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -55,7 +55,9 @@ if [[ -z ${_MESON_ECLASS} ]]; then
_MESON_ECLASS=1
MESON_DEPEND=">=dev-util/meson-0.54.0
- >=dev-util/ninja-1.8.2"
+ >=dev-util/ninja-1.8.2
+ dev-util/meson-format-array
+"
if [[ ${EAPI:-0} == [6] ]]; then
DEPEND=${MESON_DEPEND}
@@ -94,19 +96,6 @@ fi
# User-controlled environment variable containing arguments to be passed to
# meson in meson_src_configure.
-read -d '' __MESON_ARRAY_PARSER <<"EOF"
-import shlex
-import sys
-
-# See http://mesonbuild.com/Syntax.html#strings
-def quote(str):
- escaped = str.replace("\\\\", "\\\\\\\\").replace("'", "\\\\'")
- return "'{}'".format(escaped)
-
-print("[{}]".format(
- ", ".join([quote(x) for x in shlex.split(" ".join(sys.argv[1:]))])))
-EOF
-
# @FUNCTION: _meson_env_array
# @INTERNAL
# @DESCRIPTION:
@@ -126,7 +115,7 @@ EOF
# '--unicode-16=𐐷', '--unicode-32=𐤅']
#
_meson_env_array() {
- python -c "${__MESON_ARRAY_PARSER}" "$@"
+ meson-format-array "$@"
}
# @FUNCTION: _meson_get_machine_info
diff --git a/eclass/mount-boot.eclass b/eclass/mount-boot.eclass
index 00b36779325..2b07160231a 100644
--- a/eclass/mount-boot.eclass
+++ b/eclass/mount-boot.eclass
@@ -1,9 +1,10 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: mount-boot.eclass
# @MAINTAINER:
# base-system@gentoo.org
+# @SUPPORTED_EAPIS: 6 7
# @BLURB: functions for packages that install files into /boot
# @DESCRIPTION:
# This eclass is really only useful for bootloaders.
@@ -13,7 +14,7 @@
# error if it can't. It does nothing if /boot isn't a separate partition.
case ${EAPI:-0} in
- 4|5|6|7) ;;
+ 6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -48,10 +49,11 @@ mount-boot_is_disabled() {
# @INTERNAL
# @DESCRIPTION:
# Check if /boot is sane, i.e., mounted as read-write if on a separate
-# partition. Die if conditions are not fulfilled.
+# partition. Die if conditions are not fulfilled. If nonfatal is used,
+# the function will return a non-zero status instead.
mount-boot_check_status() {
# Get out fast if possible.
- mount-boot_is_disabled && return
+ mount-boot_is_disabled && return 0
# note that /dev/BOOT is in the Gentoo default /etc/fstab file
local fstabstate=$(awk '!/^[[:blank:]]*#|^\/dev\/BOOT/ && $2 == "/boot" \
@@ -59,7 +61,7 @@ mount-boot_check_status() {
if [[ -z ${fstabstate} ]] ; then
einfo "Assuming you do not have a separate /boot partition."
- return
+ return 0
fi
local procstate=$(awk '$2 == "/boot" { split($4, a, ","); \
@@ -69,18 +71,21 @@ mount-boot_check_status() {
if [[ -z ${procstate} ]] ; then
eerror "Your boot partition is not mounted at /boot."
eerror "Please mount it and retry."
- die "/boot not mounted"
+ die -n "/boot not mounted"
+ return 1
fi
if [[ ${procstate} == ro ]] ; then
eerror "Your boot partition, detected as being mounted at /boot," \
"is read-only."
eerror "Please remount it as read-write and retry."
- die "/boot mounted read-only"
+ die -n "/boot mounted read-only"
+ return 2
fi
einfo "Your boot partition was detected as being mounted at /boot."
einfo "Files will be installed there for ${PN} to function correctly."
+ return 0
}
mount-boot_pkg_pretend() {
diff --git a/eclass/mozcoreconf-v5.eclass b/eclass/mozcoreconf-v5.eclass
index 008b1b759cc..d50d9444cb8 100644
--- a/eclass/mozcoreconf-v5.eclass
+++ b/eclass/mozcoreconf-v5.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozcoreconf-v5.eclass
diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass
index b4f75ae017d..0dd165db08e 100644
--- a/eclass/mozcoreconf-v6.eclass
+++ b/eclass/mozcoreconf-v6.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozcoreconf-v6.eclass
diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass
index ea4f1eb143e..c6276908b9f 100644
--- a/eclass/mozextension.eclass
+++ b/eclass/mozextension.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozextension.eclass
diff --git a/eclass/mozlinguas-v2.eclass b/eclass/mozlinguas-v2.eclass
index 73576e967fa..7795a856728 100644
--- a/eclass/mozlinguas-v2.eclass
+++ b/eclass/mozlinguas-v2.eclass
@@ -20,7 +20,9 @@ case "${EAPI:-0}" in
0|1)
die "EAPI ${EAPI:-0} does not support the '->' SRC_URI operator";;
2|3|4|5|6)
+ inherit eapi7-ver
EXPORT_FUNCTIONS src_unpack src_compile src_install;;
+
*)
die "EAPI ${EAPI} is not supported, contact eclass maintainers";;
esac
@@ -288,6 +290,9 @@ mozlinguas_src_compile() {
localedir+="/browser/locales"
;;
seamonkey)
+ if [[ "$(ver_cut 2)" -gt 53 ]] || { [[ "$(ver_cut 2)" -eq 53 ]] && [[ "$(ver_cut 3)" -ge 6 ]] ; } ; then
+ localedir+="/comm"
+ fi
localedir+="/suite/locales"
;;
*thunderbird)
diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
index dd5d627ad96..8f9612bc747 100644
--- a/eclass/multibuild.eclass
+++ b/eclass/multibuild.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multibuild.eclass
diff --git a/eclass/myspell-r2.eclass b/eclass/myspell-r2.eclass
index 9b1de236dfc..2de8d14c78b 100644
--- a/eclass/myspell-r2.eclass
+++ b/eclass/myspell-r2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: myspell-r2.eclass
diff --git a/eclass/nvidia-driver.eclass b/eclass/nvidia-driver.eclass
index a2206c5e789..65fa9092ca2 100644
--- a/eclass/nvidia-driver.eclass
+++ b/eclass/nvidia-driver.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: nvidia-driver.eclass
@@ -6,16 +6,40 @@
# David Seifert <soap@gentoo.org>
# @AUTHOR:
# Original author: Doug Goldstein <cardoe@gentoo.org>
+# @SUPPORTED_EAPIS: 7
# @BLURB: Provide useful messages for nvidia-drivers
# @DESCRIPTION:
# Provide useful messages for nvidia-drivers based on currently installed
# Nvidia GPU and Linux kernel.
+# @ECLASS-VARIABLE: NV_KV_MAX_PLUS
+# @REQUIRED
+# @DESCRIPTION:
+# Two component version specifier for the strict upper bound on the
+# usable kernel version.
+#
+# Example:
+# @CODE
+# NV_KV_MAX_PLUS="5.11"
+# @CODE
+#
+# means that only kernels (strictly) below 5.11 are supported by the driver
+# in question.
+
+case ${EAPI:-0} in
+ [0-6]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
+ 7) ;;
+ *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
+esac
+
+if [[ ! ${_NVIDIA_DRIVER_ECLASS} ]]; then
+_NVIDIA_DRIVER_ECLASS=1
+
inherit readme.gentoo-r1
DESCRIPTION="NVIDIA Accelerated Graphics Driver"
HOMEPAGE="https://www.nvidia.com/Download/Find.aspx"
-DEPEND="sys-apps/pciutils"
+BDEPEND="sys-apps/pciutils"
RESTRICT="bindist mirror test"
# Variables for readme.gentoo.eclass:
@@ -28,95 +52,22 @@ This ebuild installs a kernel module and X driver. Both must
match explicitly in their version. This means, if you restart
X, you must modprobe -r nvidia before starting it back up
-To use the NVIDIA GLX, run \"eselect opengl set nvidia\"
-
To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"
NVIDIA has requested that any bug reports submitted have the
output of nvidia-bug-report.sh included.
"
-# the data below is derived from
-# http://us.download.nvidia.com/XFree86/Linux-x86_64/396.18/README/supportedchips.html
-
-drv_71xx="
- 0020 0028 0029 002c 002d 00a0 0100 0101 0103 0150 0151 0152 0153
-"
-
-drv_96xx="
- 0110 0111 0112 0113 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 017a
- 017c 017d 0181 0182 0183 0185 0188 018a 018b 018c 01a0 01f0 0200 0201 0202
- 0203 0250 0251 0253 0258 0259 025b 0280 0281 0282 0286 0288 0289 028c
-"
-
-drv_173x="
- 00fa 00fb 00fc 00fd 00fe 0301 0302 0308 0309 0311 0312 0314 031a 031b 031c
- 0320 0321 0322 0323 0324 0325 0326 0327 0328 032a 032b 032c 032d 0330 0331
- 0332 0333 0334 0338 033f 0341 0342 0343 0344 0347 0348 034c 034e
-"
-
-drv_304x="
- 0040 0041 0042 0043 0044 0045 0046 0047 0048 004e 0090 0091 0092 0093 0095
- 0098 0099 009d 00c0 00c1 00c2 00c3 00c8 00c9 00cc 00cd 00ce 00f1 00f2 00f3
- 00f4 00f5 00f6 00f8 00f9 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149
- 014a 014c 014d 014e 014f 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169
- 016a 01d0 01d1 01d2 01d3 01d6 01d7 01d8 01da 01db 01dc 01dd 01de 01df 0211
- 0212 0215 0218 0221 0222 0240 0241 0242 0244 0245 0247 0290 0291 0292 0293
- 0294 0295 0297 0298 0299 029a 029b 029c 029d 029e 029f 02e0 02e1 02e2 02e3
- 02e4 038b 0390 0391 0392 0393 0394 0395 0397 0398 0399 039c 039e 03d0 03d1
- 03d2 03d5 03d6 0531 0533 053a 053b 053e 07e0 07e1 07e2 07e3 07e5
-"
-
-drv_340x="
- 0191 0193 0194 0197 019d 019e 0400 0401 0402 0403 0404 0405 0406 0407 0408
- 0409 040a 040b 040c 040d 040e 040f 0410 0420 0421 0422 0423 0424 0425 0426
- 0427 0428 0429 042a 042b 042c 042d 042e 042f 05e0 05e1 05e2 05e3 05e6 05e7
- 05e7 05e7 05e7 05e7 05e7 05ea 05eb 05ed 05f8 05f9 05fd 05fe 05ff 0600 0601
- 0602 0603 0604 0605 0606 0607 0608 0609 0609 060a 060b 060c 060d 060f 0610
- 0611 0612 0613 0614 0615 0617 0618 0619 061a 061b 061c 061d 061e 061f 0621
- 0622 0623 0625 0626 0627 0628 062a 062b 062c 062d 062e 062e 0630 0631 0632
- 0635 0637 0638 063a 0640 0641 0643 0644 0645 0646 0647 0648 0649 0649 064a
- 064b 064c 0651 0652 0652 0653 0654 0654 0654 0655 0656 0658 0659 065a 065b
- 065c 06e0 06e1 06e2 06e3 06e4 06e5 06e6 06e7 06e8 06e8 06e9 06ea 06eb 06ec
- 06ef 06f1 06f8 06f9 06f9 06fa 06fb 06fd 06ff 06ff 0840 0844 0845 0846 0847
- 0848 0849 084a 084b 084c 084d 084f 0860 0861 0862 0863 0864 0865 0866 0866
- 0867 0868 0869 086a 086c 086d 086e 086f 0870 0871 0872 0872 0873 0873 0874
- 0876 087a 087d 087e 087f 08a0 08a2 08a3 08a4 08a5 0a20 0a22 0a23 0a26 0a27
- 0a28 0a29 0a2a 0a2b 0a2c 0a2d 0a32 0a34 0a35 0a38 0a3c 0a60 0a62 0a63 0a64
- 0a65 0a66 0a67 0a68 0a69 0a6a 0a6c 0a6e 0a6e 0a6f 0a70 0a70 0a70 0a71 0a72
- 0a73 0a73 0a73 0a74 0a74 0a75 0a75 0a76 0a78 0a7a 0a7a 0a7a 0a7a 0a7a 0a7a
- 0a7a 0a7a 0a7a 0a7a 0a7a 0a7c 0ca0 0ca2 0ca3 0ca4 0ca5 0ca7 0ca8 0ca9 0cac
- 0caf 0cb0 0cb1 0cbc 10c0 10c3 10c5 10d8
-"
-
-drv_390x="
- 06c0 06c4 06ca 06cd 06d1 06d2 06d8 06d9 06da 06dc 06dd 06de 06df 0dc0 0dc4
- 0dc5 0dc6 0dcd 0dce 0dd1 0dd2 0dd3 0dd6 0dd8 0dda 0de0 0de1 0de2 0de3 0de4
- 0de5 0de7 0de8 0de9 0dea 0deb 0dec 0ded 0dee 0def 0df0 0df1 0df2 0df3 0df4
- 0df5 0df6 0df7 0df8 0df9 0dfa 0dfc 0e22 0e23 0e24 0e30 0e31 0e3a 0e3b 0f00
- 0f01 0f02 0f03 1040 1042 1048 1049 104a 104b 104c 1050 1051 1052 1054 1055
- 1056 1057 1058 1059 105a 105b 107c 107d 1080 1081 1082 1084 1086 1087 1088
- 1089 108b 1091 1094 1096 109a 109b 1140 1200 1201 1203 1205 1206 1207 1208
- 1210 1211 1212 1213 1241 1243 1244 1245 1246 1247 1248 1249 124b 124d 1251
-"
-
-mask_71xx=">=x11-drivers/nvidia-drivers-72.0.0"
-mask_96xx=">=x11-drivers/nvidia-drivers-97.0.0"
-mask_173x=">=x11-drivers/nvidia-drivers-177.0.0"
-mask_304x=">=x11-drivers/nvidia-drivers-305.0.0"
-mask_340x=">=x11-drivers/nvidia-drivers-341.0.0"
-mask_390x=">=x11-drivers/nvidia-drivers-391.0.0"
-
# @FUNCTION: nvidia-driver_get_gpu
# @DESCRIPTION:
# Retrieve the PCI device ID for each Nvidia GPU you have
nvidia-driver_get_gpu() {
local NVIDIA_CARD=$(
- [ -x /usr/sbin/lspci ] && /usr/sbin/lspci -d 10de: -n \
+ [[ -x ${BROOT}/usr/sbin/lspci ]] && "${BROOT}"/usr/sbin/lspci -d 10de: -n \
| awk -F'[: ]' '/ 03[0-9][0-9]: /{print $6}'
)
- if [ -n "${NVIDIA_CARD}" ]; then
+ if [[ -n ${NVIDIA_CARD} ]]; then
echo "${NVIDIA_CARD}"
else
echo 0000
@@ -128,50 +79,83 @@ nvidia-driver_get_mask() {
local nvidia_gpu drv
for nvidia_gpu in ${nvidia_gpus}; do
- for drv in ${drv_71xx}; do
- if [ "x${nvidia_gpu}" = "x${drv}" ]; then
- echo "${mask_71xx}"
+ # the data below is derived from
+ # https://us.download.nvidia.com/XFree86/Linux-x86_64/396.18/README/supportedchips.html
+
+ if has ${nvidia_gpu} \
+ 0020 0028 0029 002c 002d 00a0 0100 0101 0103 0150 0151 0152 0153; then
+ echo ">=x11-drivers/nvidia-drivers-72.0.0"
return 0
- fi
- done
+ fi
- for drv in ${drv_96xx}; do
- if [ "x${nvidia_gpu}" = "x${drv}" ]; then
- echo "${mask_96xx}"
+ if has ${nvidia_gpu} \
+ 0110 0111 0112 0113 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 017a \
+ 017c 017d 0181 0182 0183 0185 0188 018a 018b 018c 01a0 01f0 0200 0201 0202 \
+ 0203 0250 0251 0253 0258 0259 025b 0280 0281 0282 0286 0288 0289 028c; then
+ echo ">=x11-drivers/nvidia-drivers-97.0.0"
return 0
- fi
- done
+ fi
- for drv in ${drv_173x}; do
- if [ "x${nvidia_gpu}" = "x${drv}" ]; then
- echo "${mask_173x}"
+ if has ${nvidia_gpu} \
+ 00fa 00fb 00fc 00fd 00fe 0301 0302 0308 0309 0311 0312 0314 031a 031b 031c \
+ 0320 0321 0322 0323 0324 0325 0326 0327 0328 032a 032b 032c 032d 0330 0331 \
+ 0332 0333 0334 0338 033f 0341 0342 0343 0344 0347 0348 034c 034e; then
+ echo ">=x11-drivers/nvidia-drivers-177.0.0"
return 0
- fi
- done
+ fi
- for drv in ${drv_304x}; do
- if [ "x${nvidia_gpu}" = "x${drv}" ]; then
- echo "${mask_304x}"
+ if has ${nvidia_gpu} \
+ 0040 0041 0042 0043 0044 0045 0046 0047 0048 004e 0090 0091 0092 0093 0095 \
+ 0098 0099 009d 00c0 00c1 00c2 00c3 00c8 00c9 00cc 00cd 00ce 00f1 00f2 00f3 \
+ 00f4 00f5 00f6 00f8 00f9 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 \
+ 014a 014c 014d 014e 014f 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 \
+ 016a 01d0 01d1 01d2 01d3 01d6 01d7 01d8 01da 01db 01dc 01dd 01de 01df 0211 \
+ 0212 0215 0218 0221 0222 0240 0241 0242 0244 0245 0247 0290 0291 0292 0293 \
+ 0294 0295 0297 0298 0299 029a 029b 029c 029d 029e 029f 02e0 02e1 02e2 02e3 \
+ 02e4 038b 0390 0391 0392 0393 0394 0395 0397 0398 0399 039c 039e 03d0 03d1 \
+ 03d2 03d5 03d6 0531 0533 053a 053b 053e 07e0 07e1 07e2 07e3 07e5; then
+ echo ">=x11-drivers/nvidia-drivers-305.0.0"
return 0
- fi
- done
+ fi
- for drv in ${drv_340x}; do
- if [ "x${nvidia_gpu}" = "x${drv}" ]; then
- echo "${mask_340x}"
+ if has ${nvidia_gpu} \
+ 0191 0193 0194 0197 019d 019e 0400 0401 0402 0403 0404 0405 0406 0407 0408 \
+ 0409 040a 040b 040c 040d 040e 040f 0410 0420 0421 0422 0423 0424 0425 0426 \
+ 0427 0428 0429 042a 042b 042c 042d 042e 042f 05e0 05e1 05e2 05e3 05e6 05e7 \
+ 05e7 05e7 05e7 05e7 05e7 05ea 05eb 05ed 05f8 05f9 05fd 05fe 05ff 0600 0601 \
+ 0602 0603 0604 0605 0606 0607 0608 0609 0609 060a 060b 060c 060d 060f 0610 \
+ 0611 0612 0613 0614 0615 0617 0618 0619 061a 061b 061c 061d 061e 061f 0621 \
+ 0622 0623 0625 0626 0627 0628 062a 062b 062c 062d 062e 062e 0630 0631 0632 \
+ 0635 0637 0638 063a 0640 0641 0643 0644 0645 0646 0647 0648 0649 0649 064a \
+ 064b 064c 0651 0652 0652 0653 0654 0654 0654 0655 0656 0658 0659 065a 065b \
+ 065c 06e0 06e1 06e2 06e3 06e4 06e5 06e6 06e7 06e8 06e8 06e9 06ea 06eb 06ec \
+ 06ef 06f1 06f8 06f9 06f9 06fa 06fb 06fd 06ff 06ff 0840 0844 0845 0846 0847 \
+ 0848 0849 084a 084b 084c 084d 084f 0860 0861 0862 0863 0864 0865 0866 0866 \
+ 0867 0868 0869 086a 086c 086d 086e 086f 0870 0871 0872 0872 0873 0873 0874 \
+ 0876 087a 087d 087e 087f 08a0 08a2 08a3 08a4 08a5 0a20 0a22 0a23 0a26 0a27 \
+ 0a28 0a29 0a2a 0a2b 0a2c 0a2d 0a32 0a34 0a35 0a38 0a3c 0a60 0a62 0a63 0a64 \
+ 0a65 0a66 0a67 0a68 0a69 0a6a 0a6c 0a6e 0a6e 0a6f 0a70 0a70 0a70 0a71 0a72 \
+ 0a73 0a73 0a73 0a74 0a74 0a75 0a75 0a76 0a78 0a7a 0a7a 0a7a 0a7a 0a7a 0a7a \
+ 0a7a 0a7a 0a7a 0a7a 0a7a 0a7c 0ca0 0ca2 0ca3 0ca4 0ca5 0ca7 0ca8 0ca9 0cac \
+ 0caf 0cb0 0cb1 0cbc 10c0 10c3 10c5 10d8; then
+ echo ">=x11-drivers/nvidia-drivers-341.0.0"
return 0
- fi
- done
+ fi
- for drv in ${drv_390x}; do
- if [ "x${nvidia_gpu}" = "x${drv}" ]; then
- echo "${mask_390x}"
+ if has ${nvidia_gpu} \
+ 06c0 06c4 06ca 06cd 06d1 06d2 06d8 06d9 06da 06dc 06dd 06de 06df 0dc0 0dc4 \
+ 0dc5 0dc6 0dcd 0dce 0dd1 0dd2 0dd3 0dd6 0dd8 0dda 0de0 0de1 0de2 0de3 0de4 \
+ 0de5 0de7 0de8 0de9 0dea 0deb 0dec 0ded 0dee 0def 0df0 0df1 0df2 0df3 0df4 \
+ 0df5 0df6 0df7 0df8 0df9 0dfa 0dfc 0e22 0e23 0e24 0e30 0e31 0e3a 0e3b 0f00 \
+ 0f01 0f02 0f03 1040 1042 1048 1049 104a 104b 104c 1050 1051 1052 1054 1055 \
+ 1056 1057 1058 1059 105a 105b 107c 107d 1080 1081 1082 1084 1086 1087 1088 \
+ 1089 108b 1091 1094 1096 109a 109b 1140 1200 1201 1203 1205 1206 1207 1208 \
+ 1210 1211 1212 1213 1241 1243 1244 1245 1246 1247 1248 1249 124b 124d 1251; then
+ echo ">=x11-drivers/nvidia-drivers-391.0.0"
return 0
- fi
- done
+ fi
done
- echo ''
return 1
}
@@ -179,9 +163,9 @@ nvidia-driver_get_mask() {
# @DESCRIPTION:
# Prints out a warning if the driver does not work with the installed GPU
nvidia-driver_check_gpu() {
- local nvidia_mask="$(nvidia-driver_get_mask)"
+ local nvidia_mask=$(nvidia-driver_get_mask)
- if [ -n "${nvidia_mask}" ]; then
+ if [[ -n ${nvidia_mask} ]]; then
if ver_test "${nvidia_mask##*-}" -lt "${PV}" ; then
ewarn "***** WARNING *****"
ewarn
@@ -191,46 +175,40 @@ nvidia-driver_check_gpu() {
ewarn "perform the following steps:"
ewarn
ewarn "Add the following mask entry to the local package.mask file:"
- if [ -d "${ROOT}/etc/portage/package.mask" ]; then
- ewarn "echo \"${nvidia_mask}\" > /etc/portage/package.mask/nvidia-drivers"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "echo \"${nvidia_mask}\" > ${EROOT}/etc/portage/package.mask/nvidia-drivers"
else
- ewarn "echo \"${nvidia_mask}\" >> /etc/portage/package.mask"
+ ewarn "echo \"${nvidia_mask}\" >> ${EROOT}/etc/portage/package.mask"
fi
ewarn
ewarn "Failure to perform the steps above could result in a non-working"
ewarn "X setup."
ewarn
ewarn "For more information please read:"
- ewarn "http://www.nvidia.com/object/IO_32667.html"
+ ewarn "https://www.nvidia.com/object/IO_32667.html"
fi
fi
}
nvidia-driver_check_kernel() {
- if kernel_is ge $(ver_cut 1 ${NV_KV_MAX_PLUS}) $(ver_cut 2 ${NV_KV_MAX_PLUS}); then
+ if kernel_is ge ${NV_KV_MAX_PLUS/./ }; then
ewarn "Gentoo supports kernels which are supported by NVIDIA"
ewarn "which are limited to the following kernels:"
ewarn "<sys-kernel/gentoo-sources-${NV_KV_MAX_PLUS}"
- ewarn "<sys-kernel/vanilla-sources-${NV_KV_MAX_PLUS}"
- ewarn ""
- ewarn "You are free to utilize eapply_user to provide whatever"
- ewarn "support you feel is appropriate, but will not receive"
- ewarn "support as a result of those changes."
- ewarn ""
+ ewarn "<sys-kernel/gentoo-kernel-${NV_KV_MAX_PLUS}"
+ ewarn
+ ewarn "You are free to apply custom patches via /etc/portage/patches"
+ ewarn "to provide whatever support you feel is appropriate, but will"
+ ewarn "not receive support as a result of those changes."
+ ewarn
ewarn "Do not file a bug report about this."
- ewarn ""
+ ewarn
fi
check_extra_config
}
nvidia-driver_check() {
- if use amd64 && has_multilib_profile && \
- [ "${DEFAULT_ABI}" != "amd64" ]; then
- eerror "This ebuild doesn't currently support changing your default ABI"
- die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
- fi
-
# Since Nvidia ships many different series of drivers, we need to give the user
# some kind of guidance as to what version they should install. This tries
# to point the user in the right direction but can't be perfect. check
@@ -239,3 +217,5 @@ nvidia-driver_check() {
use driver && use kernel_linux && nvidia-driver_check_kernel
}
+
+fi
diff --git a/eclass/office-ext-r1.eclass b/eclass/office-ext-r1.eclass
index 298f958a13a..a1649ac8d6a 100644
--- a/eclass/office-ext-r1.eclass
+++ b/eclass/office-ext-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: office-ext-r1.eclass
@@ -6,21 +6,18 @@
# The office team <office@gentoo.org>
# @AUTHOR:
# Tomáš Chvátal <scarabeus@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7
-# @BLURB: Eclass for installing libreoffice/openoffice extensions
+# @SUPPORTED_EAPIS: 5 7
+# @BLURB: Eclass for installing libreoffice extensions
# @DESCRIPTION:
-# Eclass for easing maintenance of libreoffice/openoffice extensions.
+# Eclass for easing maintenance of libreoffice extensions.
case "${EAPI:-0}" in
- 5|6) inherit multilib ;;
- 7) ;;
+ 5) inherit eutils multilib ;;
+ 7) inherit eutils ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
-# eutils.eclass: emktemp
-inherit eutils
-
-OEXT_EXPORTED_FUNCTIONS="src_unpack src_install pkg_postinst pkg_prerm"
+EXPORT_FUNCTIONS src_unpack src_install
# @ECLASS-VARIABLE: OFFICE_REQ_USE
# @DESCRIPTION:
@@ -43,9 +40,9 @@ fi
#
# Example:
# @CODE
-# OFFICE_IMPLEMENTATIONS=( "libreoffice" "openoffice" )
+# OFFICE_IMPLEMENTATIONS=( "libreoffice" )
# @CODE
-[[ -z ${OFFICE_IMPLEMENTATIONS} ]] && OFFICE_IMPLEMENTATIONS=( "libreoffice" "openoffice" )
+[[ -z ${OFFICE_IMPLEMENTATIONS} ]] && OFFICE_IMPLEMENTATIONS=( "libreoffice" )
# @ECLASS-VARIABLE: OFFICE_EXTENSIONS
# @REQUIRED
@@ -76,14 +73,7 @@ RDEPEND=""
for i in ${OFFICE_IMPLEMENTATIONS[@]}; do
IUSE+=" office_implementation_${i}"
- if [[ ${i} == "openoffice" ]]; then
- # special only binary
- RDEPEND+="
- office_implementation_openoffice? (
- app-office/openoffice-bin${OFFICE_REQ_USE}
- )
- "
- else
+ if [[ ${i} == "libreoffice" ]]; then
RDEPEND+="
office_implementation_${i}? (
|| (
@@ -123,12 +113,12 @@ office-ext-r1_src_unpack() {
if [[ -f "${OFFICE_EXTENSIONS_LOCATION}/${i}" ]] ; then
case ${i} in
*.oxt)
- mkdir -p "${WORKDIR}/${i}/"
- pushd "${WORKDIR}/${i}/" > /dev/null
- echo ">>> Unpacking "${OFFICE_EXTENSIONS_LOCATION}/${i}" to ${PWD}"
+ mkdir -p "${WORKDIR}/${i}/" || die
+ pushd "${WORKDIR}/${i}/" > /dev/null || die
+ einfo "Unpacking "${OFFICE_EXTENSIONS_LOCATION}/${i}" to ${PWD}"
unzip -qo ${OFFICE_EXTENSIONS_LOCATION}/${i}
assert "failed unpacking ${OFFICE_EXTENSIONS_LOCATION}/${i}"
- popd > /dev/null
+ popd > /dev/null || die
;;
*) unpack ${i} ;;
esac
@@ -147,97 +137,12 @@ office-ext-r1_src_install() {
for i in ${OFFICE_IMPLEMENTATIONS[@]}; do
if use office_implementation_${i}; then
- if [[ ${i} == openoffice ]]; then
- # OOO needs to use uno because direct deployment segfaults.
- # This is bug by their side, but i don't want to waste time
- # fixing it myself.
- insinto /usr/$(get_libdir)/${i}/share/extension/install
- for j in ${OFFICE_EXTENSIONS[@]}; do
- doins ${OFFICE_EXTENSIONS_LOCATION}/${j}
- done
- else
- for j in ${OFFICE_EXTENSIONS[@]}; do
- pushd "${WORKDIR}/${j}/" > /dev/null
- insinto /usr/$(get_libdir)/${i}/share/extensions/${j/.oxt/}
- doins -r *
- popd > /dev/null
- done
- fi
+ for j in ${OFFICE_EXTENSIONS[@]}; do
+ pushd "${WORKDIR}/${j}/" > /dev/null || die
+ insinto /usr/$(get_libdir)/${i}/share/extensions/${j/.oxt/}
+ doins -r *
+ popd > /dev/null || die
+ done
fi
done
}
-
-#### OPENOFFICE COMPAT CODE
-
-UNOPKG_BINARY="/usr/lib64/openoffice/program/unopkg"
-
-# @FUNCTION: office-ext-r1_add_extension
-# @DESCRIPTION:
-# Install the extension into the libreoffice/openoffice.
-office-ext-r1_add_extension() {
- debug-print-function ${FUNCNAME} "$@"
- local ext=$1
- local tmpdir=$(emktemp -d)
-
- debug-print "${FUNCNAME}: ${UNOPKG_BINARY} add --shared \"${ext}\""
- ebegin "Adding office extension: \"${ext}\""
- ${UNOPKG_BINARY} add --suppress-license \
- --shared "${ext}" \
- "-env:UserInstallation=file:///${tmpdir}" \
- "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
- eend $?
- ${UNOPKG_BINARY} list --shared > /dev/null
- rm -r "${tmpdir}" || dir "failed to clean up"
-}
-
-# @FUNCTION: office-ext-r1_remove_extension
-# @DESCRIPTION:
-# Remove the extension from the libreoffice/openoffice.
-office-ext-r1_remove_extension() {
- debug-print-function ${FUNCNAME} "$@"
- local ext=$1
- local tmpdir=$(mktemp -d --tmpdir="${T}")
-
- debug-print "${FUNCNAME}: ${UNOPKG_BINARY} remove --shared \"${ext}\""
- ebegin "Removing office extension: \"${ext}\""
- ${UNOPKG_BINARY} remove --suppress-license \
- --shared "${ext}" \
- "-env:UserInstallation=file:///${tmpdir}" \
- "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
- eend $?
- ${UNOPKG_BINARY} list --shared > /dev/null
- rm -r "${tmpdir}" || dir "failed to clean up"
-}
-
-# @FUNCTION: office-ext-r1_pkg_postinst
-# @DESCRIPTION:
-# Add the extensions to the openoffice.
-office-ext-r1_pkg_postinst() {
- if in_iuse office_implementation_openoffice && use office_implementation_openoffice; then
- debug-print-function ${FUNCNAME} "$@"
- debug-print "Extensions: ${OFFICE_EXTENSIONS[@]}"
- local i
-
- for i in ${OFFICE_EXTENSIONS[@]}; do
- office-ext-r1_add_extension "/usr/lib64/openoffice/share/extension/install/${i}"
- done
- fi
-}
-
-# @FUNCTION: office-ext-r1_pkg_prerm
-# @DESCRIPTION:
-# Remove the extensions from the openoffice.
-office-ext-r1_pkg_prerm() {
- if in_iuse office_implementation_openoffice && use office_implementation_openoffice; then
- debug-print-function ${FUNCNAME} "$@"
- debug-print "Extensions: ${OFFICE_EXTENSIONS[@]}"
- local i
-
- for i in ${OFFICE_EXTENSIONS[@]}; do
- office-ext-r1_remove_extension "${i}"
- done
- fi
-}
-
-EXPORT_FUNCTIONS ${OEXT_EXPORTED_FUNCTIONS}
-unset OEXT_EXPORTED_FUNCTIONS
diff --git a/eclass/opam.eclass b/eclass/opam.eclass
index 0420b99f71c..05ebea51054 100644
--- a/eclass/opam.eclass
+++ b/eclass/opam.eclass
@@ -17,6 +17,9 @@ case ${EAPI:-0} in
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
+# Do not complain about CFLAGS etc since ml projects do not use them.
+QA_FLAGS_IGNORED='.*'
+
# @ECLASS-VARIABLE: OPAM_INSTALLER_DEP
# @DESCRIPTION:
# Override dependency for OPAM_INSTALLER
diff --git a/eclass/openib.eclass b/eclass/openib.eclass
index 08d6fb3a111..a36f5cd85d0 100644
--- a/eclass/openib.eclass
+++ b/eclass/openib.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: openib.eclass
diff --git a/eclass/optfeature.eclass b/eclass/optfeature.eclass
index 1943ae37bf5..e13fc3eba81 100644
--- a/eclass/optfeature.eclass
+++ b/eclass/optfeature.eclass
@@ -32,11 +32,13 @@ optfeature() {
debug-print-function ${FUNCNAME} "$@"
local i j msg
+ local -a arr
local desc=$1
local flag=0
shift
for i; do
- for j in ${i}; do
+ read -r -d '' -a arr <<<"${i}"
+ for j in "${arr[@]}"; do
if has_version "${j}"; then
flag=1
else
@@ -50,8 +52,9 @@ optfeature() {
done
if [[ ${flag} -eq 0 ]]; then
for i; do
+ read -r -d '' -a arr <<<"${i}"
msg=" "
- for j in ${i}; do
+ for j in "${arr[@]}"; do
msg+=" ${j} and"
done
msg="${msg:0: -4} for ${desc}"
diff --git a/eclass/pam.eclass b/eclass/pam.eclass
index 97fcb89d3f5..c9de612469b 100644
--- a/eclass/pam.eclass
+++ b/eclass/pam.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: pam.eclass
@@ -14,7 +14,7 @@
if [[ -z ${_PAM_ECLASS} ]]; then
_PAM_ECLASS=1
-inherit flag-o-matic multilib
+inherit flag-o-matic
# @FUNCTION: dopamd
# @USAGE: <file> [more files]
@@ -210,47 +210,4 @@ cleanpamd() {
done
}
-# @FUNCTION: pam_epam_expand
-# @USAGE: <pamd file>
-# @DESCRIPTION:
-# Steer clear, deprecated, don't use, bad experiment
-pam_epam_expand() {
- sed -n -e 's|#%EPAM-\([[:alpha:]-]\+\):\([-+<>=/.![:alnum:]]\+\)%#.*|\1 \2|p' \
- "$@" | sort -u | while read condition parameter; do
-
- disable="yes"
-
- case "$condition" in
- If-Has)
- message="This can be used only if you have ${parameter} installed"
- has_version "$parameter" && disable="no"
- ;;
- Use-Flag)
- message="This can be used only if you enabled the ${parameter} USE flag"
- use "$parameter" && disable="no"
- ;;
- *)
- eerror "Unknown EPAM condition '${condition}' ('${parameter}')"
- die "Unknown EPAM condition '${condition}' ('${parameter}')"
- ;;
- esac
-
- if [ "${disable}" = "yes" ]; then
- sed -i -e "/#%EPAM-${condition}:${parameter/\//\\/}%#/d" "$@"
- else
- sed -i -e "s|#%EPAM-${condition}:${parameter}%#||" "$@"
- fi
-
- done
-}
-
-# Think about it before uncommenting this one, for now run it by hand
-# pam_pkg_preinst() {
-# eshopts_push -o noglob # so that bash doen't expand "*"
-#
-# pam_epam_expand "${D}"/etc/pam.d/*
-#
-# eshopts_pop # reset old shell opts
-# }
-
fi
diff --git a/eclass/php-pear-r2.eclass b/eclass/php-pear-r2.eclass
index e4197522b16..d3887492047 100644
--- a/eclass/php-pear-r2.eclass
+++ b/eclass/php-pear-r2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: php-pear-r2.eclass
diff --git a/eclass/portability.eclass b/eclass/portability.eclass
index 1402c0420cb..333a9590b39 100644
--- a/eclass/portability.eclass
+++ b/eclass/portability.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: portability.eclass
diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
index 435e99fdf92..d00c0d79ef5 100644
--- a/eclass/prefix.eclass
+++ b/eclass/prefix.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: prefix.eclass
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index c634e19813e..5f2dc5b8f38 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -24,9 +24,10 @@
# be called by the eclass with EPYTHON set to each matching Python
# implementation and it is expected to check whether the implementation
# fulfills the package requirements. You can use the locally exported
-# PYTHON_USEDEP to check USE-dependencies of relevant packages. It
-# should return a true value (0) if the Python implementation fulfills
-# the requirements, a false value (non-zero) otherwise.
+# PYTHON_USEDEP or PYTHON_SINGLE_USEDEP to check USE-dependencies
+# of relevant packages. It should return a true value (0) if the Python
+# implementation fulfills the requirements, a false value (non-zero)
+# otherwise.
#
# Please note that python-any-r1 will always inherit python-utils-r1
# as well. Thus, all the functions defined there can be used in the
@@ -131,20 +132,42 @@ EXPORT_FUNCTIONS pkg_setup
# An eclass-generated USE-dependency string for the currently tested
# implementation. It is set locally for python_check_deps() call.
#
-# The generate USE-flag list is compatible with packages using python-r1,
-# python-single-r1 and python-distutils-ng eclasses. It must not be used
-# on packages using python.eclass.
+# The generated USE-flag list is compatible with packages using
+# python-r1 eclass. For python-single-r1 dependencies,
+# use PYTHON_SINGLE_USEDEP.
#
# Example use:
# @CODE
# python_check_deps() {
-# has_version "dev-python/foo[${PYTHON_USEDEP}]"
+# has_version "dev-python/foo[${PYTHON_USEDEP}]"
# }
# @CODE
#
# Example value:
# @CODE
-# python_targets_python2_7(-)?,python_single_target_python2_7(+)?
+# python_targets_python3_7(-),-python_single_target_python3_7(-)
+# @CODE
+
+# @ECLASS-VARIABLE: PYTHON_SINGLE_USEDEP
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# An eclass-generated USE-dependency string for the currently tested
+# implementation. It is set locally for python_check_deps() call.
+#
+# The generated USE-flag list is compatible with packages using
+# python-single-r1 eclass. For python-r1 dependencies,
+# use PYTHON_USEDEP.
+#
+# Example use:
+# @CODE
+# python_check_deps() {
+# has_version "dev-python/bar[${PYTHON_SINGLE_USEDEP}]"
+# }
+# @CODE
+#
+# Example value:
+# @CODE
+# python_single_target_python3_7(-)
# @CODE
_python_any_set_globals() {
@@ -190,7 +213,8 @@ if [[ ! ${_PYTHON_ANY_R1} ]]; then
# Generate an any-of dependency that enforces a version match between
# the Python interpreter and Python packages. <dependency-block> needs
# to list one or more dependencies with verbatim '${PYTHON_USEDEP}'
-# references (quoted!) that will get expanded inside the function.
+# or '${PYTHON_SINGLE_USEDEP}' references (quoted!) that will get
+# expanded inside the function.
#
# This should be used along with an appropriate python_check_deps()
# that checks which of the any-of blocks were matched.
@@ -198,12 +222,12 @@ if [[ ! ${_PYTHON_ANY_R1} ]]; then
# Example use:
# @CODE
# DEPEND="$(python_gen_any_dep '
-# dev-python/foo[${PYTHON_USEDEP}]
+# dev-python/foo[${PYTHON_SINGLE_USEDEP}]
# || ( dev-python/bar[${PYTHON_USEDEP}]
# dev-python/baz[${PYTHON_USEDEP}] )')"
#
# python_check_deps() {
-# has_version "dev-python/foo[${PYTHON_USEDEP}]" \
+# has_version "dev-python/foo[${PYTHON_SINGLE_USEDEP}]" \
# && { has_version "dev-python/bar[${PYTHON_USEDEP}]" \
# || has_version "dev-python/baz[${PYTHON_USEDEP}]"; }
# }
@@ -213,16 +237,16 @@ if [[ ! ${_PYTHON_ANY_R1} ]]; then
# @CODE
# || (
# (
-# dev-lang/python:2.7
-# dev-python/foo[python_targets_python2_7(-)?,python_single_target_python2_7(+)?]
-# || ( dev-python/bar[python_targets_python2_7(-)?,python_single_target_python2_7(+)?]
-# dev-python/baz[python_targets_python2_7(-)?,python_single_target_python2_7(+)?] )
+# dev-lang/python:3.7
+# dev-python/foo[python_single_target_python3_7(-)]
+# || ( dev-python/bar[python_targets_python3_7(-),-python_single_target_python3_7(-)]
+# dev-python/baz[python_targets_python3_7(-),-python_single_target_python3_7(-)] )
# )
# (
-# dev-lang/python:3.3
-# dev-python/foo[python_targets_python3_3(-)?,python_single_target_python3_3(+)?]
-# || ( dev-python/bar[python_targets_python3_3(-)?,python_single_target_python3_3(+)?]
-# dev-python/baz[python_targets_python3_3(-)?,python_single_target_python3_3(+)?] )
+# dev-lang/python:3.8
+# dev-python/foo[python_single_target_python3_8(-)]
+# || ( dev-python/bar[python_targets_python3_8(-),-python_single_target_python3_8(-)]
+# dev-python/baz[python_targets_python3_8(-),-python_single_target_python3_8(-)] )
# )
# )
# @CODE
@@ -234,10 +258,12 @@ python_gen_any_dep() {
local i PYTHON_PKG_DEP out=
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
- local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
+ local PYTHON_USEDEP="python_targets_${i}(-),-python_single_target_${i}(-)"
+ local PYTHON_SINGLE_USEDEP="python_single_target_${i}(-)"
_python_export "${i}" PYTHON_PKG_DEP
local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
+ i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}}
# note: need to strip '=' slot operator for || deps
out="( ${PYTHON_PKG_DEP%=} ${i_depstr} ) ${out}"
done
@@ -268,7 +294,8 @@ _python_EPYTHON_supported() {
if has "${i}" "${_PYTHON_SUPPORTED_IMPLS[@]}"; then
if python_is_installed "${i}"; then
if declare -f python_check_deps >/dev/null; then
- local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
+ local PYTHON_USEDEP="python_targets_${i}(-),-python_single_target_${i}(-)"
+ local PYTHON_SINGLE_USEDEP="python_single_target_${i}(-)"
python_check_deps
return ${?}
fi
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 40944684ec8..5cae020c6d9 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -152,6 +152,28 @@ fi
# python_targets_python2_7(-)?,python_targets_python3_4(-)?
# @CODE
+# @ECLASS-VARIABLE: PYTHON_SINGLE_USEDEP
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# An eclass-generated USE-dependency string for the currently tested
+# implementation. It is set locally for python_check_deps() call.
+#
+# The generated USE-flag list is compatible with packages using
+# python-single-r1 eclass. For python-r1 dependencies,
+# use PYTHON_USEDEP.
+#
+# Example use:
+# @CODE
+# python_check_deps() {
+# has_version "dev-python/bar[${PYTHON_SINGLE_USEDEP}]"
+# }
+# @CODE
+#
+# Example value:
+# @CODE
+# python_single_target_python3_7(-)
+# @CODE
+
# @ECLASS-VARIABLE: PYTHON_REQUIRED_USE
# @OUTPUT_VARIABLE
# @DESCRIPTION:
@@ -507,9 +529,10 @@ python_gen_impl_dep() {
# Generate an any-of dependency that enforces a version match between
# the Python interpreter and Python packages. <dependency-block> needs
# to list one or more dependencies with verbatim '${PYTHON_USEDEP}'
-# references (quoted!) that will get expanded inside the function.
-# Optionally, patterns may be specified to restrict the dependency
-# to a subset of Python implementations supported by the ebuild.
+# or '${PYTHON_SINGLE_USEDEP}' references (quoted!) that will get
+# expanded inside the function. Optionally, patterns may be specified
+# to restrict the dependency to a subset of Python implementations
+# supported by the ebuild.
#
# The patterns can be either fnmatch-style patterns (matched via bash
# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
@@ -524,12 +547,12 @@ python_gen_impl_dep() {
# Example use:
# @CODE
# DEPEND="$(python_gen_any_dep '
-# dev-python/foo[${PYTHON_USEDEP}]
+# dev-python/foo[${PYTHON_SINGLE_USEDEP}]
# || ( dev-python/bar[${PYTHON_USEDEP}]
# dev-python/baz[${PYTHON_USEDEP}] )' -2)"
#
# python_check_deps() {
-# has_version "dev-python/foo[${PYTHON_USEDEP}]" \
+# has_version "dev-python/foo[${PYTHON_SINGLE_USEDEP}]" \
# && { has_version "dev-python/bar[${PYTHON_USEDEP}]" \
# || has_version "dev-python/baz[${PYTHON_USEDEP}]"; }
# }
@@ -547,16 +570,16 @@ python_gen_impl_dep() {
# @CODE
# || (
# (
-# dev-lang/python:2.7
-# dev-python/foo[python_targets_python2_7(-)?,python_single_target_python2_7(+)?]
-# || ( dev-python/bar[python_targets_python2_7(-)?,python_single_target_python2_7(+)?]
-# dev-python/baz[python_targets_python2_7(-)?,python_single_target_python2_7(+)?] )
+# dev-lang/python:3.7
+# dev-python/foo[python_single_target_python3_7(-)]
+# || ( dev-python/bar[python_targets_python3_7(-),-python_single_target_python3_7(-)]
+# dev-python/baz[python_targets_python3_7(-),-python_single_target_python3_7(-)] )
# )
# (
-# dev-lang/python:3.3
-# dev-python/foo[python_targets_python3_3(-)?,python_single_target_python3_3(+)?]
-# || ( dev-python/bar[python_targets_python3_3(-)?,python_single_target_python3_3(+)?]
-# dev-python/baz[python_targets_python3_3(-)?,python_single_target_python3_3(+)?] )
+# dev-lang/python:3.8
+# dev-python/foo[python_single_target_python3_8(-)]
+# || ( dev-python/bar[python_targets_python3_8(-),-python_single_target_python3_8(-)]
+# dev-python/baz[python_targets_python3_8(-),-python_single_target_python3_8(-)] )
# )
# )
# @CODE
@@ -571,10 +594,12 @@ python_gen_any_dep() {
_python_verify_patterns "${@}"
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${i}" "${@}"; then
- local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
+ local PYTHON_USEDEP="python_targets_${i}(-),-python_single_target_${i}(-)"
+ local PYTHON_SINGLE_USEDEP="python_single_target_${i}(-)"
_python_export "${i}" PYTHON_PKG_DEP
local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
+ i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}}
# note: need to strip '=' slot operator for || deps
out="( ${PYTHON_PKG_DEP/:0=/:0} ${i_depstr} ) ${out}"
fi
@@ -779,7 +804,8 @@ python_setup() {
# first check if the interpreter is installed
python_is_installed "${impl}" || continue
# then run python_check_deps
- local PYTHON_USEDEP="python_targets_${impl}(-),python_single_target_${impl}(+)"
+ local PYTHON_USEDEP="python_targets_${impl}(-),-python_single_target_${impl}(-)"
+ local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
python_check_deps || continue
fi
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 9c8b6a14d2a..6d482aa106c 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-utils-r1.eclass
@@ -41,7 +41,7 @@ inherit toolchain-funcs
_PYTHON_ALL_IMPLS=(
pypy3
python2_7
- python3_6 python3_7 python3_8 python3_9
+ python3_7 python3_8 python3_9
)
readonly _PYTHON_ALL_IMPLS
@@ -53,7 +53,7 @@ _PYTHON_HISTORICAL_IMPLS=(
jython2_7
pypy pypy1_{8,9} pypy2_0
python2_{5,6}
- python3_{1,2,3,4,5}
+ python3_{1..6}
)
readonly _PYTHON_HISTORICAL_IMPLS
@@ -69,38 +69,6 @@ readonly _PYTHON_HISTORICAL_IMPLS
# which can involve revisions of this eclass that support a different
# set of Python implementations.
-# @FUNCTION: _python_impl_supported
-# @USAGE: <impl>
-# @INTERNAL
-# @DESCRIPTION:
-# Check whether the implementation <impl> (PYTHON_COMPAT-form)
-# is still supported.
-#
-# Returns 0 if the implementation is valid and supported. If it is
-# unsupported, returns 1 -- and the caller should ignore the entry.
-# If it is invalid, dies with an appopriate error messages.
-_python_impl_supported() {
- debug-print-function ${FUNCNAME} "${@}"
-
- [[ ${#} -eq 1 ]] || die "${FUNCNAME}: takes exactly 1 argument (impl)."
-
- local impl=${1}
-
- # keep in sync with _PYTHON_ALL_IMPLS!
- # (not using that list because inline patterns shall be faster)
- case "${impl}" in
- python2_7|python3_[6789]|pypy3)
- return 0
- ;;
- jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[56]|python3_[12345])
- return 1
- ;;
- *)
- [[ ${PYTHON_COMPAT_NO_STRICT} ]] && return 1
- die "Invalid implementation in PYTHON_COMPAT: ${impl}"
- esac
-}
-
# @FUNCTION: _python_verify_patterns
# @USAGE: <pattern>...
# @INTERNAL
@@ -149,10 +117,26 @@ _python_set_impls() {
if [[ $(declare -p PYTHON_COMPAT) != "declare -a"* ]]; then
die 'PYTHON_COMPAT must be an array.'
fi
- for i in "${PYTHON_COMPAT[@]}"; do
- # trigger validity checks
- _python_impl_supported "${i}"
- done
+ if [[ ! ${PYTHON_COMPAT_NO_STRICT} ]]; then
+ for i in "${PYTHON_COMPAT[@]}"; do
+ # check for incorrect implementations
+ # we're using pattern matching as an optimization
+ # please keep them in sync with _PYTHON_ALL_IMPLS
+ # and _PYTHON_HISTORICAL_IMPLS
+ case ${i} in
+ jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9])
+ ;;
+ *)
+ if has "${i}" "${_PYTHON_ALL_IMPLS[@]}" \
+ "${_PYTHON_HISTORICAL_IMPLS[@]}"
+ then
+ die "Mis-synced patterns in _python_set_impls: missing ${i}"
+ else
+ die "Invalid implementation in PYTHON_COMPAT: ${i}"
+ fi
+ esac
+ done
+ fi
local supp=() unsupp=()
diff --git a/eclass/qmake-utils.eclass b/eclass/qmake-utils.eclass
index cf287ee8d7e..0d49eb94382 100644
--- a/eclass/qmake-utils.eclass
+++ b/eclass/qmake-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: qmake-utils.eclass
@@ -6,10 +6,10 @@
# qt@gentoo.org
# @AUTHOR:
# Davide Pesavento <pesa@gentoo.org>
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 7
# @BLURB: Common functions for qmake-based packages.
# @DESCRIPTION:
-# Utility eclass providing wrapper functions for Qt4 and Qt5 qmake.
+# Utility eclass providing wrapper functions for Qt5 qmake.
#
# This eclass does not set any metadata variables nor export any phase
# functions. It can be inherited safely.
@@ -17,55 +17,59 @@
if [[ -z ${_QMAKE_UTILS_ECLASS} ]]; then
_QMAKE_UTILS_ECLASS=1
-[[ ${EAPI:-0} == [012345] ]] && die "qmake-utils.eclass: unsupported EAPI=${EAPI:-0}"
+case ${EAPI} in
+ 7) ;;
+ *) die "EAPI=${EAPI:-0} is not supported" ;;
+esac
-inherit estack toolchain-funcs
+inherit toolchain-funcs
+
+# @FUNCTION: _qmake-utils_banned_func
+# @INTERNAL
+# @DESCRIPTION:
+# Banned functions are banned.
+_qmake-utils_banned_func() {
+ die "${FUNCNAME[1]} is banned in EAPI 7 and later"
+}
# @FUNCTION: qt4_get_bindir
+# @INTERNAL
# @DESCRIPTION:
-# Echoes the directory where Qt4 binaries are installed.
-# EPREFIX is already prepended to the returned path.
+# Banned.
qt4_get_bindir() {
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later"
-
- local qtbindir=${EPREFIX}$(qt4_get_libdir)/bin
- if [[ -d ${qtbindir} ]]; then
- echo ${qtbindir}
- else
- echo ${EPREFIX}/usr/bin
- fi
+ _qmake-utils_banned_func
}
# @FUNCTION: qt4_get_headerdir
+# @INTERNAL
# @DESCRIPTION:
-# Echoes the directory where Qt4 headers are installed.
+# Banned.
qt4_get_headerdir() {
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later"
- echo /usr/include/qt4
+ _qmake-utils_banned_func
}
# @FUNCTION: qt4_get_libdir
+# @INTERNAL
# @DESCRIPTION:
-# Echoes the directory where Qt4 libraries are installed.
+# Banned.
qt4_get_libdir() {
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later"
- echo /usr/$(get_libdir)/qt4
+ _qmake-utils_banned_func
}
# @FUNCTION: qt4_get_mkspecsdir
+# @INTERNAL
# @DESCRIPTION:
-# Echoes the directory where Qt4 mkspecs are installed.
+# Banned.
qt4_get_mkspecsdir() {
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later"
- echo /usr/share/qt4/mkspecs
+ _qmake-utils_banned_func
}
# @FUNCTION: qt4_get_plugindir
+# @INTERNAL
# @DESCRIPTION:
-# Echoes the directory where Qt4 plugins are installed.
+# Banned.
qt4_get_plugindir() {
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later"
- echo $(qt4_get_libdir)/plugins
+ _qmake-utils_banned_func
}
# @FUNCTION: qt5_get_bindir
@@ -105,176 +109,19 @@ qt5_get_plugindir() {
}
# @FUNCTION: qmake-utils_find_pro_file
-# @RETURN: zero or one qmake .pro file names
# @INTERNAL
# @DESCRIPTION:
-# Outputs a project file name that can be passed to eqmake.
-# 0 *.pro files found --> outputs null string;
-# 1 *.pro file found --> outputs its name;
-# 2 or more *.pro files found --> if "${PN}.pro" or
-# "$(basename ${S}).pro" are there, outputs one of them.
+# Banned.
qmake-utils_find_pro_file() {
- local dir_name=$(basename "${S}")
-
- # set nullglob to avoid expanding *.pro to the literal
- # string "*.pro" when there are no matching files
- eshopts_push -s nullglob
- local pro_files=(*.pro)
- eshopts_pop
-
- case ${#pro_files[@]} in
- 0)
- : ;;
- 1)
- echo "${pro_files}"
- ;;
- *)
- for pro_file in "${pro_files[@]}"; do
- if [[ ${pro_file%.pro} == ${dir_name} || ${pro_file%.pro} == ${PN} ]]; then
- echo "${pro_file}"
- break
- fi
- done
- ;;
- esac
+ _qmake-utils_banned_func
}
-# @VARIABLE: EQMAKE4_EXCLUDE
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# List of files to be excluded from eqmake4 CONFIG processing.
-# Paths are relative to the current working directory (usually ${S}).
-#
-# Example: EQMAKE4_EXCLUDE="ignore/me.pro foo/*"
-
# @FUNCTION: eqmake4
-# @USAGE: [project_file] [parameters to qmake]
+# @INTERNAL
# @DESCRIPTION:
-# Wrapper for Qt4's qmake. If project_file is not specified, eqmake4 looks
-# for one in the current directory (non-recursively). If multiple project
-# files are found, then ${PN}.pro is used, if it exists, otherwise eqmake4
-# will not be able to continue.
-#
-# All other arguments are appended unmodified to qmake command line.
-#
-# For recursive build systems, i.e. those based on the subdirs template,
-# you should run eqmake4 on the top-level project file only, unless you
-# have a valid reason to do otherwise. During the building, qmake will
-# be automatically re-invoked with the right arguments on every directory
-# specified inside the top-level project file.
+# Banned.
eqmake4() {
- debug-print-function ${FUNCNAME} "$@"
-
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later"
-
- ebegin "Running qmake"
-
- local qmake_args=("$@")
-
- # Check if the project file name was passed as first argument. If not, look for candidates.
- local regexp='.*\.pro'
- if ! [[ ${1} =~ ${regexp} ]]; then
- local project_file=$(qmake-utils_find_pro_file)
- if [[ -z ${project_file} ]]; then
- echo
- eerror "No project files found in '${PWD}'"
- eerror "This shouldn't happen - please send a bug report to https://bugs.gentoo.org/"
- echo
- die "eqmake4 failed"
- fi
- qmake_args+=("${project_file}")
- fi
-
- # Make sure the CONFIG variable is correctly set for both release and debug builds.
- local config_add=release
- local config_remove=debug
- if in_iuse debug && use debug; then
- config_add=debug
- config_remove=release
- fi
-
- local awkscript='BEGIN {
- printf "### eqmake4 was here ###\n" > file;
- printf "CONFIG -= debug_and_release %s\n", remove >> file;
- printf "CONFIG += %s\n\n", add >> file;
- fixed=0;
- }
- /^[[:blank:]]*CONFIG[[:blank:]]*[\+\*]?=/ {
- if (gsub("\\<((" remove ")|(debug_and_release))\\>", "") > 0) {
- fixed=1;
- }
- }
- /^[[:blank:]]*CONFIG[[:blank:]]*-=/ {
- if (gsub("\\<" add "\\>", "") > 0) {
- fixed=1;
- }
- }
- {
- print >> file;
- }
- END {
- print fixed;
- }'
-
- [[ -n ${EQMAKE4_EXCLUDE} ]] && eshopts_push -o noglob
-
- local file
- while read file; do
- local excl
- for excl in ${EQMAKE4_EXCLUDE}; do
- [[ ${file} == ${excl} ]] && continue 2
- done
- grep -q '^### eqmake4 was here ###$' "${file}" && continue
-
- local retval=$({
- rm -f "${file}" || echo FAIL
- awk -v file="${file}" \
- -v add=${config_add} \
- -v remove=${config_remove} \
- -- "${awkscript}" || echo FAIL
- } < "${file}")
-
- if [[ ${retval} == 1 ]]; then
- einfo " - fixed CONFIG in ${file}"
- elif [[ ${retval} != 0 ]]; then
- eerror " - error while processing ${file}"
- die "eqmake4 failed to process ${file}"
- fi
- done < <(find . -type f -name '*.pr[io]' -printf '%P\n' 2>/dev/null)
-
- [[ -n ${EQMAKE4_EXCLUDE} ]] && eshopts_pop
-
- "$(qt4_get_bindir)"/qmake \
- -makefile \
- QMAKE_AR="$(tc-getAR) cqs" \
- QMAKE_CC="$(tc-getCC)" \
- QMAKE_CXX="$(tc-getCXX)" \
- QMAKE_LINK="$(tc-getCXX)" \
- QMAKE_LINK_C="$(tc-getCC)" \
- QMAKE_OBJCOPY="$(tc-getOBJCOPY)" \
- QMAKE_RANLIB= \
- QMAKE_STRIP= \
- QMAKE_CFLAGS="${CFLAGS}" \
- QMAKE_CFLAGS_RELEASE= \
- QMAKE_CFLAGS_DEBUG= \
- QMAKE_CXXFLAGS="${CXXFLAGS}" \
- QMAKE_CXXFLAGS_RELEASE= \
- QMAKE_CXXFLAGS_DEBUG= \
- QMAKE_LFLAGS="${LDFLAGS}" \
- QMAKE_LFLAGS_RELEASE= \
- QMAKE_LFLAGS_DEBUG= \
- QMAKE_LIBDIR_QT="${EPREFIX}$(qt4_get_libdir)" \
- QMAKE_LIBDIR_X11="${EPREFIX}/usr/$(get_libdir)" \
- QMAKE_LIBDIR_OPENGL="${EPREFIX}/usr/$(get_libdir)" \
- "${qmake_args[@]}"
-
- if ! eend $? ; then
- echo
- eerror "Running qmake has failed! (see above for details)"
- eerror "This shouldn't happen - please send a bug report to https://bugs.gentoo.org/"
- echo
- die "eqmake4 failed"
- fi
+ _qmake-utils_banned_func
}
# @FUNCTION: eqmake5
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index dce88d642cc..99fe5db7705 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -112,9 +112,6 @@ BDEPEND="
if [[ ${PN} != qttest ]]; then
DEPEND+=" test? ( ~dev-qt/qttest-${PV} )"
fi
-if ver_test ${PV} -lt 5.15.2; then
- RDEPEND+=" dev-qt/qtchooser"
-fi
###### Phase functions ######
diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass
index 45ad3d27402..e5752dca2d7 100644
--- a/eclass/ruby-utils.eclass
+++ b/eclass/ruby-utils.eclass
@@ -31,7 +31,7 @@ if [[ ! ${_RUBY_UTILS} ]]; then
RUBY_TARGETS_PREFERENCE="ruby26 ruby25 "
# All other active ruby targets
-RUBY_TARGETS_PREFERENCE+="ruby27"
+RUBY_TARGETS_PREFERENCE+="ruby27 ruby30"
_ruby_implementation_depend() {
@@ -79,6 +79,10 @@ _ruby_implementation_depend() {
rubypn="dev-lang/ruby"
rubyslot=":2.7"
;;
+ ruby30)
+ rubypn="dev-lang/ruby"
+ rubyslot=":3.0"
+ ;;
ree18)
rubypn="dev-lang/ruby-enterprise"
rubyslot=":1.8"
diff --git a/eclass/s6.eclass b/eclass/s6.eclass
index aab66726094..b84d5a166db 100644
--- a/eclass/s6.eclass
+++ b/eclass/s6.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: s6.eclass
diff --git a/eclass/ssl-cert.eclass b/eclass/ssl-cert.eclass
index 0e7294f6229..fdd6775ffc7 100644
--- a/eclass/ssl-cert.eclass
+++ b/eclass/ssl-cert.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ssl-cert.eclass
diff --git a/eclass/stardict.eclass b/eclass/stardict.eclass
index cbfb10c5455..5e96b01625c 100644
--- a/eclass/stardict.eclass
+++ b/eclass/stardict.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Author : Alastair Tse <liquidx@gentoo.org>
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 09ea71bbfdc..81065a0af79 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: systemd.eclass
diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh
index 229dff52af9..676cc690c75 100755
--- a/eclass/tests/flag-o-matic.sh
+++ b/eclass/tests/flag-o-matic.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 86b87ec173d..eb8223ec6ac 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -183,24 +183,6 @@ test_fix_shebang '#!/usr/bin/foo' python2.7 FAIL
# regression test for bug #522080
test_fix_shebang '#!/usr/bin/python ' python2.7 '#!/usr/bin/python2.7 '
-# make sure we don't break pattern matching
-test_is "_python_impl_supported python2_5" 1
-test_is "_python_impl_supported python2_6" 1
-test_is "_python_impl_supported python2_7" 0
-test_is "_python_impl_supported python3_1" 1
-test_is "_python_impl_supported python3_2" 1
-test_is "_python_impl_supported python3_3" 1
-test_is "_python_impl_supported python3_4" 1
-test_is "_python_impl_supported python3_5" 1
-test_is "_python_impl_supported python3_6" 0
-test_is "_python_impl_supported python3_7" 0
-test_is "_python_impl_supported python3_8" 0
-test_is "_python_impl_supported pypy1_8" 1
-test_is "_python_impl_supported pypy1_9" 1
-test_is "_python_impl_supported pypy2_0" 1
-test_is "_python_impl_supported pypy" 1
-test_is "_python_impl_supported pypy3" 0
-
# check _python_impl_matches behavior
test_is "_python_impl_matches python2_7 -2" 0
test_is "_python_impl_matches python3_6 -2" 1
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index 674eaa02cdc..2fc849cb69a 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
if ! source /lib/gentoo/functions.sh ; then
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index 1cf124520c3..23ac568c4a5 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh
@@ -27,7 +27,8 @@ test-tc-arch-kernel() {
tbegin "tc-arch-kernel() (KV=2.6.30)"
test-tc-arch-kernel 2.6.30 \
i{3..6}86:x86 x86_64:x86 \
- powerpc{,64}:powerpc i{3..6}86-gentoo-freebsd:i386
+ powerpc{,64}:powerpc i{3..6}86-gentoo-freebsd:i386 \
+ or1k:openrisc or1k-linux-musl:openrisc
tend $?
#
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index e69e0c8f1dd..118d68c63df 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
diff --git a/eclass/toolchain-autoconf.eclass b/eclass/toolchain-autoconf.eclass
index bc22921c08d..2c8184f894c 100644
--- a/eclass/toolchain-autoconf.eclass
+++ b/eclass/toolchain-autoconf.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: toolchain-autoconf.eclass
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index ec7b920bcfa..267cf5cfce3 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,4 +1,4 @@
-# Copyright 2002-2019 Gentoo Authors
+# Copyright 2002-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: toolchain-funcs.eclass
@@ -505,12 +505,21 @@ tc-ld-is-lld() {
# If the gold linker is currently selected, configure the compilation
# settings so that we use the older bfd linker instead.
tc-ld-disable-gold() {
- if ! tc-ld-is-gold "$@" ; then
- # They aren't using gold, so nothing to do!
+ tc-ld-is-gold "$@" && tc-ld-force-bfd "$@"
+}
+
+# @FUNCTION: tc-ld-force-bfd
+# @USAGE: [toolchain prefix]
+# @DESCRIPTION:
+# If the gold or lld linker is currently selected, configure the compilation
+# settings so that we use the bfd linker instead.
+tc-ld-force-bfd() {
+ if ! tc-ld-is-gold "$@" && ! tc-ld-is-lld "$@" ; then
+ # They aren't using gold or lld, so nothing to do!
return
fi
- ewarn "Forcing usage of the BFD linker instead of GOLD"
+ ewarn "Forcing usage of the BFD linker"
# Set up LD to point directly to bfd if it's available.
# We need to extract the first word in case there are flags appended
@@ -520,7 +529,7 @@ tc-ld-disable-gold() {
local path_ld=$(which "${bfd_ld}" 2>/dev/null)
[[ -e ${path_ld} ]] && export LD=${bfd_ld}
- # Set up LDFLAGS to select gold based on the gcc / clang version.
+ # Set up LDFLAGS to select bfd based on the gcc / clang version.
local fallback="true"
if tc-is-gcc; then
local major=$(gcc-major-version "$@")
@@ -548,7 +557,7 @@ tc-ld-disable-gold() {
ln -sf "${path_ld}" "${d}"/ld
export LDFLAGS="${LDFLAGS} -B${d}"
else
- die "unable to locate a BFD linker to bypass gold"
+ die "unable to locate a BFD linker"
fi
fi
}
@@ -665,7 +674,7 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
mips*) echo mips;;
nios2*) echo nios2;;
nios*) echo nios;;
- or1k|or32*) echo openrisc;;
+ or1k*|or32*) echo openrisc;;
powerpc*)
# Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees
# have been unified into simply 'powerpc', but until 2.6.16,
diff --git a/eclass/toolchain-glibc.eclass b/eclass/toolchain-glibc.eclass
index 87704c5bb5a..f48f7050732 100644
--- a/eclass/toolchain-glibc.eclass
+++ b/eclass/toolchain-glibc.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: toolchain-glibc.eclass
diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
index 63aedee4480..3a1dc9f29f3 100644
--- a/eclass/unpacker.eclass
+++ b/eclass/unpacker.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: unpacker.eclass
@@ -356,6 +356,8 @@ _unpacker() {
*.lz)
: ${UNPACKER_LZIP:=$(type -P plzip || type -P pdlzip || type -P lzip)}
comp="${UNPACKER_LZIP} -dc" ;;
+ *.zst)
+ comp="zstd -dfc" ;;
esac
# then figure out if there are any archiving aspects
@@ -459,6 +461,8 @@ unpacker_src_uri_depends() {
d="app-arch/unzip" ;;
*.lz)
d="|| ( app-arch/plzip app-arch/pdlzip app-arch/lzip )" ;;
+ *.zst)
+ d="app-arch/zstd" ;;
esac
deps+=" ${d}"
done
diff --git a/eclass/vala.eclass b/eclass/vala.eclass
index 52899f163dc..88c5231286a 100644
--- a/eclass/vala.eclass
+++ b/eclass/vala.eclass
@@ -102,7 +102,7 @@ vala_best_api_version() {
u=$(_vala_use_depend)
for v in $(vala_api_versions); do
- has_version "dev-lang/vala:${v}${u}" && echo "${v}" && return
+ has_version $([[ $EAPI == [1-6] ]] || echo -b) "dev-lang/vala:${v}${u}" && echo "${v}" && return
done
}
@@ -136,7 +136,7 @@ vala_src_prepare() {
fi
if [[ ${version} ]]; then
- has_version "dev-lang/vala:${version}" || die "No installed vala:${version}"
+ has_version $([[ $EAPI == [1-6] ]] || echo -b) "dev-lang/vala:${version}" || die "No installed vala:${version}"
else
version=$(vala_best_api_version)
[[ ${version} ]] || die "No installed vala in $(vala_depend)"
diff --git a/eclass/vim-doc.eclass b/eclass/vim-doc.eclass
index 5f281eba25f..70a6e943e85 100644
--- a/eclass/vim-doc.eclass
+++ b/eclass/vim-doc.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# This eclass is used by vim.eclass and vim-plugin.eclass to update
diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index 7a894f6bbb7..f22460881ef 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -8,7 +8,7 @@
# Original Author: Gilles Dartiguelongue <eva@gentoo.org>
# Various improvements based on cmake-utils.eclass: Tomáš Chvátal <scarabeus@gentoo.org>
# Proper prefix support: Jonathan Callen <jcallen@gentoo.org>
-# @SUPPORTED_EAPIS: 4 5 6
+# @SUPPORTED_EAPIS: 4 5 6 7
# @BLURB: common ebuild functions for waf-based packages
# @DESCRIPTION:
# The waf-utils eclass contains functions that make creating ebuild for
@@ -19,7 +19,7 @@
inherit multilib toolchain-funcs multiprocessing
case ${EAPI:-0} in
- 4|5|6) EXPORT_FUNCTIONS src_configure src_compile src_install ;;
+ 4|5|6|7) EXPORT_FUNCTIONS src_configure src_compile src_install ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass
index e11835735ca..b0a8f7a34d4 100644
--- a/eclass/webapp.eclass
+++ b/eclass/webapp.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: webapp.eclass
diff --git a/eclass/xorg-2.eclass b/eclass/xorg-2.eclass
index c703d06f1db..99b1f891b99 100644
--- a/eclass/xorg-2.eclass
+++ b/eclass/xorg-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: xorg-2.eclass
@@ -119,7 +119,7 @@ fi
# Set up autotools shared dependencies
# Remember that all versions here MUST be stable
-XORG_EAUTORECONF_ARCHES="ppc-aix x86-winnt"
+XORG_EAUTORECONF_ARCHES="x86-winnt"
EAUTORECONF_DEPEND+="
>=sys-devel/libtool-2.2.6a
sys-devel/m4"
@@ -168,27 +168,6 @@ fi
# If we're a driver package, then enable DRIVER case
[[ ${PN} == xf86-video-* || ${PN} == xf86-input-* ]] && DRIVER="yes"
-# @ECLASS-VARIABLE: XORG_STATIC
-# @DESCRIPTION:
-# Enables static-libs useflag. Set to no, if your package gets:
-#
-# QA: configure: WARNING: unrecognized options: --disable-static
-: ${XORG_STATIC:="yes"}
-
-# Add static-libs useflag where useful.
-if [[ ${XORG_STATIC} == yes \
- && ${FONT} != yes \
- && ${CATEGORY} != app-doc \
- && ${CATEGORY} != x11-apps \
- && ${CATEGORY} != x11-drivers \
- && ${CATEGORY} != media-fonts \
- && ${PN} != util-macros \
- && ${PN} != xbitmaps \
- && ${PN} != xorg-cf-files \
- && ${PN/xcursor} = ${PN} ]]; then
- IUSE+=" static-libs"
-fi
-
DEPEND+=" virtual/pkgconfig"
# @ECLASS-VARIABLE: XORG_DRI
@@ -440,9 +419,15 @@ xorg-2_src_configure() {
local selective_werror="--disable-selective-werror"
fi
+ # Check if package supports disabling of static libraries
+ if grep -q -s "able-static" ${ECONF_SOURCE:-.}/configure; then
+ local no_static="--disable-static"
+ fi
+
local myeconfargs=(
${dep_track}
${selective_werror}
+ ${no_static}
${FONT_OPTIONS}
"${xorgconfadd[@]}"
)
diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 7b4c7f97deb..811168ead98 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -127,7 +127,7 @@ fi
# Set up autotools shared dependencies
# Remember that all versions here MUST be stable
-XORG_EAUTORECONF_ARCHES="ppc-aix x86-winnt"
+XORG_EAUTORECONF_ARCHES="x86-winnt"
EAUTORECONF_DEPEND+="
>=sys-devel/libtool-2.2.6a
sys-devel/m4"
@@ -169,28 +169,6 @@ if [[ ${FONT} == yes ]]; then
FONT_DIR=${FONT_DIR/type1/Type1}
FONT_DIR=${FONT_DIR/speedo/Speedo}
fi
-
-# @ECLASS-VARIABLE: XORG_STATIC
-# @DESCRIPTION:
-# Enables static-libs useflag. Set to no, if your package gets:
-#
-# QA: configure: WARNING: unrecognized options: --disable-static
-: ${XORG_STATIC:="yes"}
-
-# Add static-libs useflag where useful.
-if [[ ${XORG_STATIC} == yes \
- && ${FONT} != yes \
- && ${CATEGORY} != app-doc \
- && ${CATEGORY} != x11-apps \
- && ${CATEGORY} != x11-drivers \
- && ${CATEGORY} != media-fonts \
- && ${PN} != util-macros \
- && ${PN} != xbitmaps \
- && ${PN} != xorg-cf-files \
- && ${PN/xcursor} = ${PN} ]]; then
- IUSE+=" static-libs"
-fi
-
BDEPEND+=" virtual/pkgconfig"
# @ECLASS-VARIABLE: XORG_DRI
@@ -391,9 +369,15 @@ xorg-3_src_configure() {
local selective_werror="--disable-selective-werror"
fi
+ # Check if package supports disabling of static libraries
+ if grep -q -s "able-static" ${ECONF_SOURCE:-.}/configure; then
+ local no_static="--disable-static"
+ fi
+
local econfargs=(
${dep_track}
${selective_werror}
+ ${no_static}
${FONT_OPTIONS}
"${xorgconfadd[@]}"
)
@@ -446,6 +430,7 @@ xorg-3_src_install() {
multilib-minimal_src_install "$@"
else
emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed"
+ einstalldocs
fi
# Many X11 libraries unconditionally install developer documentation