summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2018-01-18 13:40:08 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2018-01-18 13:42:01 -0800
commitb98ae0d93872422dab1db8d33f7a1fc06806c83a (patch)
tree94b5a7e75643e058dccc7cfde5c54f2fb56f62c0 /eclass
parentapp-emulation/virtualbox-guest-additions: amd64 stable wrt bug #644894 (diff)
downloadgentoo-b98ae0d93872422dab1db8d33f7a1fc06806c83a.tar.gz
gentoo-b98ae0d93872422dab1db8d33f7a1fc06806c83a.tar.bz2
gentoo-b98ae0d93872422dab1db8d33f7a1fc06806c83a.zip
eclass/linux-mod.eclass: implement MODULES_OPTIONAL_USE_IUSE_DEFAULT.
Add IUSE default support for $MODULES_OPTIONAL_USE use flag variable. Defaults to disabled, and individual packages will have it enabled rather than tree-wide. Bug: https://bugs.gentoo.org/635720 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/linux-mod.eclass17
1 files changed, 16 insertions, 1 deletions
diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index b3ea3e40f30f..e310835bf77a 100644
--- a/eclass/linux-mod.eclass
+++ b/eclass/linux-mod.eclass
@@ -22,6 +22,12 @@
# A string containing the USE flag to use for making this eclass optional
# The recommended non-empty value is 'modules'
+# @ECLASS-VARIABLE: MODULES_OPTIONAL_USE_IUSE_DEFAULT
+# @DESCRIPTION:
+# A boolean to control the IUSE default state for the MODULES_OPTIONAL_USE USE
+# flag. Default value is unset (false). True represented by 1 or 'on', other
+# values including unset treated as false.
+
# @ECLASS-VARIABLE: KERNEL_DIR
# @DESCRIPTION:
# A string containing the directory of the target kernel sources. The default value is
@@ -129,7 +135,16 @@
inherit eutils linux-info multilib
EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm
-IUSE="kernel_linux ${MODULES_OPTIONAL_USE}"
+case ${EAPI:-0} in
+ 0) die "EAPI=${EAPI} is not supported due to lack of IUSE defaults" ;;
+esac
+
+case ${MODULES_OPTIONAL_USE_IUSE_DEFAULT:-n} in
+ [nNfF]*|[oO][fF]*|0|-) _modules_optional_use_iuse_default='' ;;
+ *) _modules_optional_use_iuse_default='+' ;;
+esac
+
+IUSE="kernel_linux ${MODULES_OPTIONAL_USE:+${_modules_optional_use_iuse_default}}${MODULES_OPTIONAL_USE}"
SLOT="0"
RDEPEND="${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (} kernel_linux? ( virtual/modutils ) ${MODULES_OPTIONAL_USE:+)}"
DEPEND="${RDEPEND}