summaryrefslogtreecommitdiff
path: root/eclass/linux-mod.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-21 17:32:00 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-21 17:32:00 +0100
commit61f10f985e19dfe20a4d9552902625edd5b6eabb (patch)
tree50db31971b38c4e0358253ef5005058a46fc773e /eclass/linux-mod.eclass
parent34dea8e38f88007799629d0a56b12dec480b1d21 (diff)
gentoo resync : 21.06.2021
Diffstat (limited to 'eclass/linux-mod.eclass')
-rw-r--r--eclass/linux-mod.eclass16
1 files changed, 15 insertions, 1 deletions
diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index 11b0fd0cfb5e..e87c5ec0cdb3 100644
--- a/eclass/linux-mod.eclass
+++ b/eclass/linux-mod.eclass
@@ -7,6 +7,7 @@
# @AUTHOR:
# John Mylchreest <johnm@gentoo.org>,
# Stefan Schweizer <genstef@gentoo.org>
+# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: It provides the functionality required to install external modules against a kernel source tree.
# @DESCRIPTION:
# This eclass is used to interface with linux-info.eclass in such a way
@@ -134,9 +135,20 @@
# @DESCRIPTION:
# It's a read-only variable. It contains the extension of the kernel modules.
-inherit eutils linux-info multilib toolchain-funcs
+case ${EAPI:-0} in
+ [567]) inherit eutils ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm
+if [[ -z ${_LINUX_MOD_ECLASS} ]] ; then
+_LINUX_MOD_ECLASS=1
+
+# TODO: When adding support for future EAPIs, please audit this list
+# for unused inherits and conditionalise them.
+inherit linux-info multilib toolchain-funcs
+
case ${MODULES_OPTIONAL_USE_IUSE_DEFAULT:-n} in
[nNfF]*|[oO][fF]*|0|-) _modules_optional_use_iuse_default='' ;;
*) _modules_optional_use_iuse_default='+' ;;
@@ -769,3 +781,5 @@ linux-mod_pkg_postrm() {
[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
remove_moduledb;
}
+
+fi