diff options
45 files changed, 517 insertions, 638 deletions
diff --git a/eclass/ada.eclass b/eclass/ada.eclass index bf4cd0c59bcc..98f00972c54c 100644 --- a/eclass/ada.eclass +++ b/eclass/ada.eclass @@ -6,7 +6,7 @@ # Ada team <ada@gentoo.org> # @AUTHOR: # Tupone Alfredo <tupone@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: An eclass for Ada packages # @DESCRIPTION: # This eclass set the IUSE and REQUIRED_USE to request the ADA_TARGET @@ -23,16 +23,9 @@ # # Mostly copied from python-single-r1.eclass -case "${EAPI:-0}" in - 0|1|2|3|4|5) - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" - ;; - 6|7|8) - # EAPI=5 is required for sane USE_EXPAND dependencies - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac EXPORT_FUNCTIONS pkg_setup diff --git a/eclass/alternatives.eclass b/eclass/alternatives.eclass index 155a2457bbdf..2489fc67359a 100644 --- a/eclass/alternatives.eclass +++ b/eclass/alternatives.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: alternatives.eclass @@ -6,7 +6,7 @@ # maintainer-needed@gentoo.org # @AUTHOR: # Alastair Tse <liquidx@gentoo.org> (03 Oct 2003) -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 7 # @BLURB: Creates symlink to the latest version of multiple slotted packages. # @DESCRIPTION: # When a package is SLOT'ed, very often we need to have a symlink to the @@ -42,12 +42,10 @@ # consider using this unless you are want to do something special. case ${EAPI} in - [5-7]) ;; - *) die "EAPI=${EAPI:-0} is not supported" ;; + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS pkg_postinst pkg_postrm - if [[ -z ${_ALTERNATIVES_ECLASS} ]]; then _ALTERNATIVES_ECLASS=1 @@ -95,8 +93,7 @@ alternatives_makesym() { # usage: alternatives_makesym <resulting symlink> [alternative targets..] # make sure it is in the prefix, allow it already to be in the prefix SYMLINK=${EPREFIX}/${1#${EPREFIX}} - # this trick removes the trailing / from ${ROOT} - pref=${ROOT%/} + pref=${ROOT} shift ALTERNATIVES=$@ @@ -154,3 +151,5 @@ alternatives_pkg_postrm() { } fi + +EXPORT_FUNCTIONS pkg_postinst pkg_postrm diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass index a11716bf2b62..98a35dd40c4d 100644 --- a/eclass/ant-tasks.eclass +++ b/eclass/ant-tasks.eclass @@ -1,4 +1,4 @@ -# Copyright 2007-2021 Gentoo Authors +# Copyright 2007-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: ant-tasks.eclass @@ -6,22 +6,16 @@ # java@gentoo.org # @AUTHOR: # Vlastimil Babka <caster@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 7 # @PROVIDES: java-utils-2 # @BLURB: Eclass for building dev-java/ant-* packages # @DESCRIPTION: # This eclass provides functionality and default ebuild variables for building # dev-java/ant-* packages easily. -case "${EAPI:-0}" in - 0|1|2|3|4|5) - die "ant-tasks.eclass: EAPI ${EAPI} is too old." - ;; - 6|7) - ;; - *) - die "ant-tasks.eclass: EAPI ${EAPI} is not supported yet." - ;; +case ${EAPI} in + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac # we set ant-core dep ourselves, restricted @@ -29,7 +23,6 @@ JAVA_ANT_DISABLE_ANT_CORE_DEP=true # rewriting build.xml for are the testcases has no reason atm JAVA_PKG_BSFIX_ALL=no inherit java-pkg-2 java-ant-2 -[[ ${EAPI:-0} -eq 6 ]] && inherit eapi7-ver EXPORT_FUNCTIONS src_unpack src_compile src_install diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass index 3fb1b52f4b96..50df33f0b074 100644 --- a/eclass/apache-2.eclass +++ b/eclass/apache-2.eclass @@ -18,10 +18,9 @@ inherit autotools flag-o-matic lua-single multilib ssl-cert toolchain-funcs [[ ${CATEGORY}/${PN} != www-servers/apache ]] \ && die "Do not use this eclass with anything else than www-servers/apache ebuilds!" -case ${EAPI:-0} in - 0|1|2|3|4|5|6) - die "This eclass is banned for EAPI<7" - ;; +case ${EAPI} in + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac # settings which are version specific go in here: @@ -390,7 +389,7 @@ setup_modules() { # This internal function generates the LoadModule lines for httpd.conf based on # the current module selection and MODULE_DEFINES generate_load_module() { - local def= endit=0 m= mod_lines= mod_dir="${ED%/}/usr/$(get_libdir)/apache2/modules" + local def= endit=0 m= mod_lines= mod_dir="${ED}/usr/$(get_libdir)/apache2/modules" if use static; then sed -i -e "/%%LOAD_MODULE%%/d" \ @@ -677,23 +676,23 @@ apache-2_src_install() { # drop in a convenient link to the manual if use doc ; then sed -i -e "s:VERSION:${PVR}:" \ - "${ED%/}/etc/apache2/modules.d/00_apache_manual.conf" \ + "${ED}/etc/apache2/modules.d/00_apache_manual.conf" \ || die docompress -x /usr/share/doc/${PF}/manual # 503640 else - rm -f "${ED%/}/etc/apache2/modules.d/00_apache_manual.conf" \ + rm -f "${ED}/etc/apache2/modules.d/00_apache_manual.conf" \ || die - rm -Rf "${ED%/}/usr/share/doc/${PF}/manual" || die + rm -rf "${ED}/usr/share/doc/${PF}/manual" || die fi # the default icons and error pages get stored in # /usr/share/apache2/{error,icons} dodir /usr/share/apache2 - mv -f "${ED%/}/var/www/localhost/error" \ - "${ED%/}/usr/share/apache2/error" || die - mv -f "${ED%/}/var/www/localhost/icons" \ - "${ED%/}/usr/share/apache2/icons" || die - rm -rf "${ED%/}/var/www/localhost/" || die + mv -f "${ED}/var/www/localhost/error" \ + "${ED}/usr/share/apache2/error" || die + mv -f "${ED}/var/www/localhost/icons" \ + "${ED}/usr/share/apache2/icons" || die + rm -rf "${ED}/var/www/localhost/" || die # set some sane permissions for suexec if use suexec ; then diff --git a/eclass/aspell-dict-r1.eclass b/eclass/aspell-dict-r1.eclass index 4d2df961993b..170edb4cacde 100644 --- a/eclass/aspell-dict-r1.eclass +++ b/eclass/aspell-dict-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: aspell-dict-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Seemant Kulleen <seemant@gentoo.org> (original author) # David Seifert <soap@gentoo.org> (-r1 author) -# @SUPPORTED_EAPIS: 7 8 +# @SUPPORTED_EAPIS: 8 # @BLURB: An eclass to streamline the construction of ebuilds for new Aspell dictionaries. # @DESCRIPTION: # The aspell-dict-r1 eclass is designed to streamline the construction of ebuilds for @@ -36,18 +36,13 @@ readonly ASPELL_SPELLANG=${PN/aspell-/} # This value is used to construct SRC_URI strings. # If the value needs to be overridden, it needs to be overridden before inheriting the eclass. -case ${EAPI:-0} in - [7-8]) - ;; - *) - die "${ECLASS}: EAPI ${EAPI:-0} not supported" - ;; +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS src_configure src_install - -if [[ ! ${_ASPELL_DICT_R1} ]]; then -_ASPELL_DICT_R1=1 +if [[ ! ${_ASPELL_DICT_R1_ECLASS} ]]; then +_ASPELL_DICT_R1_ECLASS=1 # Most of those aspell packages have an idiosyncratic versioning scheme, # where the last separating version separator is replaced by a '-'. @@ -86,3 +81,5 @@ aspell-dict-r1_src_install() { } fi + +EXPORT_FUNCTIONS src_configure src_install diff --git a/eclass/bazel.eclass b/eclass/bazel.eclass index 3a8992972d40..8897ea175a84 100644 --- a/eclass/bazel.eclass +++ b/eclass/bazel.eclass @@ -6,25 +6,20 @@ # Jason Zaman <perfinion@gentoo.org> # @AUTHOR: # Jason Zaman <perfinion@gentoo.org> -# @SUPPORTED_EAPIS: 7 8 +# @SUPPORTED_EAPIS: 8 # @BLURB: Utility functions for packages using Bazel Build # @DESCRIPTION: # A utility eclass providing functions to run the Bazel Build system. # # This eclass does not export any phase functions. -case "${EAPI:-0}" in - 0|1|2|3|4|5|6) - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" - ;; - 7|8) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ ! ${_BAZEL_ECLASS} ]]; then +_BAZEL_ECLASS=1 inherit multiprocessing toolchain-funcs @@ -222,5 +217,4 @@ bazel_load_distfiles() { fi } -_BAZEL_ECLASS=1 fi diff --git a/eclass/docs.eclass b/eclass/docs.eclass index 5a63044a8646..cbf35068de3a 100644 --- a/eclass/docs.eclass +++ b/eclass/docs.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Andrew Ammerlaan <andrewammerlaan@gentoo.org> # Based on the work of: Michał Górny <mgorny@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: A simple eclass to build documentation. # @DESCRIPTION: # A simple eclass providing basic functions and variables to build @@ -57,15 +57,9 @@ # ... # @CODE -case "${EAPI:-0}" in - 0|1|2|3|4|5) - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" - ;; - 6|7|8) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac # @ECLASS_VARIABLE: DOCS_BUILDER @@ -152,13 +146,14 @@ esac # will initialize a dummy git repository before compiling. A dependency # on dev-vcs/git is automatically added. -if [[ ! ${_DOCS} ]]; then +if [[ ! ${_DOCS_ECLASS} ]]; then +_DOCS_ECLASS=1 # For the python based DOCS_BUILDERS we need to inherit any python eclass case ${DOCS_BUILDER} in "sphinx"|"mkdocs") # We need the python_gen_any_dep function - if [[ ! ${_PYTHON_R1} && ! ${_PYTHON_ANY_R1} && ! ${_PYTHON_SINGLE_R1} ]]; then + if [[ ! ${_PYTHON_R1_ECLASS} && ! ${_PYTHON_ANY_R1_ECLASS} && ! ${_PYTHON_SINGLE_R1_ECLASS} ]]; then die "distutils-r1, python-r1, python-single-r1 or python-any-r1 needs to be inherited to use python based documentation builders" fi ;; @@ -226,7 +221,7 @@ sphinx_deps() { elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1" fi - if [[ ${_PYTHON_SINGLE_R1} ]]; then + if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then DOCS_DEPEND="$(python_gen_cond_dep "${deps}")" else DOCS_DEPEND="$(python_gen_any_dep "${deps}")" @@ -289,7 +284,7 @@ mkdocs_deps() { elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1" fi - if [[ ${_PYTHON_SINGLE_R1} ]]; then + if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then DOCS_DEPEND="$(python_gen_cond_dep "${deps}")" else DOCS_DEPEND="$(python_gen_any_dep "${deps}")" @@ -423,11 +418,7 @@ esac [[ ${DOCS_INITIALIZE_GIT} ]] && DOCS_DEPEND+=" dev-vcs/git " -if [[ ${EAPI} != 6 ]]; then - BDEPEND+=" doc? ( ${DOCS_DEPEND} )" -else - DEPEND+=" doc? ( ${DOCS_DEPEND} )" -fi +BDEPEND+=" doc? ( ${DOCS_DEPEND} )" # If this is a python package using distutils-r1 # then put the compile function in the specific @@ -437,5 +428,4 @@ if [[ ${_DISTUTILS_R1} && ( ${DOCS_BUILDER}="mkdocs" || ${DOCS_BUILDER}="sphinx" python_compile_all() { docs_compile; } fi -_DOCS=1 fi diff --git a/eclass/dotnet.eclass b/eclass/dotnet.eclass index 319fde893116..b92b9c1b4054 100644 --- a/eclass/dotnet.eclass +++ b/eclass/dotnet.eclass @@ -4,7 +4,7 @@ # @ECLASS: dotnet.eclass # @MAINTAINER: # maintainer-needed@gentoo.org -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 7 # @BLURB: common settings and functions for mono and dotnet related packages # @DESCRIPTION: # The dotnet eclass contains common environment settings that are useful for @@ -13,18 +13,15 @@ # of dotnet packages. case ${EAPI} in - 6) - inherit eapi7-ver multilib - DEPEND="dev-lang/mono" - ;; - 7) - BDEPEND="dev-lang/mono" - ;; - *) - die "${ECLASS}: EAPI ${EAPI:-0} not supported" - ;; + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +if [[ ! ${_DOTNET_ECLASS} ]]; then +_DOTNET_ECLASS=1 + +BDEPEND="dev-lang/mono" + inherit mono-env # @ECLASS_VARIABLE: USE_DOTNET @@ -145,4 +142,6 @@ dotnet_multilib_comply() { fi } +fi + EXPORT_FUNCTIONS pkg_setup diff --git a/eclass/dune.eclass b/eclass/dune.eclass index 1061461b6991..4bc73eda852c 100644 --- a/eclass/dune.eclass +++ b/eclass/dune.eclass @@ -8,12 +8,20 @@ # ML <ml@gentoo.org> # @AUTHOR: # Rafael Kitover <rkitover@gmail.com> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Provides functions for installing Dune packages. # @DESCRIPTION: # Provides dependencies on Dune and OCaml and default src_compile, src_test and # src_install for Dune-based packages. +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_DUNE_ECLASS} ]]; then +_DUNE_ECLASS=1 + # @ECLASS_VARIABLE: DUNE_PKG_NAME # @PRE_INHERIT # @DESCRIPTION: @@ -21,28 +29,20 @@ # Set before inheriting the eclass. : ${DUNE_PKG_NAME:=${PN}} -case ${EAPI:-0} in - 6|7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; -esac - inherit multiprocessing # Do not complain about CFLAGS etc since ml projects do not use them. QA_FLAGS_IGNORED='.*' -EXPORT_FUNCTIONS src_compile src_test src_install - -RDEPEND=">=dev-lang/ocaml-4:=[ocamlopt?] dev-ml/dune:=" -case ${EAPI:-0} in - 6) - DEPEND="${RDEPEND} dev-ml/dune" - ;; - *) - BDEPEND="dev-ml/dune dev-lang/ocaml" - DEPEND="${RDEPEND}" - ;; -esac +RDEPEND=" + >=dev-lang/ocaml-4:=[ocamlopt?] + dev-ml/dune:= +" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-lang/ocaml + dev-ml/dune +" dune_src_compile() { ebegin "Building" @@ -72,9 +72,9 @@ dune-install() { [[ ${#pkgs[@]} -eq 0 ]] && pkgs=( "${DUNE_PKG_NAME}" ) local -a myduneopts=( - --prefix="${ED%/}/usr" - --libdir="${D%/}$(ocamlc -where)" - --mandir="${ED%/}/usr/share/man" + --prefix="${ED}/usr" + --libdir="${D}$(ocamlc -where)" + --mandir="${ED}/usr/share/man" ) local pkg @@ -84,10 +84,10 @@ dune-install() { eend $? || die # Move docs to the appropriate place. - if [ -d "${ED%/}/usr/doc/${pkg}" ] ; then - mkdir -p "${ED%/}/usr/share/doc/${PF}/" || die - mv "${ED%/}/usr/doc/${pkg}" "${ED%/}/usr/share/doc/${PF}/" || die - rm -rf "${ED%/}/usr/doc" || die + if [[ -d "${ED}/usr/doc/${pkg}" ]] ; then + mkdir -p "${ED}/usr/share/doc/${PF}/" || die + mv "${ED}/usr/doc/${pkg}" "${ED}/usr/share/doc/${PF}/" || die + rm -rf "${ED}/usr/doc" || die fi done } @@ -95,3 +95,7 @@ dune-install() { dune_src_install() { dune-install ${1:-${DUNE_PKG_NAME}} } + +fi + +EXPORT_FUNCTIONS src_compile src_test src_install diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass index d1860f5ac9a3..349e72a63af2 100644 --- a/eclass/fcaps.eclass +++ b/eclass/fcaps.eclass @@ -1,10 +1,10 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: fcaps.eclass # @MAINTAINER: # base-system@gentoo.org -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: function to set POSIX file-based capabilities # @DESCRIPTION: # This eclass provides a function to set file-based capabilities on binaries. @@ -30,8 +30,8 @@ # @CODE case ${EAPI} in - 6|7|8) ;; - *) die "EAPI ${EAPI:-0} is unsupported" ;; + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ -z ${_FCAPS_ECLASS} ]]; then @@ -41,8 +41,8 @@ IUSE="+filecaps" # Since it is needed in pkg_postinst() it must be in IDEPEND case ${EAPI} in - 7) BDEPEND="filecaps? ( sys-libs/libcap )" ;& # fallthrough - 6) RDEPEND="filecaps? ( sys-libs/libcap )" ;; + 7) BDEPEND="filecaps? ( sys-libs/libcap )" + RDEPEND="filecaps? ( sys-libs/libcap )" ;; *) IDEPEND="filecaps? ( sys-libs/libcap )" ;; esac diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass index e80a517ee0da..a701b58fd9e7 100644 --- a/eclass/gnome2.eclass +++ b/eclass/gnome2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: gnome2.eclass @@ -235,7 +235,7 @@ gnome2_src_install() { # create bogus directories in /var/lib/ if has ${EAPI} 5; then dodir "${sk_tmp_dir}" || die "dodir failed" - emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed" + emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install else default fi diff --git a/eclass/gnustep-base.eclass b/eclass/gnustep-base.eclass index 5e839bd0702d..f967a527282a 100644 --- a/eclass/gnustep-base.eclass +++ b/eclass/gnustep-base.eclass @@ -172,7 +172,7 @@ egnustep_env() { # Make utilizing GNUstep Makefiles egnustep_make() { if [[ -f ./Makefile || -f ./makefile || -f ./GNUmakefile ]] ; then - emake ${*} "${GS_ENV[@]}" all || die "package make failed" + emake ${*} "${GS_ENV[@]}" all return 0 fi die "no Makefile found" @@ -185,7 +185,7 @@ egnustep_install() { mkdir -p "${D}"${GNUSTEP_SYSTEM_TOOLS} fi if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then - emake ${*} "${GS_ENV[@]}" install || die "package install failed" + emake ${*} "${GS_ENV[@]}" install return 0 fi die "no Makefile found" @@ -197,8 +197,8 @@ egnustep_doc() { # Check documentation presence pushd "${S}"/Documentation || die if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then - emake "${GS_ENV[@]}" all || die "doc make failed" - emake "${GS_ENV[@]}" install || die "doc install failed" + emake "${GS_ENV[@]}" all + emake "${GS_ENV[@]}" install fi popd || die fi diff --git a/eclass/java-osgi.eclass b/eclass/java-osgi.eclass index 2043cbfb2d89..7019fab7b203 100644 --- a/eclass/java-osgi.eclass +++ b/eclass/java-osgi.eclass @@ -1,4 +1,4 @@ -# Copyright 2007-2021 Gentoo Authors +# Copyright 2007-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: java-osgi.eclass @@ -6,7 +6,7 @@ # java@gentoo.org # @AUTHOR: # Java maintainers <java@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @PROVIDES: java-utils-2 # @BLURB: Java OSGi eclass # @DESCRIPTION: @@ -15,8 +15,8 @@ # in their manifests. Currently this is used only by Eclipse-3.3 - later we # could extend this so that Gentoo Java system would be fully OSGi compliant. -case ${EAPI:-0} in - [5678]) ;; +case ${EAPI} in + 7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -28,12 +28,9 @@ inherit java-utils-2 # @ECLASS_VARIABLE: _OSGI_T # @INTERNAL # @DESCRIPTION: -# We define _OSGI_T so that it does not contain a slash at the end. -# According to Paludis guys, there is currently a proposal for EAPIs that -# would require all variables to end with a slash. -_OSGI_T="${T/%\//}" +_OSGI_T="${T}" -# must get Diego to commit something like this to portability.eclass +# TODO add to portability.eclass _canonicalise() { if type -p realpath > /dev/null; then realpath "${@}" diff --git a/eclass/java-virtuals-2.eclass b/eclass/java-virtuals-2.eclass index d827342e9ba2..842fbe0cc077 100644 --- a/eclass/java-virtuals-2.eclass +++ b/eclass/java-virtuals-2.eclass @@ -6,14 +6,14 @@ # java@gentoo.org # @AUTHOR: # Original Author: Alistair John Bush <ali_bush@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 8 # @BLURB: Java virtuals eclass # @DESCRIPTION: # To provide a default (and only) src_install function for ebuilds in the # java-virtuals category. -case ${EAPI:-0} in - [5678]) ;; +case ${EAPI} in + 8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 2cf88f0ff238..e13ed1a4f5ba 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -22,7 +22,7 @@ # @DESCRIPTION: # Utilized for 32-bit userland on ppc64. -# @ECLASS_VARIABLE: CKV +# @ECLASS_VARIABLE: CKV # @DEFAULT_UNSET # @DESCRIPTION: # Used as a comparison kernel version, which is used when @@ -187,36 +187,36 @@ # Apply genpatches to kernel source. Provide any # combination of "base", "extras" or "experimental". -# @ECLASS_VARIABLE: KERNEL_URI +# @ECLASS_VARIABLE: KERNEL_URI # @DEFAULT_UNSET # @DESCRIPTION: # Upstream kernel src URI -# @ECLASS_VARIABLE: KV +# @ECLASS_VARIABLE: KV # @DEFAULT_UNSET # @OUTPUT_VARIABLE # @DESCRIPTION: # Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1) -# @ECLASS_VARIABLE: KV_FULL +# @ECLASS_VARIABLE: KV_FULL # @DEFAULT_UNSET # @OUTPUT_VARIABLE # @DESCRIPTION: # Kernel full version -# @ECLASS_VARIABLE: KV_MAJOR +# @ECLASS_VARIABLE: KV_MAJOR # @DEFAULT_UNSET # @OUTPUT_VARIABLE # @DESCRIPTION: # Kernel major version from <KV_MAJOR>.<KV_MINOR>.<KV_PATCH -# @ECLASS_VARIABLE: KV_MINOR +# @ECLASS_VARIABLE: KV_MINOR # @DEFAULT_UNSET # @OUTPUT_VARIABLE # @DESCRIPTION: # Kernel minor version from <KV_MAJOR>.<KV_MINOR>.<KV_PATCH -# @ECLASS_VARIABLE: KV_PATCH +# @ECLASS_VARIABLE: KV_PATCH # @DEFAULT_UNSET # @OUTPUT_VARIABLE # @DESCRIPTION: @@ -227,12 +227,12 @@ # @DESCRIPTION: # Default cflags if not already set -# @ECLASS_VARIABLE: OKV +# @ECLASS_VARIABLE: OKV # @DEFAULT_UNSET # @DESCRIPTION: # Original Kernel Version (2.6.0/2.6.0-test11) -# @ECLASS_VARIABLE: RELEASE +# @ECLASS_VARIABLE: RELEASE # @DEFAULT_UNSET # @DESCRIPTION: # Representative of the kernel release tag (-rc3/-git3) @@ -261,15 +261,15 @@ # @DESCRIPTION: # space delimetered list of patches to be applied to the kernel -# @ECLASS_VARIABLE: UNIPATCH_LIST_DEFAULT +# @ECLASS_VARIABLE: UNIPATCH_LIST_DEFAULT # @INTERNAL # @DESCRIPTION: # Upstream kernel patch archive -# @ECLASS_VARIABLE: UNIPATCH_LIST_GENPATCHES +# @ECLASS_VARIABLE: UNIPATCH_LIST_GENPATCHES # @INTERNAL # @DESCRIPTION: -# List of genpatches archives to apply to the kernel +# List of genpatches archives to apply to the kernel # @ECLASS_VARIABLE: UNIPATCH_STRICTORDER # @DEFAULT_UNSET @@ -646,7 +646,7 @@ kernel_is() { eq) operator="-eq"; shift;; *) operator="-eq";; esac - [[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many parameters" + [[ $# -gt 3 ]] && die "Error in ${ECLASS}_${FUNCNAME}(): too many parameters" ver_test \ "${KV_MAJOR:-0}.${KV_MINOR:-0}.${KV_PATCH:-0}" \ @@ -1190,14 +1190,14 @@ unipatch() { fi done - #populate KPATCH_DIRS so we know where to look to remove the excludes + # Populate KPATCH_DIRS so we know where to look to remove the excludes x=${KPATCH_DIR} KPATCH_DIR="" for i in $(find ${x} -type d | sort -n); do KPATCH_DIR="${KPATCH_DIR} ${i}" done - #so now lets get rid of the patchno's we want to exclude + # So now lets get rid of the patch numbers we want to exclude UNIPATCH_DROP="${UNIPATCH_EXCLUDE} ${UNIPATCH_DROP}" for i in ${UNIPATCH_DROP}; do ebegin "Excluding Patch #${i}" @@ -1224,7 +1224,7 @@ unipatch() { # addition of a file with the same name as the symlink in the # # same location; this causes the dry-run to fail, see bug #507656. # # # - # https://bugs.gentoo.org/show_bug.cgi?id=507656 # + # https://bugs.gentoo.org/507656 # #################################################################### if [[ -n ${K_NODRYRUN} ]]; then ebegin "Applying ${i/*\//} (-p1)" diff --git a/eclass/libretro-core.eclass b/eclass/libretro-core.eclass index e4f7221a5408..55d7e9f11513 100644 --- a/eclass/libretro-core.eclass +++ b/eclass/libretro-core.eclass @@ -1,4 +1,4 @@ -# Copyright 2018-2021 Gentoo Authors +# Copyright 2018-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: libretro-core.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Cecil Curry <leycec@gmail.com> # Craig Andrews <candrews@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 7 # @BLURB: Simplify libretro core ebuilds # @DESCRIPTION: # The libretro eclass is designed to streamline the construction of @@ -34,6 +34,11 @@ # SLOT="0" # @CODE +case ${EAPI} in + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + if [[ -z ${_LIBRETRO_CORE_ECLASS} ]]; then _LIBRETRO_CORE_ECLASS=1 @@ -78,14 +83,6 @@ else fi inherit flag-o-matic toolchain-funcs -case "${EAPI:-0}" in - 6|7) - EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install - ;; - *) - die "EAPI=${EAPI} is not supported" ;; -esac - # @FUNCTION: libretro-core_src_unpack # @DESCRIPTION: # The libretro-core src_unpack function which is exported. @@ -210,3 +207,5 @@ libretro-core_src_install() { } fi # end _LIBRETRO_CORE_ECLASS guard + +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 3e64cb9457a9..16ef69ebccb8 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.eclass @@ -140,13 +140,12 @@ KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}" # A read-only variable. It's a string containing the kernel object directory, will be KV_DIR unless # KBUILD_OUTPUT is used. This should be used for referencing .config. - # @ECLASS_VARIABLE: SKIP_KERNEL_CHECK # @USER_VARIABLE # @DEFAULT_UNSET # @DESCRIPTION: -# Do not check for kernel sources or a running kernel version -# Main use-case is for chroots +# Do not check for kernel sources or a running kernel version. +# Main use-case is for chroots. # This is a user flag and should under _no circumstances_ be set in the ebuild. : ${SKIP_KERNEL_CHECK:=""} @@ -156,8 +155,7 @@ inherit toolchain-funcs EXPORT_FUNCTIONS pkg_setup -# Bug fixes -# fix to bug #75034 +# bug #75034 case ${ARCH} in ppc) BUILD_FIXES="${BUILD_FIXES} TOUT=${T}/.tmp_gas_check";; ppc64) BUILD_FIXES="${BUILD_FIXES} TOUT=${T}/.tmp_gas_check";; @@ -175,7 +173,7 @@ set_arch_to_pkgmgr() { export ARCH=$(tc-arch); } # @FUNCTION: qout # @DESCRIPTION: -# qout <einfo | ewarn | eerror> is a quiet call when EBUILD_PHASE should not have visible output. +# qout <einfo | ewarn | eerror> is a quiet call when EBUILD_PHASE should not have visible output. qout() { local outputmsg type type=${1} @@ -186,7 +184,7 @@ qout() { clean) unset outputmsg;; preinst) unset outputmsg;; esac - [ -n "${outputmsg}" ] && ${type} "${outputmsg}" + [[ -n "${outputmsg}" ]] && ${type} "${outputmsg}" } # @FUNCTION: qeinfo @@ -196,14 +194,12 @@ qeinfo() { qout einfo "${@}" ; } # @FUNCTION: qewarn # @DESCRIPTION: -# qewarn is a quiet ewarn call when EBUILD_PHASE -# should not have visible output. +# qewarn is a quiet ewarn call when EBUILD_PHASE should not have visible output. qewarn() { qout ewarn "${@}" ; } # @FUNCTION: qeerror # @DESCRIPTION: -# qeerror is a quiet error call when EBUILD_PHASE -# should not have visible output. +# qeerror is a quiet error call when EBUILD_PHASE should not have visible output. qeerror() { qout eerror "${@}" ; } # File Functions @@ -213,18 +209,17 @@ qeerror() { qout eerror "${@}" ; } # @USAGE: <variable> <configfile> # @RETURN: the value of the variable # @DESCRIPTION: -# It detects the value of the variable defined in the file configfile. This is -# done by including the configfile, and printing the variable with Make. +# It detects the value of the variable defined in the file 'configfile'. This is +# done by including the 'configfile', and printing the variable with Make. # It WILL break if your makefile has missing dependencies! getfilevar() { local ERROR basefname basedname myARCH="${ARCH}" ERROR=0 - [ -z "${1}" ] && ERROR=1 - [ ! -f "${2}" ] && ERROR=1 + [[ -z "${1}" ]] && ERROR=1 + [[ ! -f "${2}" ]] && ERROR=1 - if [ "${ERROR}" = 1 ] - then + if [[ "${ERROR}" = 1 ]]; then echo -e "\n" eerror "getfilevar requires 2 variables, with the second a valid file." eerror " getfilevar <VARIABLE> <CONFIGFILE>" @@ -250,7 +245,7 @@ getfilevar() { # @USAGE: <variable> <configfile> # @RETURN: the value of the variable # @DESCRIPTION: -# It detects the value of the variable defined in the file configfile. +# It detects the value of the variable defined in the file 'configfile'. # This is done with sed matching an expression only. If the variable is defined, # you will run into problems. See getfilevar for those cases. getfilevar_noexec() { @@ -258,12 +253,11 @@ getfilevar_noexec() { ERROR=0 mycat='cat' - [ -z "${1}" ] && ERROR=1 - [ ! -f "${2}" ] && ERROR=1 - [ "${2%.gz}" != "${2}" ] && mycat='zcat' + [[ -z "${1}" ]] && ERROR=1 + [[ ! -f "${2}" ]] && ERROR=1 + [[ "${2%.gz}" != "${2}" ]] && mycat='zcat' - if [ "${ERROR}" = 1 ] - then + if [[ "${ERROR}" = 1 ]]; then echo -e "\n" eerror "getfilevar_noexec requires 2 variables, with the second a valid file." eerror " getfilevar_noexec <VARIABLE> <CONFIGFILE>" @@ -293,7 +287,8 @@ _LINUX_CONFIG_EXISTS_DONE= # Helper funciton which returns an error before the function argument is run if no config exists linux_config_qa_check() { local f="$1" - if [ -z "${_LINUX_CONFIG_EXISTS_DONE}" ]; then + + if [[ -z "${_LINUX_CONFIG_EXISTS_DONE}" ]]; then ewarn "QA: You called $f before any linux_config_exists!" ewarn "QA: The return value of $f will NOT guaranteed later!" fi @@ -351,7 +346,6 @@ linux_config_path() { # This function verifies that the current kernel is configured (it checks against the existence of .config) # otherwise it dies. require_configured_kernel() { - [[ -n ${SKIP_KERNEL_CHECK} ]] && return if ! use kernel_linux; then @@ -365,6 +359,7 @@ require_configured_kernel() { qeerror "it points to the necessary object directory so that it might find .config." die "Kernel not configured; no .config found in ${KV_OUT_DIR}" fi + get_version || die "Unable to determine configured kernel version" } @@ -445,7 +440,7 @@ kernel_is() { die "${FUNCNAME}() called on non-Linux system, please fix the ebuild" fi - # if we haven't determined the version yet, we need to. + # If we haven't determined the version yet, we need to. linux-info_get_any_version # Now we can continue @@ -459,7 +454,7 @@ kernel_is() { eq) operator="-eq"; shift;; *) operator="-eq";; esac - [[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many parameters" + [[ $# -gt 3 ]] && die "Error in ${ECLASS}_${FUNCNAME}(): too many parameters" ver_test \ "${KV_MAJOR:-0}.${KV_MINOR:-0}.${KV_PATCH:-0}" \ @@ -488,7 +483,7 @@ get_makefile_extract_function() { # @ECLASS_VARIABLE: get_version_warning_done # @INTERNAL -# @DESCRIPTION: +# @DESCRIPTION: # Internal variable, so we know to only print the warning once. get_version_warning_done= @@ -511,26 +506,25 @@ get_version() { [[ -n ${SKIP_KERNEL_CHECK} ]] && return - # no need to execute this twice assuming KV_FULL is populated. - # we can force by unsetting KV_FULL - [ -n "${KV_FULL}" ] && return 0 + # No need to execute this twice assuming KV_FULL is populated. + # We can force by unsetting KV_FULL. + [[ -n "${KV_FULL}" ]] && return 0 - # if we dont know KV_FULL, then we need too. - # make sure KV_DIR isnt set since we need to work it out via KERNEL_DIR + # If we don't know KV_FULL, then we need to. + # Make sure KV_DIR isn't set since we need to work it out via KERNEL_DIR. unset KV_DIR # KV_DIR will contain the full path to the sources directory we should use - [ -z "${get_version_warning_done}" ] && \ + [[ -z "${get_version_warning_done}" ]] && \ qeinfo "Determining the location of the kernel source code" - [ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}" + [[ -d "${KERNEL_DIR}" ]] && KV_DIR="${KERNEL_DIR}" - if [ -z "${KV_DIR}" ] - then - if [ -z "${get_version_warning_done}" ]; then + if [[ -z "${KV_DIR}" ]]; then + if [[ -z "${get_version_warning_done}" ]]; then get_version_warning_done=1 qewarn "Unable to find kernel sources at ${KERNEL_DIR}" #qeinfo "This package requires Linux sources." - if [ "${KERNEL_DIR}" == "/usr/src/linux" ] ; then + if [[ "${KERNEL_DIR}" == "/usr/src/linux" ]] ; then qeinfo "Please make sure that ${KERNEL_DIR} points at your running kernel, " qeinfo "(or the kernel you wish to build against)." qeinfo "Alternatively, set the KERNEL_DIR environment variable to the kernel sources location" @@ -542,22 +536,21 @@ get_version() { fi # See if the kernel dir is actually an output dir. #454294 - if [ -z "${KBUILD_OUTPUT}" -a -L "${KERNEL_DIR}/source" ]; then + if [[ -z "${KBUILD_OUTPUT}" && -L "${KERNEL_DIR}/source" ]]; then KBUILD_OUTPUT=${KERNEL_DIR} KERNEL_DIR=$(readlink -f "${KERNEL_DIR}/source") KV_DIR=${KERNEL_DIR} fi - if [ -z "${get_version_warning_done}" ]; then + if [[ -z "${get_version_warning_done}" ]]; then qeinfo "Found kernel source directory:" qeinfo " ${KV_DIR}" fi kernel_get_makefile - if [[ ! -s ${KERNEL_MAKEFILE} ]] - then - if [ -z "${get_version_warning_done}" ]; then + if [[ ! -s ${KERNEL_MAKEFILE} ]]; then + if [[ -z "${get_version_warning_done}" ]]; then get_version_warning_done=1 qeerror "Could not find a Makefile in the kernel source directory." qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources" @@ -567,8 +560,9 @@ get_version() { # OK so now we know our sources directory, but they might be using # KBUILD_OUTPUT, and we need this for .config and localversions-* - # so we better find it eh? - # do we pass KBUILD_OUTPUT on the CLI? + # so we better find it, eh? + # + # Do we pass KBUILD_OUTPUT on the CLI? local OUTPUT_DIR=${KBUILD_OUTPUT} if [[ -z ${OUTPUT_DIR} ]]; then @@ -579,17 +573,16 @@ get_version() { OUTPUT_DIR=$(${mkfunc} KBUILD_OUTPUT "${KERNEL_MAKEFILE}") fi - # And contrary to existing functions I feel we shouldn't trust the + # And contrary to existing functions, I feel we shouldn't trust the # directory name to find version information as this seems insane. - # So we parse ${KERNEL_MAKEFILE}. + # So we parse ${KERNEL_MAKEFILE}. KV_MAJOR=$(getfilevar VERSION "${KERNEL_MAKEFILE}") KV_MINOR=$(getfilevar PATCHLEVEL "${KERNEL_MAKEFILE}") KV_PATCH=$(getfilevar SUBLEVEL "${KERNEL_MAKEFILE}") KV_EXTRA=$(getfilevar EXTRAVERSION "${KERNEL_MAKEFILE}") - if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ] - then - if [ -z "${get_version_warning_done}" ]; then + if [[ -z "${KV_MAJOR}" || -z "${KV_MINOR}" || -z "${KV_PATCH}" ]]; then + if [[ -z "${get_version_warning_done}" ]]; then get_version_warning_done=1 qeerror "Could not detect kernel version." qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources." @@ -597,9 +590,8 @@ get_version() { return 1 fi - [ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}" - if [ -n "${KV_OUT_DIR}" ]; - then + [[ -d "${OUTPUT_DIR}" ]] && KV_OUT_DIR="${OUTPUT_DIR}" + if [[ -n "${KV_OUT_DIR}" ]]; then qeinfo "Found kernel object directory:" qeinfo " ${KV_OUT_DIR}" fi @@ -609,9 +601,9 @@ get_version() { # Grab the kernel release from the output directory. # TODO: we MUST detect kernel.release being out of date, and 'return 1' from # this function. - if [ -s "${KV_OUT_DIR}"/include/config/kernel.release ]; then + if [[ -s "${KV_OUT_DIR}"/include/config/kernel.release ]]; then KV_LOCAL=$(<"${KV_OUT_DIR}"/include/config/kernel.release) - elif [ -s "${KV_OUT_DIR}"/.kernelrelease ]; then + elif [[ -s "${KV_OUT_DIR}"/.kernelrelease ]]; then KV_LOCAL=$(<"${KV_OUT_DIR}"/.kernelrelease) else KV_LOCAL= @@ -624,13 +616,13 @@ get_version() { # Clear out KV_LOCAL in that case. # TODO: this does not detect a change in the localversion part between # kernel.release and the value that would be generated. - if [ "$KV_LOCAL" = "$tmplocal" ]; then + if [[ "${KV_LOCAL}" = "${tmplocal}" ]]; then KV_LOCAL= else - KV_LOCAL=$tmplocal + KV_LOCAL=${tmplocal} fi - # and in newer versions we can also pull LOCALVERSION if it is set. + # and in newer versions, we can also pull LOCALVERSION if it is set. # but before we do this, we need to find if we use a different object directory. # This *WILL* break if the user is using localversions, but we assume it was # caught before this if they are. @@ -718,7 +710,7 @@ check_kernel_built() { die "${FUNCNAME}() called on non-Linux system, please fix the ebuild" fi - # if we haven't determined the version yet, we need to + # If we haven't determined the version yet, we need to [[ -n ${SKIP_KERNEL_CHECK} ]] && return @@ -731,8 +723,7 @@ check_kernel_built() { versionh_path="include/linux/version.h" fi - if [ ! -f "${KV_OUT_DIR}/${versionh_path}" ] - then + if [[ ! -f "${KV_OUT_DIR}/${versionh_path}" ]]; then eerror "These sources have not yet been prepared." eerror "We cannot build against an unprepared tree." eerror "To resolve this, please type the following:" @@ -754,7 +745,7 @@ check_modules_supported() { die "${FUNCNAME}() called on non-Linux system, please fix the ebuild" fi - # if we haven't determined the version yet, we need too. + # If we haven't determined the version yet, we need to. require_configured_kernel if ! linux_chkconfig_builtin "MODULES"; then @@ -774,12 +765,12 @@ check_extra_config() { local config negate die error reworkmodulenames local soft_errors_count=0 hard_errors_count=0 config_required=0 - # store the value of the QA check, because otherwise we won't catch usages + # Store the value of the QA check, because otherwise we won't catch usages # after if check_extra_config is called AND other direct calls are done # later. local old_LINUX_CONFIG_EXISTS_DONE="${_LINUX_CONFIG_EXISTS_DONE}" - # if we haven't determined the version yet, we need to + # If we haven't determined the version yet, we need to. linux-info_get_any_version # Determine if we really need a .config. The only time when we don't need @@ -820,9 +811,8 @@ check_extra_config() { ebegin "Checking for suitable kernel configuration options" - for config in ${CONFIG_CHECK} - do - # if we specify any fatal, ensure we honor them + for config in ${CONFIG_CHECK}; do + # If we specify any fatal, ensure we honor them die=1 error=0 negate=0 @@ -919,7 +909,7 @@ check_zlibinflate() { die "${FUNCNAME}() called on non-Linux system, please fix the ebuild" fi - # if we haven't determined the version yet, we need to + # If we haven't determined the version yet, we need to. require_configured_kernel # although I restructured this code - I really really really dont support it! @@ -951,15 +941,15 @@ check_zlibinflate() { LINENO_END="$(grep -n 'CONFIG_ZLIB_INFLATE y' ${KV_DIR}/lib/Config.in | cut -d : -f 1)" LINENO_START="$(head -n $LINENO_END ${KV_DIR}/lib/Config.in | grep -n 'if \[' | tail -n 1 | cut -d : -f 1)" - (( LINENO_AMOUNT = $LINENO_END - $LINENO_START )) - (( LINENO_END = $LINENO_END - 1 )) + (( LINENO_AMOUNT = ${LINENO_END} - ${LINENO_START} )) + (( LINENO_END = ${LINENO_END} - 1 )) SYMBOLS="$(head -n $LINENO_END ${KV_DIR}/lib/Config.in | tail -n $LINENO_AMOUNT | sed -e 's/^.*\(CONFIG_[^\" ]*\).*/\1/g;')" # okay, now we have a list of symbols # we need to check each one in turn, to see whether it is set or not - for x in $SYMBOLS ; do - if [ "${!x}" = "y" ]; then - # we have a winner! + for x in ${SYMBOLS} ; do + if [[ "${!x}" = "y" ]]; then + # We have a winner! einfo "${x} ensures zlib is linked into your kernel - excellent" return 0 fi @@ -974,7 +964,7 @@ check_zlibinflate() { eerror "Please ensure that you enable at least one of these options:" eerror - for x in $SYMBOLS ; do + for x in ${SYMBOLS} ; do eerror " * $x" done @@ -997,7 +987,7 @@ linux-info_pkg_setup() { linux-info_get_any_version - [[ -n "${CONFIG_CHECK}" && -z ${CHECKCONFIG_DONOTHING} ]] && check_extra_config; + [[ -n "${CONFIG_CHECK}" && -z ${CHECKCONFIG_DONOTHING} ]] && check_extra_config } # @FUNCTION: kernel_get_makefile diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass index ff2294f1e4ef..aea2a38f233e 100644 --- a/eclass/linux-mod.eclass +++ b/eclass/linux-mod.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # John Mylchreest <johnm@gentoo.org>, # Stefan Schweizer <genstef@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @PROVIDES: linux-info # @BLURB: It provides the functionality required to install external modules against a kernel source tree. # @DESCRIPTION: @@ -149,12 +149,8 @@ # @DESCRIPTION: # It's a read-only variable. It contains the extension of the kernel modules. -case ${EAPI:-0} in - [67]) - inherit eutils - ;; - 8) - ;; +case ${EAPI} in + 7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -170,10 +166,6 @@ case ${MODULES_OPTIONAL_USE_IUSE_DEFAULT:-n} in *) _modules_optional_use_iuse_default='+' ;; esac -[[ -n "${_modules_optional_use_iuse_default}" ]] && case ${EAPI:-0} in - 0) die "EAPI=${EAPI} is not supported with MODULES_OPTIONAL_USE_IUSE_DEFAULT due to lack of IUSE defaults" ;; -esac - IUSE="dist-kernel ${MODULES_OPTIONAL_USE:+${_modules_optional_use_iuse_default}}${MODULES_OPTIONAL_USE}" SLOT="0" @@ -199,14 +191,13 @@ DEPEND="${RDEPEND} use_m() { debug-print-function ${FUNCNAME} $* - # if we haven't determined the version yet, we need too. - get_version; + # If we haven't determined the version yet, we need to. + get_version - # if the kernel version is greater than 2.6.6 then we should use + # If the kernel version is greater than 2.6.6 then we should use # M= instead of SUBDIRS= - [ ${KV_MAJOR} -ge 3 ] && return 0 - [ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -gt 5 -a ${KV_PATCH} -gt 5 ] && \ - return 0 || return 1 + [[ ${KV_MAJOR} -ge 3 ]] && return 0 + [[ ${KV_MAJOR} -eq 2 && ${KV_MINOR} -gt 5 && ${KV_PATCH} -gt 5 ]] } # @FUNCTION: convert_to_m @@ -216,10 +207,10 @@ use_m() { convert_to_m() { debug-print-function ${FUNCNAME} $* - if use_m - then - [ ! -f "${1}" ] && \ + if use_m; then + [[ ! -f "${1}" ]] && \ die "convert_to_m() requires a filename as an argument" + ebegin "Converting ${1/${WORKDIR}\//} to use M= instead of SUBDIRS=" sed -i 's:SUBDIRS=:M=:g' "${1}" eend $? @@ -233,12 +224,11 @@ convert_to_m() { update_depmod() { debug-print-function ${FUNCNAME} $* - # if we haven't determined the version yet, we need too. - get_version; + # If we haven't determined the version yet, we need to. + get_version ebegin "Updating module dependencies for ${KV_FULL}" - if [ -r "${KV_OUT_DIR}"/System.map ] - then + if [[ -r "${KV_OUT_DIR}"/System.map ]]; then depmod -ae -F "${KV_OUT_DIR}"/System.map -b "${ROOT:-/}" ${KV_FULL} eend $? else @@ -257,8 +247,8 @@ update_depmod() { move_old_moduledb() { debug-print-function ${FUNCNAME} $* - local OLDDIR="${ROOT%/}"/usr/share/module-rebuild - local NEWDIR="${ROOT%/}"/var/lib/module-rebuild + local OLDDIR="${ROOT}"/usr/share/module-rebuild + local NEWDIR="${ROOT}"/var/lib/module-rebuild if [[ -f "${OLDDIR}"/moduledb ]]; then [[ ! -d "${NEWDIR}" ]] && mkdir -p "${NEWDIR}" @@ -275,7 +265,7 @@ move_old_moduledb() { update_moduledb() { debug-print-function ${FUNCNAME} $* - local MODULEDB_DIR="${ROOT%/}"/var/lib/module-rebuild + local MODULEDB_DIR="${ROOT}"/var/lib/module-rebuild move_old_moduledb if [[ ! -f "${MODULEDB_DIR}"/moduledb ]]; then @@ -295,7 +285,7 @@ update_moduledb() { remove_moduledb() { debug-print-function ${FUNCNAME} $* - local MODULEDB_DIR="${ROOT%/}"/var/lib/module-rebuild + local MODULEDB_DIR="${ROOT}"/var/lib/module-rebuild move_old_moduledb if grep -qs ${CATEGORY}/${PN}-${PVR} "${MODULEDB_DIR}"/moduledb ; then @@ -310,15 +300,15 @@ remove_moduledb() { set_kvobj() { debug-print-function ${FUNCNAME} $* - if kernel_is ge 2 6 - then + if kernel_is ge 2 6; then KV_OBJ="ko" else KV_OBJ="o" fi + # Do we really need to know this? - # Lets silence it. - # einfo "Using KV_OBJ=${KV_OBJ}" + # Let's silence it. + #einfo "Using KV_OBJ=${KV_OBJ}" } # @FUNCTION: get-KERNEL_CC @@ -334,7 +324,7 @@ get-KERNEL_CC() { fi local kernel_cc - if [ -n "${KERNEL_ABI}" ]; then + if [[ -n "${KERNEL_ABI}" ]]; then # In future, an arch might want to define CC_$ABI #kernel_cc="$(get_abi_CC)" #[ -z "${kernel_cc}" ] && @@ -358,14 +348,13 @@ get-KERNEL_CC() { # At the end the documentation specified with MODULESD_<modulename>_DOCS is installed. generate_modulesd() { debug-print-function ${FUNCNAME} $* - [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return + [[ -n "${MODULES_OPTIONAL_USE}" ]] && use !${MODULES_OPTIONAL_USE} && return local currm_path currm currm_t t myIFS myVAR local module_docs module_enabled module_aliases \ module_additions module_examples module_modinfo module_opts - for currm_path in ${@} - do + for currm_path in ${@}; do currm=${currm_path//*\/} currm=$(echo ${currm} | tr '[:lower:]' '[:upper:]') currm_t=${currm} @@ -388,8 +377,7 @@ generate_modulesd() { [[ ${module_enabled} == no ]] && return 0 # unset any unwanted variables. - for t in ${!module_*} - do + for t in ${!module_*}; do [[ -z ${!t} ]] && unset ${t} done @@ -427,19 +415,16 @@ generate_modulesd() { fi #----------------------------------------------------------------------- - if [[ -n ${module_modinfo} ]] - then + if [[ -n ${module_modinfo} ]]; then echo >> "${module_config}" echo "# Configurable module parameters" >> "${module_config}" echo "# ------------------------------" >> "${module_config}" myIFS="${IFS}" IFS="$(echo -en "\n\b")" - for t in ${module_modinfo} - do + for t in ${module_modinfo}; do myVAR="$(echo ${t#*:} | grep -o "[^ ]*[0-9][ =][^ ]*" | tail -1 | grep -o "[0-9]")" - if [[ -n ${myVAR} ]] - then + if [[ -n ${myVAR} ]]; then module_opts="${module_opts} ${t%%:*}:${myVAR}" fi echo -e "# ${t%%:*}:\t${t#*:}" >> "${module_config}" @@ -449,11 +434,9 @@ generate_modulesd() { fi #----------------------------------------------------------------------- - if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]] - then - # So lets do some guesswork eh? - if [[ -n ${module_opts} ]] - then + if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]; then + # So, let's do some guesswork, eh? + if [[ -n ${module_opts} ]]; then echo "# For Example..." >> "${module_config}" echo "# --------------" >> "${module_config}" for t in ${module_opts} @@ -462,12 +445,10 @@ generate_modulesd() { done echo '' >> "${module_config}" fi - elif [[ ${module_examples} -gt 0 ]] - then + elif [[ ${module_examples} -gt 0 ]]; then echo "# For Example..." >> "${module_config}" echo "# --------------" >> "${module_config}" - for((t=0; t<${module_examples}; t++)) - do + for ((t=0; t<${module_examples}; t++)); do echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \ >> "${module_config}" done @@ -475,10 +456,8 @@ generate_modulesd() { fi #----------------------------------------------------------------------- - if [[ ${module_additions} -gt 0 ]] - then - for((t=0; t<${module_additions}; t++)) - do + if [[ ${module_additions} -gt 0 ]]; then + for ((t=0; t<${module_additions}; t++)); do echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \ >> "${module_config}" done @@ -510,8 +489,7 @@ find_module_params() { local matched_offset=0 matched_opts=0 test="${@}" temp_var result local i=0 y=0 z=0 - for((i=0; i<=${#test}; i++)) - do + for ((i=0; i<=${#test}; i++)); do case ${test:${i}:1} in \() matched_offset[0]=${i};; \:) matched_opts=$((${matched_opts} + 1)); @@ -521,8 +499,7 @@ find_module_params() { esac done - for((i=0; i<=${matched_opts}; i++)) - do + for ((i=0; i<=${matched_opts}; i++)); do # i = offset were working on # y = last offset # z = current offset - last offset @@ -556,7 +533,7 @@ find_module_params() { # in the kernel and sets the object extension KV_OBJ. linux-mod_pkg_setup() { debug-print-function ${FUNCNAME} $* - [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return + [[ -n "${MODULES_OPTIONAL_USE}" ]] && use !${MODULES_OPTIONAL_USE} && return local is_bin="${MERGE_TYPE}" @@ -569,12 +546,12 @@ linux-mod_pkg_setup() { # External modules use kernel symbols (bug #591832) CONFIG_CHECK+=" !TRIM_UNUSED_KSYMS" - linux-info_pkg_setup; + linux-info_pkg_setup require_configured_kernel - check_kernel_built; - strip_modulenames; + check_kernel_built + strip_modulenames [[ -n ${MODULE_NAMES} ]] && check_modules_supported - set_kvobj; + set_kvobj } # @FUNCTION: linux-mod_pkg_setup_binary @@ -586,13 +563,13 @@ linux-mod_pkg_setup_binary() { debug-print-function ${FUNCNAME} $* local new_CONFIG_CHECK # ~ needs always to be quoted, else bash expands it. - for config in $CONFIG_CHECK ; do + for config in ${CONFIG_CHECK} ; do optional='~' [[ ${config:0:1} == "~" ]] && optional='' new_CONFIG_CHECK="${new_CONFIG_CHECK} ${optional}${config}" done CONFIG_CHECK="${new_CONFIG_CHECK}" - linux-info_pkg_setup; + linux-info_pkg_setup } # @FUNCTION: strip_modulenames @@ -617,7 +594,7 @@ strip_modulenames() { # Look at the description of these variables for more details. linux-mod_src_compile() { debug-print-function ${FUNCNAME} $* - [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return + [[ -n "${MODULES_OPTIONAL_USE}" ]] && use !${MODULES_OPTIONAL_USE} && return local modulename libdir srcdir objdir i n myABI="${ABI}" set_arch_to_kernel @@ -631,30 +608,25 @@ linux-mod_src_compile() { local -x CROSS_COMPILE=${CROSS_COMPILE-${CHOST}-} BUILD_TARGETS=${BUILD_TARGETS:-clean module} - strip_modulenames; - cd "${S}" - touch Module.symvers - for i in ${MODULE_NAMES} - do + strip_modulenames + cd "${S}" || die + touch Module.symvers || die + for i in ${MODULE_NAMES}; do unset libdir srcdir objdir - for n in $(find_module_params ${i}) - do + for n in $(find_module_params ${i}); do eval ${n/:*}=${n/*:/} done libdir=${libdir:-misc} srcdir=${srcdir:-${S}} objdir=${objdir:-${srcdir}} - if [ ! -f "${srcdir}/.built" ]; - then - cd "${srcdir}" - ln -s "${S}"/Module.symvers Module.symvers + if [[ ! -f "${srcdir}/.built" ]]; then + cd "${srcdir}" || die + ln -s "${S}"/Module.symvers Module.symvers || die einfo "Preparing ${modulename} module" - if [[ -n ${ECONF_PARAMS} ]] - then + if [[ -n ${ECONF_PARAMS} ]]; then eqawarn "This package relies on the deprecated functionality of econf being called in linux-mod_src_compile (ECONF_PARAMS), which will go away in 30 days (20230107) (https://bugs.gentoo.org/340597)" - econf ${ECONF_PARAMS} || \ - die "Unable to run econf ${ECONF_PARAMS}" + econf ${ECONF_PARAMS} fi # This looks messy, but it is needed to handle multiple variables @@ -668,8 +640,8 @@ linux-mod_src_compile() { ${BUILD_PARAMS} \ ${BUILD_TARGETS} " \ || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}" - cd "${OLDPWD}" - touch "${srcdir}"/.built + cd "${OLDPWD}" || die + touch "${srcdir}"/.built || die fi done @@ -690,18 +662,16 @@ linux-mod_src_compile() { # Look at the description of these variables for more details. linux-mod_src_install() { debug-print-function ${FUNCNAME} $* - [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return + [[ -n "${MODULES_OPTIONAL_USE}" ]] && use !${MODULES_OPTIONAL_USE} && return local modulename libdir srcdir objdir i n [[ -n ${KERNEL_DIR} ]] && addpredict "${KERNEL_DIR}/null.dwo" - strip_modulenames; - for i in ${MODULE_NAMES} - do + strip_modulenames + for i in ${MODULE_NAMES}; do unset libdir srcdir objdir - for n in $(find_module_params ${i}) - do + for n in $(find_module_params ${i}); do eval ${n/:*}=${n/*:/} done libdir=${libdir:-misc} @@ -742,22 +712,22 @@ linux-mod_src_install() { # It checks what to do after having merged the package. linux-mod_pkg_preinst() { debug-print-function ${FUNCNAME} $* - [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return + [[ -n ${MODULES_OPTIONAL_USE} ]] && use !${MODULES_OPTIONAL_USE} && return - [ -d "${D%/}/lib/modules" ] && UPDATE_DEPMOD=true || UPDATE_DEPMOD=false - [ -d "${D%/}/lib/modules" ] && UPDATE_MODULEDB=true || UPDATE_MODULEDB=false + [[ -d ${D}/lib/modules ]] && UPDATE_DEPMOD=true || UPDATE_DEPMOD=false + [[ -d ${D}/lib/modules ]] && UPDATE_MODULEDB=true || UPDATE_MODULEDB=false } # @FUNCTION: linux-mod_pkg_postinst # @DESCRIPTION: # It executes /sbin/depmod and adds the package to the /var/lib/module-rebuild/moduledb -# database (if ${D}/lib/modules is created)" +# database (if ${D}/lib/modules is created) linux-mod_pkg_postinst() { debug-print-function ${FUNCNAME} $* - [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return + [[ -n "${MODULES_OPTIONAL_USE}" ]] && use !${MODULES_OPTIONAL_USE} && return - ${UPDATE_DEPMOD} && update_depmod; - ${UPDATE_MODULEDB} && update_moduledb; + ${UPDATE_DEPMOD} && update_depmod + ${UPDATE_MODULEDB} && update_moduledb } # @FUNCTION: linux-mod_pkg_postrm @@ -766,8 +736,8 @@ linux-mod_pkg_postinst() { # call /sbin/depmod because the modules are still installed. linux-mod_pkg_postrm() { debug-print-function ${FUNCNAME} $* - [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return - remove_moduledb; + [[ -n "${MODULES_OPTIONAL_USE}" ]] && use !${MODULES_OPTIONAL_USE} && return + remove_moduledb } fi diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass index b4347163face..cdbc766feeb3 100644 --- a/eclass/llvm.eclass +++ b/eclass/llvm.eclass @@ -58,12 +58,11 @@ case ${EAPI} in 7|8) ;; - *) die "EAPI=${EAPI:-0} not supported";; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS pkg_setup - if [[ ! ${_LLVM_ECLASS} ]]; then +_LLVM_ECLASS=1 # make sure that the versions installing straight into /usr/bin # are uninstalled @@ -278,5 +277,6 @@ llvm_pkg_setup() { fi } -_LLVM_ECLASS=1 fi + +EXPORT_FUNCTIONS pkg_setup diff --git a/eclass/mate.eclass b/eclass/mate.eclass index 66b4cf446249..c1886648140e 100644 --- a/eclass/mate.eclass +++ b/eclass/mate.eclass @@ -45,7 +45,7 @@ DEPEND=">=mate-base/mate-common-${MATE_BRANCH}" # This function should only be used if the ebuild also inherits the # python-r1 eclass mate_py_cond_func_wrap() { - if [[ ! ${_PYTHON_R1} ]]; then + if [[ ! ${_PYTHON_R1_ECLASS} ]]; then die "This function requires the inheritence of the python-r1 eclass" fi if use python; then diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass index 450697773409..ecf1c1f6720a 100644 --- a/eclass/mozcoreconf-v6.eclass +++ b/eclass/mozcoreconf-v6.eclass @@ -1,10 +1,10 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# + # @ECLASS: mozcoreconf-v6.eclass # @MAINTAINER: # Mozilla team <mozilla@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 8 # @BLURB: core options and configuration functions for mozilla # @DESCRIPTION: # @@ -15,7 +15,13 @@ # This is an eclass-generated variable that defines the rpath that the mozilla # product will be installed in. Read-only -if [[ ! ${_MOZCORECONF} ]]; then +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_MOZCORECONF_V6_ECLASS} ]]; then +_MOZCORECONF_V6_ECLASS=1 inherit toolchain-funcs flag-o-matic python-any-r1 @@ -23,18 +29,6 @@ BDEPEND="virtual/pkgconfig dev-lang/python:2.7[ncurses,sqlite,ssl,threads(+)] ${PYTHON_DEPS}" -case "${EAPI:-0}" in - 6) - inherit multilib versionator - DEPEND+=" ${BDEPEND}" - ;; - 7|8) - ;; - *) - die "EAPI ${EAPI} is not supported, contact eclass maintainers" - ;; -esac - IUSE="${IUSE} custom-cflags custom-optimization" # @FUNCTION: mozconfig_annotate @@ -275,5 +269,4 @@ mozconfig_final() { echo } -_MOZCORECONF=1 fi diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass index 25089aaeaf93..692aa816d8ed 100644 --- a/eclass/mozextension.eclass +++ b/eclass/mozextension.eclass @@ -1,13 +1,19 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# # @ECLASS: mozextension.eclass # @MAINTAINER: # Mozilla team <mozilla@gentoo.org> +# @SUPPORTED_EAPIS: 8 # @BLURB: Install extensions for use in Mozilla products. -if [[ ! ${_MOZEXTENSION} ]]; then +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_MOZEXTENSION_ECLASS} ]]; then +_MOZEXTENSION_ECLASS=1 # @ECLASS_VARIABLE: MOZEXTENSION_TARGET # @DESCRIPTION: @@ -17,7 +23,7 @@ if [[ ! ${_MOZEXTENSION} ]]; then # paths specified in the eclass. : ${MOZEXTENSION_TARGET:=""} -DEPEND="app-arch/unzip" +BDEPEND="app-arch/unzip" mozversion_extension_location() { case ${PN} in @@ -117,8 +123,7 @@ xpi_copy() { insinto "${MOZILLA_FIVE_HOME}"/extensions fi - newins "${DISTDIR%/}"/${x##*/}.xpi ${emid}.xpi + newins "${DISTDIR}"/${x##*/}.xpi ${emid}.xpi } -_MOZEXTENSION=1 fi diff --git a/eclass/mozlinguas-v2.eclass b/eclass/mozlinguas-v2.eclass index 155b894edc53..063430e1cb74 100644 --- a/eclass/mozlinguas-v2.eclass +++ b/eclass/mozlinguas-v2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mozlinguas-v2.eclass @@ -7,25 +7,22 @@ # @AUTHOR: # Nirbheek Chauhan <nirbheek@gentoo.org> # Ian Stakenvicius <axs@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 8 # @BLURB: Handle language packs for mozilla products # @DESCRIPTION: # Sets IUSE according to MOZ_LANGS (language packs available). Also exports # src_unpack, src_compile and src_install for use in ebuilds, and provides # supporting functions for langpack generation and installation. -inherit mozextension - -case "${EAPI:-0}" in - 6) - inherit eapi7-ver ;; - 7|8) - ;; - *) - die "EAPI ${EAPI} is not supported, contact eclass maintainers" ;; +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS src_unpack src_compile src_install +if [[ ! ${_MOZLINGUAS_V2_ECLASS} ]]; then +_MOZLINGUAS_V2_ECLASS=1 + +inherit mozextension # @ECLASS_VARIABLE: MOZ_LANGS # @DEFAULT_UNSET @@ -402,3 +399,7 @@ mozlinguas_src_install() { mozlinguas-v2_src_install() { mozlinguas_src_install } + +fi + +EXPORT_FUNCTIONS src_unpack src_compile src_install diff --git a/eclass/ninja-utils.eclass b/eclass/ninja-utils.eclass index 9be502fa8ad9..4577e26fa57c 100644 --- a/eclass/ninja-utils.eclass +++ b/eclass/ninja-utils.eclass @@ -8,7 +8,7 @@ # @AUTHOR: # Michał Górny <mgorny@gentoo.org> # Mike Gilbert <floppym@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: common bits to run dev-util/ninja builder # @DESCRIPTION: # This eclass provides a single function -- eninja -- that can be used @@ -19,7 +19,7 @@ # Meson). case ${EAPI} in - 5|6|7|8) ;; + 7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -76,16 +76,13 @@ get_NINJAOPTS() { # @USAGE: [<args>...] # @DESCRIPTION: # Call Ninja, passing the NINJAOPTS (or converted MAKEOPTS), followed -# by the supplied arguments. This function dies if ninja fails. Starting -# with EAPI 6, it also supports being called via 'nonfatal'. +# by the supplied arguments. This function dies if ninja fails. It +# also supports being called via 'nonfatal'. eninja() { - local nonfatal_args=() - [[ ${EAPI} != 5 ]] && nonfatal_args+=( -n ) - [[ -n "${NINJA_DEPEND}" ]] || ewarn "Unknown value '${NINJA}' for \${NINJA}" set -- "${NINJA}" -v $(get_NINJAOPTS) "$@" echo "$@" >&2 - "$@" || die "${nonfatal_args[@]}" "${*} failed" + "$@" || die -n "${*} failed" } fi diff --git a/eclass/php-ext-pecl-r3.eclass b/eclass/php-ext-pecl-r3.eclass index b1b9429e8a26..11ae34429fbb 100644 --- a/eclass/php-ext-pecl-r3.eclass +++ b/eclass/php-ext-pecl-r3.eclass @@ -1,10 +1,10 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: php-ext-pecl-r3.eclass # @MAINTAINER: # Gentoo PHP team <php-bugs@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @PROVIDES: php-ext-source-r3 # @BLURB: A uniform way to install PECL extensions # @DESCRIPTION: @@ -13,7 +13,7 @@ # see https://pecl.php.net/ case ${EAPI:-0} in - 6|7|8) ;; + 7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass index b60d5528d526..7179ab756f6b 100644 --- a/eclass/php-ext-source-r3.eclass +++ b/eclass/php-ext-source-r3.eclass @@ -1,10 +1,10 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: php-ext-source-r3.eclass # @MAINTAINER: # Gentoo PHP team <php-bugs@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Compile and install standalone PHP extensions. # @DESCRIPTION: # A unified interface for compiling and installing standalone PHP @@ -12,11 +12,9 @@ inherit autotools -case ${EAPI:-0} in - 6) inherit eapi7-ver ;; +case ${EAPI} in 7|8) ;; - *) - die "${ECLASS} is not compatible with EAPI=${EAPI}" + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac # @ECLASS_VARIABLE: PHP_EXT_NAME @@ -128,14 +126,17 @@ unset _php_slot _php_target # the USE-conditional if PHP_EXT_OPTIONAL_USE is non-null. REQUIRED_USE+=") ${PHP_EXT_OPTIONAL_USE:+ )}" PHPDEPEND+=" ${PHP_EXT_OPTIONAL_USE:+ )}" -TOOLDEPS="sys-devel/m4 sys-devel/libtool" +TOOLDEPS=" + sys-devel/m4 + sys-devel/libtool +" RDEPEND="${PHPDEPEND}" - -case ${EAPI:-0} in - 6) DEPEND="${TOOLDEPS} ${PHPDEPEND}" ;; - 7|8) DEPEND="${PHPDEPEND}" ; BDEPEND="${TOOLDEPS} ${PHPDEPEND}" ;; -esac +DEPEND="${PHPDEPEND}" +BDEPEND=" + ${TOOLDEPS} + ${PHPDEPEND} +" unset PHPDEPEND TOOLDEPS diff --git a/eclass/postgres-multi.eclass b/eclass/postgres-multi.eclass index 9dcf22e64a12..d93df851cd24 100644 --- a/eclass/postgres-multi.eclass +++ b/eclass/postgres-multi.eclass @@ -1,16 +1,12 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -inherit multibuild postgres -EXPORT_FUNCTIONS pkg_setup src_prepare src_compile src_install src_test - - # @ECLASS: postgres-multi.eclass # @MAINTAINER: # PostgreSQL <pgsql-bugs@gentoo.org> # @AUTHOR: # Aaron W. Swenson <titanofold@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 7 # @PROVIDES: multibuild postgres # @BLURB: An eclass to build PostgreSQL-related packages against multiple slots # @DESCRIPTION: @@ -18,12 +14,15 @@ EXPORT_FUNCTIONS pkg_setup src_prepare src_compile src_install src_test # build and install for one or more PostgreSQL slots as specified by # POSTGRES_TARGETS use flags. - -case ${EAPI:-0} in - 5|6|7) ;; - *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; +case ${EAPI} in + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +if [[ ! ${_POSTGRES_MULTI_ECLASS} ]]; then +_POSTGRES_MULTI_ECLASS=1 + +inherit multibuild postgres # @ECLASS_VARIABLE: POSTGRES_COMPAT # @PRE_INHERIT @@ -147,10 +146,7 @@ postgres-multi_src_prepare() { fi done - case ${EAPI:-0} in - 0|1|2|3|4|5) epatch_user ;; - 6|7) eapply_user ;; - esac + eapply_user local MULTIBUILD_VARIANT local MULTIBUILD_VARIANTS=("${_POSTGRES_INTERSECT_SLOTS[@]}") @@ -164,6 +160,13 @@ postgres-multi_src_compile() { postgres-multi_foreach emake } +# @FUNCTION: postgres-multi_src_test +# @DESCRIPTION: +# Runs `emake installcheck' in each build directory. +postgres-multi_src_test() { + postgres-multi_foreach emake installcheck +} + # @FUNCTION: postgres-multi_src_install # @DESCRIPTION: # Runs `emake install DESTDIR="${D}"' in each build directory. @@ -171,9 +174,6 @@ postgres-multi_src_install() { postgres-multi_foreach emake install DESTDIR="${D}" } -# @FUNCTION: postgres-multi_src_test -# @DESCRIPTION: -# Runs `emake installcheck' in each build directory. -postgres-multi_src_test() { - postgres-multi_foreach emake installcheck -} +fi + +EXPORT_FUNCTIONS pkg_setup src_prepare src_compile src_install src_test diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass index 8e204e2ade8c..e94ab56a40ae 100644 --- a/eclass/postgres.eclass +++ b/eclass/postgres.eclass @@ -1,14 +1,12 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EXPORT_FUNCTIONS pkg_setup - # @ECLASS: postgres.eclass # @MAINTAINER: # PostgreSQL <pgsql-bugs@gentoo.org> # @AUTHOR: # Aaron W. Swenson <titanofold@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 7 # @BLURB: An eclass for PostgreSQL-related packages # @DESCRIPTION: # This eclass provides common utility functions that many @@ -16,12 +14,14 @@ EXPORT_FUNCTIONS pkg_setup # currently selected PostgreSQL slot is within a range, adding a system # user to the postgres system group, and generating dependencies. - -case ${EAPI:-0} in - 5|6|7) ;; - *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; +case ${EAPI} in + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +if [[ ! ${_POSTGRES_ECLASS} ]]; then +_POSTGRES_ECLASS=1 + # @ECLASS_VARIABLE: _POSTGRES_ALL_VERSIONS # @INTERNAL # @DESCRIPTION: @@ -159,3 +159,7 @@ postgres_pkg_setup() { elog "PostgreSQL Target: ${best_slot}" } + +fi + +EXPORT_FUNCTIONS pkg_setup diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index 558f725f74b7..d7d44a87f516 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @PROVIDES: python-utils-r1 # @BLURB: An eclass for packages having build-time dependency on Python. # @DESCRIPTION: @@ -38,26 +38,22 @@ # For more information, please see the Python Guide: # https://projects.gentoo.org/python/guide/ -case "${EAPI:-0}" in - [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - [6-8]) ;; - *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -if [[ ! ${_PYTHON_ANY_R1} ]]; then +if [[ ! ${_PYTHON_ANY_R1_ECLASS} ]]; then +_PYTHON_ANY_R1_ECLASS=1 -if [[ ${_PYTHON_R1} ]]; then +if [[ ${_PYTHON_R1_ECLASS} ]]; then die 'python-any-r1.eclass can not be used with python-r1.eclass.' -elif [[ ${_PYTHON_SINGLE_R1} ]]; then +elif [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then die 'python-any-r1.eclass can not be used with python-single-r1.eclass.' fi inherit python-utils-r1 -fi - -EXPORT_FUNCTIONS pkg_setup - # @ECLASS_VARIABLE: PYTHON_COMPAT # @REQUIRED # @DESCRIPTION: @@ -205,8 +201,6 @@ _python_any_set_globals() { _python_any_set_globals unset -f _python_any_set_globals -if [[ ! ${_PYTHON_ANY_R1} ]]; then - # @FUNCTION: python_gen_any_dep # @USAGE: <dependency-block> # @DESCRIPTION: @@ -348,5 +342,6 @@ python-any-r1_pkg_setup() { [[ ${MERGE_TYPE} != binary ]] && python_setup } -_PYTHON_ANY_R1=1 fi + +EXPORT_FUNCTIONS pkg_setup diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index caa37bc54ae2..622a479dcfa3 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @PROVIDES: multibuild python-utils-r1 # @BLURB: A common, simple eclass for Python packages. # @DESCRIPTION: @@ -30,30 +30,22 @@ # For more information, please see the Python Guide: # https://projects.gentoo.org/python/guide/ -case "${EAPI:-0}" in - [0-5]) - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" - ;; - [6-8]) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -if [[ ! ${_PYTHON_R1} ]]; then +if [[ ! ${_PYTHON_R1_ECLASS} ]]; then +_PYTHON_R1_ECLASS=1 -if [[ ${_PYTHON_SINGLE_R1} ]]; then +if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then die 'python-r1.eclass can not be used with python-single-r1.eclass.' -elif [[ ${_PYTHON_ANY_R1} ]]; then +elif [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then die 'python-r1.eclass can not be used with python-any-r1.eclass.' fi -[[ ${EAPI} == 6 ]] && inherit eqawarn inherit multibuild python-utils-r1 -fi - # @ECLASS_VARIABLE: PYTHON_COMPAT # @REQUIRED # @DESCRIPTION: @@ -244,8 +236,6 @@ _python_set_globals() { _python_set_globals unset -f _python_set_globals -if [[ ! ${_PYTHON_R1} ]]; then - # @FUNCTION: _python_validate_useflags # @INTERNAL # @DESCRIPTION: @@ -636,7 +626,7 @@ python_foreach_impl() { eqawarn "instead." _DISTUTILS_FOREACH_IMPL_WARNED=1 - if ! has "${EAPI}" 6 7 8; then + if ! has "${EAPI}" 7 8; then die "Calling python_foreach_impl from distutils-r1 is banned in EAPI ${EAPI}" fi fi @@ -805,10 +795,9 @@ python_replicate_script() { local f for f; do local dosym=dosym - [[ ${EAPI} == [67] ]] && dosym=dosym8 + [[ ${EAPI} == 7 ]] && dosym=dosym8 "${dosym}" -r /usr/lib/python-exec/python-exec2 "${f#${ED}}" done } -_PYTHON_R1=1 fi diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index 740c3283d1b6..4d61f08c06f0 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @PROVIDES: python-utils-r1 # @BLURB: An eclass for Python packages not installed for multiple implementations. # @DESCRIPTION: @@ -37,31 +37,22 @@ # For more information, please see the Python Guide: # https://projects.gentoo.org/python/guide/ -case "${EAPI:-0}" in - [0-5]) - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" - ;; - [6-8]) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -if [[ ! ${_PYTHON_SINGLE_R1} ]]; then +if [[ ! ${_PYTHON_SINGLE_R1_ECLASS} ]]; then +_PYTHON_SINGLE_R1_ECLASS=1 -if [[ ${_PYTHON_R1} ]]; then +if [[ ${_PYTHON_R1_ECLASS} ]]; then die 'python-single-r1.eclass can not be used with python-r1.eclass.' -elif [[ ${_PYTHON_ANY_R1} ]]; then +elif [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then die 'python-single-r1.eclass can not be used with python-any-r1.eclass.' fi inherit python-utils-r1 -fi - -EXPORT_FUNCTIONS pkg_setup - # @ECLASS_VARIABLE: PYTHON_COMPAT # @REQUIRED # @DESCRIPTION: @@ -257,8 +248,6 @@ _python_single_set_globals() { _python_single_set_globals unset -f _python_single_set_globals -if [[ ! ${_PYTHON_SINGLE_R1} ]]; then - # @FUNCTION: python_gen_useflags # @USAGE: [<pattern>...] # @DESCRIPTION: @@ -463,5 +452,6 @@ python-single-r1_pkg_setup() { [[ ${MERGE_TYPE} != binary ]] && python_setup } -_PYTHON_SINGLE_R1=1 fi + +EXPORT_FUNCTIONS pkg_setup diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index d7b3df6105ab..568b2dbdfa46 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Utility functions for packages with Python parts. # @DESCRIPTION: # A utility eclass providing functions to query Python implementations, @@ -22,20 +22,16 @@ # NOTE: When dropping support for EAPIs here, we need to update # metadata/install-qa-check.d/60python-pyc # See bug #704286, bug #781878 -case "${EAPI:-0}" in - [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - [6-8]) ;; - *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; -esac -if [[ ${_PYTHON_ECLASS_INHERITED} ]]; then - die 'python-r1 suite eclasses can not be used with python.eclass.' -fi +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac -if [[ ! ${_PYTHON_UTILS_R1} ]]; then +if [[ ! ${_PYTHON_UTILS_R1_ECLASS} ]]; then +_PYTHON_UTILS_R1_ECLASS=1 -[[ ${EAPI} == [67] ]] && inherit eapi8-dosym -[[ ${EAPI} == 6 ]] && inherit eqawarn +[[ ${EAPI} == 7 ]] && inherit eapi8-dosym inherit multiprocessing toolchain-funcs # @ECLASS_VARIABLE: _PYTHON_ALL_IMPLS @@ -218,7 +214,7 @@ _python_impl_matches() { for pattern; do case ${pattern} in -2|python2*|pypy) - if [[ ${EAPI} != [67] ]]; then + if [[ ${EAPI} != 7 ]]; then eerror eerror "Python 2 is no longer supported in Gentoo, please remove Python 2" eerror "${FUNCNAME[1]} calls." @@ -227,7 +223,7 @@ _python_impl_matches() { ;; -3) # NB: "python3*" is fine, as "not pypy3" - if [[ ${EAPI} != [67] ]]; then + if [[ ${EAPI} != 7 ]]; then eerror eerror "Python 2 is no longer supported in Gentoo, please remove Python 2" eerror "${FUNCNAME[1]} calls." @@ -724,7 +720,7 @@ python_newexe() { # install the wrapper local dosym=dosym - [[ ${EAPI} == [67] ]] && dosym=dosym8 + [[ ${EAPI} == 7 ]] && dosym=dosym8 "${dosym}" -r /usr/lib/python-exec/python-exec2 "${wrapd}/${newfn}" # don't use this at home, just call python_doscript() instead @@ -1368,15 +1364,13 @@ _python_run_check_deps() { debug-print-function ${FUNCNAME} "${@}" local impl=${1} - local hasv_args=( -b ) - [[ ${EAPI} == 6 ]] && hasv_args=( --host-root ) einfo "Checking whether ${impl} is suitable ..." local PYTHON_PKG_DEP _python_export "${impl}" PYTHON_PKG_DEP ebegin " ${PYTHON_PKG_DEP}" - has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}" + has_version -b "${PYTHON_PKG_DEP}" eend ${?} || return 1 declare -f python_check_deps >/dev/null || return 0 @@ -1393,10 +1387,8 @@ _python_run_check_deps() { # A convenience wrapper for has_version() with verbose output and better # defaults for use in python_check_deps(). # -# The wrapper accepts EAPI 7+-style -b/-d/-r options to indicate -# the root to perform the lookup on. Unlike has_version, the default -# is -b. In EAPI 6, -b and -d are translated to --host-root -# for compatibility. +# The wrapper accepts -b/-d/-r options to indicate the root to perform +# the lookup on. Unlike has_version, the default is -b. # # The wrapper accepts multiple package specifications. For the check # to succeed, *all* specified atoms must match. @@ -1411,14 +1403,6 @@ python_has_version() { ;; esac - if [[ ${EAPI} == 6 ]]; then - if [[ ${root_arg} == -r ]]; then - root_arg=() - else - root_arg=( --host-root ) - fi - fi - local pkg for pkg; do ebegin " ${pkg}" @@ -1429,5 +1413,4 @@ python_has_version() { return 0 } -_PYTHON_UTILS_R1=1 fi diff --git a/eclass/qmail.eclass b/eclass/qmail.eclass index ed53bca56fae..67069087376d 100644 --- a/eclass/qmail.eclass +++ b/eclass/qmail.eclass @@ -121,12 +121,12 @@ qmail_src_postunpack() { qmail_src_compile() { cd "${S}" - emake it man "$@" || die "make failed" + emake it man "$@" } qmail_spp_src_compile() { cd "${GENQMAIL_S}"/spp/ - emake || die "make spp failed" + emake } qmail_base_install() { diff --git a/eclass/rocm.eclass b/eclass/rocm.eclass index 4c8fd39f2491..cf7a18b70ad2 100644 --- a/eclass/rocm.eclass +++ b/eclass/rocm.eclass @@ -6,7 +6,7 @@ # Gentoo Science Project <sci@gentoo.org> # @AUTHOR: # Yiyang Wu <xgreenlandforwyy@gmail.com> -# @SUPPORTED_EAPIS: 7 8 +# @SUPPORTED_EAPIS: 8 # @BLURB: Common functions and variables for ROCm packages written in HIP # @DESCRIPTION: # ROCm packages such as sci-libs/<roc|hip>*, and packages built on top of ROCm @@ -82,13 +82,14 @@ # } # @CODE -if [[ ! ${_ROCM_ECLASS} ]]; then - case ${EAPI} in - 7|8) ;; + 8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +if [[ ! ${_ROCM_ECLASS} ]]; then +_ROCM_ECLASS=1 + # @ECLASS_VARIABLE: ROCM_VERSION # @REQUIRED # @PRE_INHERIT @@ -219,5 +220,4 @@ check_amdgpu() { done } -_ROCM_ECLASS=1 fi diff --git a/eclass/ruby-ng-gnome2.eclass b/eclass/ruby-ng-gnome2.eclass index 487e3268e360..4c48e94df703 100644 --- a/eclass/ruby-ng-gnome2.eclass +++ b/eclass/ruby-ng-gnome2.eclass @@ -6,21 +6,21 @@ # Ruby herd <ruby@gentoo.org> # @AUTHOR: # Author: Hans de Graaff <graaff@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 7 # @PROVIDES: ruby-ng # @BLURB: An eclass to simplify handling of various ruby-gnome2 parts. # @DESCRIPTION: # This eclass simplifies installation of the various pieces of # ruby-gnome2 since they share a very common installation procedure. -case "${EAPI:-0}" in - 6) inherit eapi7-ver ;; - 7) ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; +case ${EAPI} in + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +if [[ ! ${_RUBY_NG_GNOME2_ECLASS} ]]; then +_RUBY_NG_GNOME2_ECLASS=1 + RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN#ruby-}}" RUBY_FAKEGEM_TASK_TEST="" RUBY_FAKEGEM_TASK_DOC="" @@ -40,7 +40,7 @@ fi IUSE="test" RESTRICT+=" !test? ( test )" -DEPEND="virtual/pkgconfig" +BDEPEND="virtual/pkgconfig" ruby_add_bdepend " dev-ruby/pkg-config test? ( >=dev-ruby/test-unit-2 )" @@ -157,3 +157,5 @@ each_ruby_test() { ${RUBY} test/run-test.rb || die fi } + +fi diff --git a/eclass/ruby-single.eclass b/eclass/ruby-single.eclass index 476d16b5cae1..035675c4810a 100644 --- a/eclass/ruby-single.eclass +++ b/eclass/ruby-single.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Hans de Graaff <graaff@gentoo.org> # Based on python-single-r1 by: Michał Górny <mgorny@gentoo.org> -# @SUPPORTED_EAPIS: 4 5 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @PROVIDES: ruby-utils # @BLURB: An eclass for Ruby packages not installed for multiple implementations. # @DESCRIPTION: @@ -23,18 +23,13 @@ # RDEPEND="${RUBY_DEPS}" # @CODE -case "${EAPI:-0}" in - 0|1|2|3) - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" - ;; - 4|5|6|7|8) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -if [[ ! ${_RUBY_SINGLE} ]]; then +if [[ ! ${_RUBY_SINGLE_ECLASS} ]]; then +_RUBY_SINGLE_ECLASS=1 inherit ruby-utils @@ -88,6 +83,4 @@ _ruby_single_set_globals() { } _ruby_single_set_globals - -_RUBY_SINGLE=1 fi diff --git a/eclass/rust-toolchain.eclass b/eclass/rust-toolchain.eclass index 75b15a7088b4..0bbdf46df1f4 100644 --- a/eclass/rust-toolchain.eclass +++ b/eclass/rust-toolchain.eclass @@ -4,7 +4,7 @@ # @ECLASS: rust-toolchain.eclass # @MAINTAINER: # Rust Project <rust@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 8 # @BLURB: helps map gentoo arches to rust ABIs # @DESCRIPTION: # This eclass contains a src_unpack default phase function, and @@ -12,10 +12,8 @@ # gentoo arches. case ${EAPI} in - 6) : ;; - 7) : ;; - 8) : ;; - *) die "EAPI=${EAPI:-0} is not supported" ;; + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac inherit multilib-build diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass index acb51300f348..8d0076de97ec 100644 --- a/eclass/scons-utils.eclass +++ b/eclass/scons-utils.eclass @@ -95,7 +95,7 @@ inherit multiprocessing SCONS_DEPEND=">=dev-util/scons-${SCONS_MIN_VERSION}" -if [[ ${_PYTHON_ANY_R1} ]]; then +if [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then # when using python-any-r1, use any-of dep API BDEPEND="$(python_gen_any_dep "${SCONS_DEPEND}[\${PYTHON_USEDEP}]")" @@ -103,12 +103,12 @@ if [[ ${_PYTHON_ANY_R1} ]]; then python_has_version "${SCONS_DEPEND}[${PYTHON_USEDEP}]" } python_check_deps() { scons-utils_python_check_deps; } -elif [[ ${_PYTHON_SINGLE_R1} ]]; then +elif [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then # when using python-single-r1, use PYTHON_USEDEP API BDEPEND=" $(python_gen_cond_dep "${SCONS_DEPEND}[\${PYTHON_USEDEP}]") ${PYTHON_DEPS}" -elif [[ ${_PYTHON_R1} ]]; then +elif [[ ${_PYTHON_R1_ECLASS} ]]; then # when using python-r1, you need to depend on scons yourself # (depending on whether you need any-r1 or full -r1 API) # -- since this is a breaking API change, it applies to EAPI 7+ only @@ -137,9 +137,9 @@ escons() { if [[ ! ${EPYTHON} ]]; then eerror "EPYTHON is unset while calling escons. This most likely means that" eerror "the ebuild did not call the appropriate eclass function before calling scons." - if [[ ${_PYTHON_ANY_R1} ]]; then + if [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then eerror "Please ensure that python-any-r1_pkg_setup is called in pkg_setup()." - elif [[ ${_PYTHON_SINGLE_R1} ]]; then + elif [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then eerror "Please ensure that python-single-r1_pkg_setup is called in pkg_setup()." else # python-r1 eerror "Please ensure that python_setup is called before escons, or that escons" diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass index f00e3555b6be..84e95678a67b 100644 --- a/eclass/selinux-policy-2.eclass +++ b/eclass/selinux-policy-2.eclass @@ -7,7 +7,7 @@ # @ECLASS: selinux-policy-2.eclass # @MAINTAINER: # selinux@gentoo.org -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 7 # @BLURB: This eclass supports the deployment of the various SELinux modules in sec-policy # @DESCRIPTION: # The selinux-policy-2.eclass supports deployment of the various SELinux modules @@ -18,6 +18,14 @@ # Also, it supports for bundling patches to make the whole thing just a bit more # manageable. +case ${EAPI} in + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_SELINUX_POLICY_2_ECLASS} ]]; then +_SELINUX_POLICY_2_ECLASS=1 + # @ECLASS_VARIABLE: MODS # @DESCRIPTION: # This variable contains the (upstream) module name for the SELinux module. @@ -74,12 +82,6 @@ # The default value is the 'master' branch. : ${SELINUX_GIT_BRANCH:="master"}; -case "${EAPI:-0}" in - 0|1|2|3|4|5) die "EAPI<6 is not supported";; - 6|7) : ;; - *) die "unknown EAPI" ;; -esac - case ${BASEPOL} in 9999) inherit git-r3 EGIT_REPO_URI="${SELINUX_GIT_REPO}"; @@ -113,17 +115,12 @@ else RDEPEND=">=sys-apps/policycoreutils-2.0.82 >=sec-policy/selinux-base-policy-${PV}" fi -if [[ ${EAPI} == 6 ]]; then - DEPEND="${RDEPEND} - sys-devel/m4 - >=sys-apps/checkpolicy-2.0.21" -else - DEPEND="${RDEPEND}" - BDEPEND="sys-devel/m4 - >=sys-apps/checkpolicy-2.0.21" -fi -EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm +DEPEND="${RDEPEND}" +BDEPEND=" + sys-devel/m4 + >=sys-apps/checkpolicy-2.0.21 +" # @FUNCTION: selinux-policy-2_src_unpack # @DESCRIPTION: @@ -219,7 +216,7 @@ selinux-policy-2_src_compile() { for i in ${POLICY_TYPES}; do # Support USE flags in builds export M4PARAM="${makeuse}" - emake NAME=$i SHAREDIR="${ROOT%/}"/usr/share/selinux -C "${S}"/${i} || die "${i} compile failed" + emake NAME=$i SHAREDIR="${EPREFIX}"/usr/share/selinux -C "${S}"/${i} done } @@ -255,8 +252,8 @@ selinux-policy-2_src_install() { selinux-policy-2_pkg_postinst() { # Set root path and don't load policy into the kernel when cross compiling local root_opts="" - if [[ "${ROOT%/}" != "" ]]; then - root_opts="-p ${ROOT%/} -n" + if [[ -n ${ROOT} ]]; then + root_opts="-p ${ROOT} -n" fi # build up the command in the case of multiple modules @@ -274,7 +271,7 @@ selinux-policy-2_pkg_postinst() { einfo "Inserting the following modules into the $i module store: ${MODS}" - cd "${ROOT%/}/usr/share/selinux/${i}" || die "Could not enter /usr/share/selinux/${i}" + cd "${ROOT}/usr/share/selinux/${i}" || die "Could not enter /usr/share/selinux/${i}" for j in ${MODS} ; do if [[ -f "${j}.pp" ]] ; then COMMAND="${j}.pp ${COMMAND}" @@ -323,7 +320,7 @@ selinux-policy-2_pkg_postinst() { done # Don't relabel when cross compiling - if [[ "${ROOT%/}" == "" ]]; then + if [[ -z ${ROOT} ]]; then # Relabel depending packages local PKGSET=""; if [[ -x /usr/bin/qdepends ]] ; then @@ -346,8 +343,8 @@ selinux-policy-2_pkg_postrm() { if [[ -z "${REPLACED_BY_VERSION}" ]]; then # Set root path and don't load policy into the kernel when cross compiling local root_opts="" - if [[ "${ROOT%/}" != "" ]]; then - root_opts="-p ${ROOT%/} -n" + if [[ -n ${ROOT} ]]; then + root_opts="-p ${ROOT} -n" fi # build up the command in the case of multiple modules @@ -368,3 +365,7 @@ selinux-policy-2_pkg_postrm() { done fi } + +fi + +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm diff --git a/eclass/toolchain-autoconf.eclass b/eclass/toolchain-autoconf.eclass index 2c8184f894cc..2ba27638468e 100644 --- a/eclass/toolchain-autoconf.eclass +++ b/eclass/toolchain-autoconf.eclass @@ -1,29 +1,22 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: toolchain-autoconf.eclass # @MAINTAINER: # <base-system@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Common code for sys-devel/autoconf ebuilds # @DESCRIPTION: # This eclass contains the common phase functions migrated from # sys-devel/autoconf eblits. -case ${EAPI:-0} in - [0-5]) - die "${ECLASS} is banned in EAPI ${EAPI:-0}" - ;; - [6-7]) - ;; - *) - die "Unknown EAPI ${EAPI:-0}" - ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ -z ${_TOOLCHAIN_AUTOCONF_ECLASS} ]]; then - -EXPORT_FUNCTIONS src_prepare src_configure src_install +_TOOLCHAIN_AUTOCONF_ECLASS=1 toolchain-autoconf_src_prepare() { find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} + || die @@ -75,5 +68,6 @@ toolchain-autoconf_src_install() { slot_info_pages } -_TOOLCHAIN_AUTOCONF_ECLASS=1 fi + +EXPORT_FUNCTIONS src_prepare src_configure src_install diff --git a/eclass/user-info.eclass b/eclass/user-info.eclass index 5550e4f08eeb..b18f280c1022 100644 --- a/eclass/user-info.eclass +++ b/eclass/user-info.eclass @@ -5,11 +5,11 @@ # @MAINTAINER: # base-system@gentoo.org (Linux) # Michał Górny <mgorny@gentoo.org> (NetBSD) -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Read-only access to user and group information case ${EAPI} in - 6|7|8) ;; + 7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass index c821abd60846..b73d538ae5bb 100644 --- a/eclass/usr-ldscript.eclass +++ b/eclass/usr-ldscript.eclass @@ -4,11 +4,11 @@ # @ECLASS: usr-ldscript.eclass # @MAINTAINER: # Toolchain Ninjas <toolchain@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Defines the gen_usr_ldscript function. case ${EAPI} in - 6|7|8) ;; + 7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -84,27 +84,27 @@ gen_usr_ldscript() { # Ensure /lib/${lib} exists to avoid dangling scripts/symlinks. # This especially is for AIX where $(get_libname) can return ".a", # so /lib/${lib} might be moved to /usr/lib/${lib} (by accident). - [[ -r ${ED%/}/${libdir}/${lib} ]] || continue + [[ -r ${ED}/${libdir}/${lib} ]] || continue #TODO: better die here? fi case ${CTARGET:-${CHOST}} in *-darwin*) if ${auto} ; then - tlib=$(scanmacho -qF'%S#F' "${ED%/}"/usr/${libdir}/${lib}) + tlib=$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) else - tlib=$(scanmacho -qF'%S#F' "${ED%/}"/${libdir}/${lib}) + tlib=$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib}) fi [[ -z ${tlib} ]] && die "unable to read install_name from ${lib}" tlib=${tlib##*/} if ${auto} ; then - mv "${ED%/}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED%/}"/${libdir}/ || die + mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die # some install_names are funky: they encode a version if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]] ; then - mv "${ED%/}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED%/}"/${libdir}/ || die + mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die fi - rm -f "${ED%/}"/${libdir}/${lib} + rm -f "${ED}"/${libdir}/${lib} fi # Mach-O files have an id, which is like a soname, it tells how @@ -114,34 +114,36 @@ gen_usr_ldscript() { # libdir=/lib because that messes up libtool files. # Make sure we don't lose the specific version, so just modify the # existing install_name - if [[ ! -w "${ED%/}/${libdir}/${tlib}" ]] ; then - chmod u+w "${ED%/}/${libdir}/${tlib}" # needed to write to it + if [[ ! -w "${ED}/${libdir}/${tlib}" ]] ; then + chmod u+w "${ED}/${libdir}/${tlib}" || die # needed to write to it local nowrite=yes fi install_name_tool \ -id "${EPREFIX}"/${libdir}/${tlib} \ - "${ED%/}"/${libdir}/${tlib} || die "install_name_tool failed" - [[ -n ${nowrite} ]] && chmod u-w "${ED%/}/${libdir}/${tlib}" + "${ED}"/${libdir}/${tlib} || die "install_name_tool failed" + if [[ -n ${nowrite} ]] ; then + chmod u-w "${ED}/${libdir}/${tlib}" || die + fi # Now as we don't use GNU binutils and our linker doesn't # understand linker scripts, just create a symlink. - pushd "${ED%/}/usr/${libdir}" > /dev/null + pushd "${ED}/usr/${libdir}" > /dev/null ln -snf "../../${libdir}/${tlib}" "${lib}" popd > /dev/null ;; *) if ${auto} ; then - tlib=$(scanelf -qF'%S#F' "${ED%/}"/usr/${libdir}/${lib}) + tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}" - mv "${ED%/}"/usr/${libdir}/${lib}* "${ED%/}"/${libdir}/ || die + mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die # some SONAMEs are funky: they encode a version before the .so if [[ ${tlib} != ${lib}* ]] ; then - mv "${ED%/}"/usr/${libdir}/${tlib}* "${ED%/}"/${libdir}/ || die + mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die fi - rm -f "${ED%/}"/${libdir}/${lib} + rm -f "${ED}"/${libdir}/${lib} else tlib=${lib} fi - cat > "${ED%/}/usr/${libdir}/${lib}" <<-END_LDSCRIPT + cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT /* GNU ld script Since Gentoo has critical dynamic libraries in /lib, and the static versions in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass index 3ff74db0d796..1be02bbea3cb 100644 --- a/eclass/waf-utils.eclass +++ b/eclass/waf-utils.eclass @@ -8,20 +8,23 @@ # 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: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: common ebuild functions for waf-based packages # @DESCRIPTION: # The waf-utils eclass contains functions that make creating ebuild for # waf-based packages much easier. # Its main features are support of common portage default settings. -inherit multilib toolchain-funcs multiprocessing - -case ${EAPI:-0} in - 6|7|8) EXPORT_FUNCTIONS src_configure src_compile src_install ;; - *) die "EAPI=${EAPI} is not supported" ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +if [[ ! ${_WAF_UTILS_ECLASS} ]]; then +_WAF_UTILS_ECLASS=1 + +inherit multilib toolchain-funcs multiprocessing + # @ECLASS_VARIABLE: WAF_VERBOSE # @USER_VARIABLE # @DESCRIPTION: @@ -41,7 +44,7 @@ waf-utils_src_configure() { debug-print-function ${FUNCNAME} "$@" local fail - if [[ ! ${_PYTHON_ANY_R1} && ! ${_PYTHON_SINGLE_R1} && ! ${_PYTHON_R1} ]]; then + if [[ ! ${_PYTHON_ANY_R1_ECLASS} && ! ${_PYTHON_SINGLE_R1_ECLASS} && ! ${_PYTHON_R1_ECLASS} ]]; then eerror "Using waf-utils.eclass without any python-r1 suite eclass is not supported." eerror "Please make sure to configure and inherit appropriate -r1 eclass." eerror "For more information and examples, please see:" @@ -51,9 +54,9 @@ waf-utils_src_configure() { if [[ ! ${EPYTHON} ]]; then eerror "EPYTHON is unset while calling waf-utils. This most likely means that" eerror "the ebuild did not call the appropriate eclass function before calling waf." - if [[ ${_PYTHON_ANY_R1} ]]; then + if [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then eerror "Please ensure that python-any-r1_pkg_setup is called in pkg_setup()." - elif [[ ${_PYTHON_SINGLE_R1} ]]; then + elif [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then eerror "Please ensure that python-single-r1_pkg_setup is called in pkg_setup()." else # python-r1 eerror "Please ensure that python_setup is called before waf-utils_src_configure()," @@ -141,3 +144,7 @@ waf-utils_src_install() { # Manual document installation einstalldocs } + +fi + +EXPORT_FUNCTIONS src_configure src_compile src_install diff --git a/eclass/xemacs-packages.eclass b/eclass/xemacs-packages.eclass index 91621f5f52d3..648f5146f47e 100644 --- a/eclass/xemacs-packages.eclass +++ b/eclass/xemacs-packages.eclass @@ -4,7 +4,7 @@ # @ECLASS: xemacs-packages.eclass # @MAINTAINER: # xemacs@gentoo.org -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 8 # @BLURB: Eclass to support elisp packages distributed by XEmacs. # @DESCRIPTION: # This eclass supports ebuilds for packages distributed by XEmacs. @@ -25,12 +25,10 @@ # they may not be well-tested. case ${EAPI} in - 6|7|8) ;; + 8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS src_unpack src_install - if [[ -z ${_XEMACS_PACKAGES_ECLASS} ]] ; then _XEMACS_PACKAGES_ECLASS=1 @@ -65,3 +63,5 @@ xemacs-packages_src_install() { } fi + +EXPORT_FUNCTIONS src_unpack src_install diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass index 0d35c0a8ebf8..a63655e10ece 100644 --- a/eclass/xorg-3.eclass +++ b/eclass/xorg-3.eclass @@ -415,7 +415,7 @@ xorg-3_src_configure() { } multilib_src_compile() { - emake "$@" || die 'emake failed' + emake "$@" } # @FUNCTION: xorg-3_src_compile @@ -427,12 +427,12 @@ xorg-3_src_compile() { if [[ ${XORG_MULTILIB} == yes ]]; then multilib-minimal_src_compile "$@" else - emake "$@" || die 'emake failed' + emake "$@" fi } multilib_src_install() { - emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed" + emake DESTDIR="${D}" "${install_args[@]}" "$@" install } # @FUNCTION: xorg-3_src_install @@ -446,7 +446,7 @@ xorg-3_src_install() { if [[ ${XORG_MULTILIB} == yes ]]; then multilib-minimal_src_install "$@" else - emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed" + emake DESTDIR="${D}" "${install_args[@]}" "$@" install einstalldocs fi |