Presently, "java-pkg-simple eclass can only be inherited AFTER java-pkg-2". This prevents packages with optional Java like dev-lang/cxprolog to be
build with java-pkg-simple. This patch allows to inherit java-pkg-simple
after either of java-pkg-2 and java-pkg-opt-2.
Poposed by Alfred Wingate on #gentoo-dev-help on 2024-04-25
Closes:
https://bugs.gentoo.org/930550
Signed-off-by: Volkmar W. Pogatzki <
gentoo@pogatzki.net>
---
eclass/java-pkg-simple.eclass | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass index 6b473ed768ed..181b4f3606ec 100644
--- a/eclass/java-pkg-simple.eclass
+++ b/eclass/java-pkg-simple.eclass
@@ -26,8 +26,12 @@ _JAVA_PKG_SIMPLE_ECLASS=1
inherit java-utils-2
-if ! has java-pkg-2 ${INHERITED}; then
- eerror "java-pkg-simple eclass can only be inherited AFTER java-pkg-2" +if has java-pkg-2 ${INHERITED}; then
+ JAVA_PKG_OPT=0
+elif has java-pkg-opt-2 ${INHERITED}; then
+ JAVA_PKG_OPT=1
+else
+ eerror "java-pkg-simple eclass can only be inherited AFTER java-pkg-2 or java-pkg-opt-2"
fi
# We are only interested in finding all java source files, wherever they may be.
@@ -50,7 +54,12 @@ if has test ${JAVA_PKG_IUSE}; then
test_deps+=" dev-java/testng:0";;
esac
done
- [[ ${test_deps} ]] && DEPEND="test? ( ${test_deps} )"
+ if [[ ${JAVA_PKG_OPT} ]]; then
+ [[ ${test_deps}