diff options
| author | Liguros - Gitlab CI/CD [master] <gitlab@liguros.net> | 2021-01-17 23:35:33 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [master] <gitlab@liguros.net> | 2021-01-17 23:35:33 +0000 |
| commit | 8e8120eabdd28020aa69c7a60505cce2edd20adc (patch) | |
| tree | 061bf0acdc672720e0bc3a2d575f67d25aedb2d8 /eclass | |
| parent | c16790af2c9b4cbc38e565d4311252193ff85484 (diff) | |
| download | baldeagleos-repo-21.1.2.tar.gz baldeagleos-repo-21.1.2.tar.xz baldeagleos-repo-21.1.2.zip | |
Updating liguros repo21.1.2
Diffstat (limited to 'eclass')
72 files changed, 741 insertions, 924 deletions
diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass index 19a378e0b061..11a9f29e6253 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 56a4e83e8bfc..ee4358b5c75c 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 6ee984458fd6..79f14d81b134 100644 --- a/eclass/alternatives.eclass +++ b/eclass/alternatives.eclass @@ -2,8 +2,6 @@ # Distributed under the terms of the GNU General Public License v2 # @ECLASS: alternatives.eclass -# @MAINTAINER: -# maintainer-needed@gentoo.org # @AUTHOR: # Original author: Alastair Tse <liquidx@gentoo.org> (03 Oct 2003) # @BLURB: Creates symlink to the latest version of multiple slotted packages. diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass index c882196e7758..42f801a84d70 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 07f2cd6af875..ccfe482f528e 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 diff --git a/eclass/apache-module.eclass b/eclass/apache-module.eclass index ff97b6c70f3a..e192a7454277 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 d633d991c5e5..b07af61fdf1e 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 d7ce23bfdf35..08c72cd77953 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 @@ -359,16 +367,16 @@ eautoconf() { # Install config.guess and config.sub which are required by many macros # in Autoconf >=2.70. - local gnuconfig + local _gnuconfig case ${EAPI:-0} in 0|1|2|3|4|5|6) - gnuconfig="${EPREFIX}/usr/share/gnuconfig" + _gnuconfig="${EPREFIX}/usr/share/gnuconfig" ;; *) - gnuconfig="${BROOT}/usr/share/gnuconfig" + _gnuconfig="${BROOT}/usr/share/gnuconfig" ;; esac - cp "${gnuconfig}"/config.{guess,sub} . || die + 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 636371df9d6b..70d40a25969e 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/calculate-kernel-8.eclass b/eclass/calculate-kernel-8.eclass index ab543c9854ce..eac50620487c 100644 --- a/eclass/calculate-kernel-8.eclass +++ b/eclass/calculate-kernel-8.eclass @@ -172,6 +172,7 @@ clean_for_minimal() { Module.symvers \ scripts/Makefile.ubsan \ scripts/Makefile.kcov \ + scripts/module.lds \ scripts/subarch.include \ scripts/Kbuild.include scripts/Makefile.modpost \ scripts/gcc-goto.sh scripts/Makefile.headersinst \ diff --git a/eclass/calculate-utils-r11.eclass b/eclass/calculate-utils-r11.eclass index 0ac91a7de566..835fb9e58000 100644 --- a/eclass/calculate-utils-r11.eclass +++ b/eclass/calculate-utils-r11.eclass @@ -13,6 +13,7 @@ PYTHON_COMPAT=(python2_7) +DISTUTILS_USE_SETUPTOOLS=manual inherit distutils-r1 eutils EXPORTED_FUNCTIONS="src_compile src_install pkg_preinst" @@ -198,15 +199,15 @@ RDEPEND=" dev-qt/qdbus:5 sys-apps/edid-decode || ( + ( dev-python/pygobject[python_targets_python3_8] + dev-python/dbus-python[python_targets_python3_8] + ) ( dev-python/pygobject[python_targets_python3_7] dev-python/dbus-python[python_targets_python3_7] ) ( dev-python/pygobject[python_targets_python3_6] dev-python/dbus-python[python_targets_python3_6] ) - ( dev-python/pygobject[python_targets_python3_8] - dev-python/dbus-python[python_targets_python3_8] - ) ) ) @@ -251,7 +252,9 @@ RDEPEND=" backup? ( !sys-apps/calculate-server ) " -DEPEND="sys-devel/gettext" +DEPEND=" + dev-python/setuptools-python2 + sys-devel/gettext" REQUIRED_USE="client? ( desktop )" diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass index 77b9d6ceb209..4bbe6aa31759 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 65ad5a58a343..5d5b68e6f105 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 26706cd74d1f..dd3cbe135a39 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 de257a9ae23b..7633425bac3b 100644 --- a/eclass/db-use.eclass +++ b/eclass/db-use.eclass @@ -1,15 +1,8 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: db-use.eclass -# @MAINTAINER: -# maintainer-needed@gentoo.org -# @AUTHOR: -# Paul de Vrieze <pauldv@gentoo.org> -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 -# @BLURB: functions that aid the use of sys-libs/db -# @DESCRIPTION: -# functions that aid in the use of sys-libs/db +# This is a common location for functions that aid the use of sys-libs/db +# +# Bugs: maintainer-needed@gentoo.org # multilib is used for get_libname in all EAPI case "${EAPI:-0}" in @@ -17,10 +10,7 @@ case "${EAPI:-0}" in *) inherit multilib ;; esac -# @FUNCTION: db_ver_to_slot -# @USAGE: <version> -# @DESCRIPTION: -# Convert a version to a db slot +#Convert a version to a db slot db_ver_to_slot() { if [ $# -ne 1 ]; then eerror "Function db_ver_to_slot needs one argument" >&2 @@ -38,10 +28,7 @@ db_ver_to_slot() { echo -n "$1" } -# @FUNCTION: db_findver -# @USAGE: <atom> -# @DESCRIPTION: -# Find the version that corresponds to the given atom +#Find the version that correspond to the given atom db_findver() { has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= if [ $# -ne 1 ]; then @@ -65,9 +52,6 @@ db_findver() { fi } -# @FUNCTION: db_includedir -# @USAGE: <version> -# @DESCRIPTION: # Get the include dir for berkeley db. # This function has two modes. Without any arguments it will give the best # version available. With arguments that form the versions of db packages @@ -87,7 +71,7 @@ db_includedir() { return 1 fi else - # arguments given + #arguments given for x in $@ do if VER=$(db_findver "=sys-libs/db-${x}*") && @@ -101,9 +85,7 @@ db_includedir() { fi } -# @FUNCTION: db_libname -# @USAGE: <version> -# @DESCRIPTION: + # Get the library name for berkeley db. Something like "db-4.2" will be the # outcome. This function has two modes. Without any arguments it will give # the best version available. With arguments that form the versions of db @@ -121,7 +103,7 @@ db_libname() { return 1 fi else - # arguments given + #arguments given for x in $@ do if VER=$(db_findver "=sys-libs/db-${x}*"); then diff --git a/eclass/db.eclass b/eclass/db.eclass index 01c2f9d9f1fc..9a246d18979a 100644 --- a/eclass/db.eclass +++ b/eclass/db.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: db.eclass diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass new file mode 100644 index 000000000000..9ab65b097b32 --- /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/distutils-r1.eclass b/eclass/distutils-r1.eclass index 33c66c4872e5..5ffc91be479c 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1193,66 +1193,34 @@ distutils-r1_src_install() { # -- distutils.eclass functions -- -# @FUNCTION: distutils_get_intermediate_installation_image -# @INTERNAL -# @DESCRIPTION: -# Die and warn when function from previous distutils is called distutils_get_intermediate_installation_image() { die "${FUNCNAME}() is invalid for distutils-r1" } -# @FUNCTION: distutils_src_unpack -# @INTERNAL -# @DESCRIPTION: -# Die and warn when function from previous distutils is called distutils_src_unpack() { die "${FUNCNAME}() is invalid for distutils-r1, and you don't want it in EAPI ${EAPI} anyway" } -# @FUNCTION: distutils_src_prepare -# @INTERNAL -# @DESCRIPTION: -# Die and warn when function from previous distutils is called distutils_src_prepare() { die "${FUNCNAME}() is invalid for distutils-r1, you probably want: ${FUNCNAME/_/-r1_}" } -# @FUNCTION: distutils_src_compile -# @INTERNAL -# @DESCRIPTION: -# Die and warn when function from previous distutils is called distutils_src_compile() { die "${FUNCNAME}() is invalid for distutils-r1, you probably want: ${FUNCNAME/_/-r1_}" } -# @FUNCTION: distutils_src_test -# @INTERNAL -# @DESCRIPTION: -# Die and warn when function from previous distutils is called distutils_src_test() { die "${FUNCNAME}() is invalid for distutils-r1, you probably want: ${FUNCNAME/_/-r1_}" } -# @FUNCTION: distutils_src_install -# @INTERNAL -# @DESCRIPTION: -# Die and warn when function from previous distutils is called distutils_src_install() { die "${FUNCNAME}() is invalid for distutils-r1, you probably want: ${FUNCNAME/_/-r1_}" } -# @FUNCTION: distutils_pkg_postinst -# @INTERNAL -# @DESCRIPTION: -# Die and warn when function from previous distutils is called distutils_pkg_postinst() { die "${FUNCNAME}() is invalid for distutils-r1, and pkg_postinst is unnecessary" } -# @FUNCTION: distutils_pkg_postrm -# @INTERNAL -# @DESCRIPTION: -# Die and warn when function from previous distutils is called distutils_pkg_postrm() { die "${FUNCNAME}() is invalid for distutils-r1, and pkg_postrm is unnecessary" } diff --git a/eclass/dotnet.eclass b/eclass/dotnet.eclass index f15b7f55fcc2..ae861daf6e79 100644 --- a/eclass/dotnet.eclass +++ b/eclass/dotnet.eclass @@ -2,8 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # @ECLASS: dotnet.eclass -# @MAINTAINER: -# dotnet@gentoo.org +# @MAINTAINER: dotnet@gentoo.org # @SUPPORTED_EAPIS: 1 2 3 4 5 6 7 # @BLURB: common settings and functions for mono and dotnet related packages # @DESCRIPTION: diff --git a/eclass/estack.eclass b/eclass/estack.eclass index 3f444ee3b70b..c0823adb03f7 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 3aa45919b37e..000000000000 --- 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 3a165cfb4b41..8fc5fd625a17 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 diff --git a/eclass/font-ebdftopcf.eclass b/eclass/font-ebdftopcf.eclass index c36cd14256fa..29568e560134 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/gnustep-2.eclass b/eclass/gnustep-2.eclass index ddb1c29660d4..d1acdc1dd4b9 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 cd36a269bf1a..45603d76fd5d 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 c76a1865a48f..d106a30eb58a 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/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index 2fc797e764cb..4908e4491e60 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 5be76953edd6..733d1d1f6bf7 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 a33962f114de..b0d4d8acbefc 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 d71b7285996d..6c6d14cc9797 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/kernel-2.eclass b/eclass/kernel-2.eclass index a5e8c31b4ae8..dccd39ec8f2f 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 99279ba58a99..249f038fa107 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 e826626e13f2..b8109f47d0bf 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 f5a5a4276369..e0444eacc61a 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/meson.eclass b/eclass/meson.eclass index 21338280df33..67b7ca831fd2 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/mozcoreconf-v5.eclass b/eclass/mozcoreconf-v5.eclass index 008b1b759ccc..d50d9444cb82 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 b4f75ae017d1..0dd165db08e3 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 ea4f1eb143e9..c6276908b9f5 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 73576e967fa6..7795a856728b 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 dd5d627ad960..8f9612bc747e 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 9b1de236dfcf..2de8d14c78b1 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 a2206c5e7894..65fa9092ca27 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 298f958a13aa..a1649ac8d6aa 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/openib.eclass b/eclass/openib.eclass index 08d6fb3a1115..a36f5cd85d02 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 1943ae37bf5e..e13fc3eba811 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 97fcb89d3f5b..c9de612469b1 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 e4197522b162..d3887492047d 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 1402c0420cb0..333a9590b39c 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 435e99fdf922..d00c0d79ef53 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 c634e19813e0..5f2dc5b8f384 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 40944684ec8b..5cae020c6d90 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/qmake-utils.eclass b/eclass/qmake-utils.eclass index cf287ee8d7ed..0d49eb94382c 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 dce88d642cc0..99fe5db77053 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 45ad3d274028..e5752dca2d7b 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 aab66726094d..b84d5a166db9 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 0e7294f62299..fdd6775ffc77 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 cbfb10c54552..5e96b01625cd 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 09ea71bbfdc5..81065a0af79a 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 229dff52af94..676cc690c75c 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 86b87ec173d4..eb8223ec6ac0 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 674eaa02cdc9..2fc849cb69a7 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 1cf124520c3c..23ac568c4a50 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 e69e0c8f1dd2..118d68c63df4 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 bc22921c08d3..2c8184f894cc 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 ec7b920bcfa7..4a4bb27fc084 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -665,7 +665,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 87704c5bb5a9..f48f7050732a 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 63aedee4480e..3a1dc9f29f33 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/vim-doc.eclass b/eclass/vim-doc.eclass index 5f281eba25f2..70a6e943e85f 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 7a894f6bbb73..f22460881ef4 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 e11835735cac..b0a8f7a34d4d 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 c703d06f1dbd..99b1f891b998 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 7b4c7f97deb5..811168ead986 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 |
