diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 36321 -> 36314 bytes | |||
-rw-r--r-- | eclass/aspell-dict-r1.eclass | 9 | ||||
-rw-r--r-- | eclass/ghc-package.eclass | 43 | ||||
-rw-r--r-- | eclass/go-module.eclass | 8 | ||||
-rw-r--r-- | eclass/haskell-cabal.eclass | 4 | ||||
-rw-r--r-- | eclass/java-pkg-simple.eclass | 53 | ||||
-rw-r--r-- | eclass/kernel-install.eclass | 15 | ||||
-rw-r--r-- | eclass/l10n.eclass | 12 | ||||
-rw-r--r-- | eclass/lua-single.eclass | 9 | ||||
-rw-r--r-- | eclass/lua-utils.eclass | 9 | ||||
-rw-r--r-- | eclass/lua.eclass | 9 | ||||
-rw-r--r-- | eclass/myspell-r2.eclass | 11 | ||||
-rw-r--r-- | eclass/selinux-policy-2.eclass | 13 |
13 files changed, 99 insertions, 96 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex c33ab57758d5..47157a14846c 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/aspell-dict-r1.eclass b/eclass/aspell-dict-r1.eclass index 24bc5ff27996..a779bf96e82b 100644 --- a/eclass/aspell-dict-r1.eclass +++ b/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 +# @SUPPORTED_EAPIS: 7 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 @@ -37,13 +37,10 @@ readonly ASPELL_SPELLANG=${PN/aspell-/} # If the value needs to be overridden, it needs to be overridden before inheriting the eclass. case ${EAPI:-0} in - [0-6]) - die "${ECLASS} is banned in EAPI ${EAPI:-0}" - ;; - 7) + [7-8]) ;; *) - die "Unknown EAPI ${EAPI:-0}" + die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac diff --git a/eclass/ghc-package.eclass b/eclass/ghc-package.eclass index 7e8a5aa0cba8..5decbaa228e8 100644 --- a/eclass/ghc-package.eclass +++ b/eclass/ghc-package.eclass @@ -4,6 +4,7 @@ # @ECLASS: ghc-package.eclass # @MAINTAINER: # "Gentoo's Haskell Language team" <haskell@gentoo.org> +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 # @AUTHOR: # Original Author: Andres Loeh <kosmikus@gentoo.org> # @BLURB: This eclass helps with the Glasgow Haskell Compiler's package configuration utility. @@ -14,8 +15,9 @@ inherit multiprocessing # Maintain version-testing compatibility with ebuilds not using EAPI 7. case "${EAPI:-0}" in + 0|1|2|3|7) ;; 4|5|6) inherit eapi7-ver ;; - *) ;; + *) die "EAPI ${EAPI} unsupported." ;; esac # GHC uses it's own native code generator. Portage's @@ -56,30 +58,11 @@ ghc-getghcpkg() { # because for some reason the global package file # must be specified ghc-getghcpkgbin() { - if ver_test "$(ghc-version)" -ge "7.9.20141222"; then - # ghc-7.10 stopped supporting single-file database - local empty_db="${T}/empty.conf.d" ghc_pkg="$(ghc-libdir)/bin/ghc-pkg" - if [[ ! -d ${empty_db} ]]; then - "${ghc_pkg}" init "${empty_db}" || die "Failed to initialize empty global db" - fi - echo "$(ghc-libdir)/bin/ghc-pkg" "--global-package-db=${empty_db}" - - elif ver_test "$(ghc-version)" -ge "7.7.20121101"; then - # the ghc-pkg executable changed name in ghc 6.10, as it no longer needs - # the wrapper script with the static flags - # was moved to bin/ subtree by: - # http://www.haskell.org/pipermail/cvs-ghc/2012-September/076546.html - echo '[]' > "${T}/empty.conf" - echo "$(ghc-libdir)/bin/ghc-pkg" "--global-package-db=${T}/empty.conf" - - elif ver_test "$(ghc-version)" -ge "7.5.20120516"; then - echo '[]' > "${T}/empty.conf" - echo "$(ghc-libdir)/ghc-pkg" "--global-package-db=${T}/empty.conf" - - else - echo '[]' > "${T}/empty.conf" - echo "$(ghc-libdir)/ghc-pkg" "--global-conf=${T}/empty.conf" + local empty_db="${T}/empty.conf.d" ghc_pkg="$(ghc-libdir)/bin/ghc-pkg" + if [[ ! -d ${empty_db} ]]; then + "${ghc_pkg}" init "${empty_db}" || die "Failed to initialize empty global db" fi + echo "$(ghc-libdir)/bin/ghc-pkg" "--global-package-db=${empty_db}" } # @FUNCTION: ghc-version @@ -115,15 +98,9 @@ ghc-pm-version() { # @DESCRIPTION: # return version of the Cabal library bundled with ghc ghc-cabal-version() { - if ver_test "$(ghc-version)" -ge "7.9.20141222"; then - # outputs in format: 'version: 1.18.1.5' - set -- `$(ghc-getghcpkg) --package-db=$(ghc-libdir)/package.conf.d.initial field Cabal version` - echo "$2" - else - local cabal_package=`echo "$(ghc-libdir)"/Cabal-*` - # /path/to/ghc/Cabal-${VER} -> ${VER} - echo "${cabal_package/*Cabal-/}" - fi + # outputs in format: 'version: 1.18.1.5' + set -- `$(ghc-getghcpkg) --package-db=$(ghc-libdir)/package.conf.d.initial field Cabal version` + echo "$2" } # @FUNCTION: ghc-is-dynamic diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass index c11895944cdc..053861a1a180 100644 --- a/eclass/go-module.eclass +++ b/eclass/go-module.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # William Hubbs <williamh@gentoo.org> # Robin H. Johnson <robbat2@gentoo.org> -# @SUPPORTED_EAPIS: 7 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: basic eclass for building software written as go modules # @DESCRIPTION: # This eclass provides basic settings and functions needed by all software @@ -46,9 +46,9 @@ # # @CODE -case ${EAPI:-0} in - 7) ;; - *) die "${ECLASS} EAPI ${EAPI} is not supported." +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ -z ${_GO_MODULE} ]]; then diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index b4741a0840c1..5b67f43f0c5a 100644 --- a/eclass/haskell-cabal.eclass +++ b/eclass/haskell-cabal.eclass @@ -4,6 +4,7 @@ # @ECLASS: haskell-cabal.eclass # @MAINTAINER: # Haskell herd <haskell@gentoo.org> +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 # @AUTHOR: # Original author: Andres Loeh <kosmikus@gentoo.org> # Original author: Duncan Coutts <dcoutts@gentoo.org> @@ -120,8 +121,9 @@ HASKELL_CABAL_EXPF="pkg_setup src_compile src_test src_install pkg_postinst pkg_ QA_CONFIGURE_OPTIONS+=" --with-compiler --with-hc --with-hc-pkg --with-gcc" case "${EAPI:-0}" in + 0|1) ;; 2|3|4|5|6|7) HASKELL_CABAL_EXPF+=" src_configure" ;; - *) ;; + *) die "EAPI ${EAPI} unsupported." ;; esac EXPORT_FUNCTIONS ${HASKELL_CABAL_EXPF} diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass index 174fa08ce4ea..184934eb3bd3 100644 --- a/eclass/java-pkg-simple.eclass +++ b/eclass/java-pkg-simple.eclass @@ -168,6 +168,17 @@ fi # JAVA_TESTING_FRAMEWORKS="junit pkgdiff" # @CODE +# @ECLASS-VARIABLE: JAVA_TEST_RUN_ONLY +# @DEFAULT_UNSET +# @DESCRIPTION: +# A array of classes that should be executed during src_test(). This variable +# has precedence over JAVA_TEST_EXCLUDES, that is if this variable is set, +# the other variable is ignored. +# +# @CODE +# JAVA_TEST_RUN_ONLY=( "net.sf.cglib.AllTests" "net.sf.cglib.TestAll" ) +# @CODE + # @ECLASS-VARIABLE: JAVA_TEST_EXCLUDES # @DEFAULT_UNSET # @DESCRIPTION: @@ -517,25 +528,29 @@ java-pkg-simple_src_test() { fi # grab a set of tests that testing framework will run - tests_to_run=$(find "${classes}" -type f\ - \( -name "*Test.class"\ - -o -name "Test*.class"\ - -o -name "*Tests.class"\ - -o -name "*TestCase.class" \)\ - ! -name "*Abstract*"\ - ! -name "*BaseTest*"\ - ! -name "*TestTypes*"\ - ! -name "*TestUtils*"\ - ! -name "*\$*") - tests_to_run=${tests_to_run//"${classes}"\/} - tests_to_run=${tests_to_run//.class} - tests_to_run=${tests_to_run//\//.} - - # exclude extra test classes, usually corner cases - # that the code above cannot handle - for class in "${JAVA_TEST_EXCLUDES[@]}"; do - tests_to_run=${tests_to_run//${class}} - done + if [[ -n ${JAVA_TEST_RUN_ONLY} ]]; then + tests_to_run="${JAVA_TEST_RUN_ONLY[@]}" + else + tests_to_run=$(find "${classes}" -type f\ + \( -name "*Test.class"\ + -o -name "Test*.class"\ + -o -name "*Tests.class"\ + -o -name "*TestCase.class" \)\ + ! -name "*Abstract*"\ + ! -name "*BaseTest*"\ + ! -name "*TestTypes*"\ + ! -name "*TestUtils*"\ + ! -name "*\$*") + tests_to_run=${tests_to_run//"${classes}"\/} + tests_to_run=${tests_to_run//.class} + tests_to_run=${tests_to_run//\//.} + + # exclude extra test classes, usually corner cases + # that the code above cannot handle + for class in "${JAVA_TEST_EXCLUDES[@]}"; do + tests_to_run=${tests_to_run//${class}} + done + fi # launch test for framework in ${JAVA_TESTING_FRAMEWORKS}; do diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index 4914a7562813..e6b9cbe45c0e 100644 --- a/eclass/kernel-install.eclass +++ b/eclass/kernel-install.eclass @@ -184,13 +184,26 @@ kernel-install_create_init() { cat <<-_EOF_ >"${T}/init.c" || die #include <stdio.h> + #include <sys/utsname.h> + int main() { + struct utsname u; + int ret = uname(&u); + if (ret != 0) { + printf("uname() failed, but that's fine\n"); + } + else { + // Booted: Linux 5.10.47 ppc64le #1 SMP Fri Jul 2 12:55:24 PDT 2021 + printf("Booted: %s %s %s %s\n", u.sysname, u.release, + u.machine, u.version); + } + printf("Hello, World!\n"); return 0; } _EOF_ - $(tc-getBUILD_CC) -Os -static "${T}/init.c" -o "${output}" || die + $(tc-getBUILD_CC) -Os -static "${T}/init.c" -o "${output}" || die $(tc-getBUILD_STRIP) "${output}" || die } diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass index f53cb3d0898b..8be84024d53c 100644 --- a/eclass/l10n.eclass +++ b/eclass/l10n.eclass @@ -2,6 +2,18 @@ # Distributed under the terms of the GNU General Public License v2 # @ECLASS: l10n.eclass +# @DEAD +# Use plocale.eclass as drop-in replacement. +# Functions should be replaced as follows: +# l10n_for_each_locale_do → plocale_for_each_locale +# plocale_for_each_disabled_locale → l10n_for_each_disabled_locale_do +# plocale_find_changes → l10n_find_plocales_changes +# plocale_get_locales → l10n_get_locales +# +# Rationale: Ever since the L10N USE_EXPAND variable was introduced, +# the name of this eclass has caused some confusion, because it operates +# on LINGUAS and is unrelated to L10N. +# # @MAINTAINER: # Ulrich Müller <ulm@gentoo.org> # @AUTHOR: diff --git a/eclass/lua-single.eclass b/eclass/lua-single.eclass index 7abe1eb6674a..ab4fdb3c75ac 100644 --- a/eclass/lua-single.eclass +++ b/eclass/lua-single.eclass @@ -62,15 +62,10 @@ # } # @CODE -case ${EAPI:-0} in - 0|1|2|3|4|5|6) - die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}" - ;; +case ${EAPI} in 7|8) ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ ! ${_LUA_SINGLE_R0} ]]; then diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass index 59959eaf9c08..278bbca58a39 100644 --- a/eclass/lua-utils.eclass +++ b/eclass/lua-utils.eclass @@ -17,15 +17,10 @@ # This eclass neither sets any metadata variables nor exports any phase # functions. It can be inherited safely. -case ${EAPI:-0} in - 0|1|2|3|4|5|6) - die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}" - ;; +case ${EAPI} in 7|8) ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ ! ${_LUA_UTILS_R0} ]]; then diff --git a/eclass/lua.eclass b/eclass/lua.eclass index e3a25c5d184b..e9a5c1175608 100644 --- a/eclass/lua.eclass +++ b/eclass/lua.eclass @@ -50,15 +50,10 @@ # } # @CODE -case ${EAPI:-0} in - 0|1|2|3|4|5|6) - die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}" - ;; +case ${EAPI} in 7|8) ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ ! ${_LUA_R0} ]]; then diff --git a/eclass/myspell-r2.eclass b/eclass/myspell-r2.eclass index e4d9ae69af3a..7ffdd3631eae 100644 --- a/eclass/myspell-r2.eclass +++ b/eclass/myspell-r2.eclass @@ -6,7 +6,7 @@ # Conrad Kostecki <conikost@gentoo.org> # @AUTHOR: # Tomáš Chvátal <scarabeus@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: An eclass to streamline the construction of ebuilds for new Myspell dictionaries. # @DESCRIPTION: # The myspell-r2 eclass is designed to streamline the construction of ebuilds for @@ -31,13 +31,10 @@ # MYSPELL_THES=( "file.dat" "dir/file2.idx" ) case ${EAPI:-0} in - [0-4]) - die "${ECLASS} is banned in EAPI ${EAPI:-0}" - ;; - [5-7]) + [5-8]) ;; *) - die "Unknown EAPI ${EAPI:-0}" + die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -46,7 +43,7 @@ EXPORT_FUNCTIONS src_unpack src_install # Basically no extra deps needed. # Unzip is required for .oxt libreoffice extensions # which are just fancy zip files. -if [[ ${EAPI:-0} == 7 ]]; then +if [[ ${EAPI:-0} != [56] ]]; then BDEPEND="app-arch/unzip" else DEPEND="app-arch/unzip" diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass index 5def86fbef9d..1af7ba3a80be 100644 --- a/eclass/selinux-policy-2.eclass +++ b/eclass/selinux-policy-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 for installing SELinux policy, and optionally @@ -263,10 +263,15 @@ selinux-policy-2_pkg_postinst() { local COMMAND for i in ${POLICY_TYPES}; do - if [[ "${i}" == "strict" ]] && [[ "${MODS}" = "unconfined" ]]; then - einfo "Ignoring loading of unconfined module in strict module store."; - continue; + if [[ "${MODS}" = "unconfined" ]]; then + case ${i} in + strict|mcs|mls) + einfo "Ignoring loading of unconfined module in ${i} module store."; + continue + ;; + esac fi + 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}" |