• [gentoo-dev] [PATCH] java-utils-2.eclass: allow eant without java-ant-2

    From Volkmar W. Pogatzki@21:1/5 to All on Wed Jun 19 13:40:01 2024
    Packages which can build without BSFIX need not inherit java-ant-2. To
    allow using eant without inheriting java-ant-2 we enhance the eant function with a condition which controls calling java-ant-2_src_configure.

    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    ---
    eclass/java-utils-2.eclass | 22 ++++++++++++++++------
    1 file changed, 16 insertions(+), 6 deletions(-)

    diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
    index adbc5242053a..2527819d7315 100644
    --- a/eclass/java-utils-2.eclass
    +++ b/eclass/java-utils-2.eclass
    @@ -2029,13 +2029,23 @@ java-utils-2_pkg_preinst() {
    eant() {
    debug-print-function ${FUNCNAME} $*

    - if [[ ${EBUILD_PHASE} = compile ]]; then
    - java-ant-2_src_configure
    - fi
    + if [[ ${!JAVA_PKG_BSFIX*} ]] \
    + || [[ ${JAVA_ANT_BSFIX_EXTRA_ARGS} ]] \
    + || [[ ${JAVA_ANT_CLASSPATH_TAGS} ]] \
    + || [[ ${JAVA_ANT_JAVADOC_INPUT_DIRS} ]] \
    + || [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] \
    + || [[ ${EANT_BUILD_XML} ]] \
    + || [[ ${!EANT_GENTOO_CLASSPATH*} ]] \
    + || [[ ${EANT_TEST_GENTOO_CLASSPATH} ]]
    + then
    + if [[ ${EBUILD_PHASE} = compile ]]; then
    + java-ant-2_src_configure
    + fi

    - if ! has java-ant-2 ${INHERITED}; then
    - local msg="You should inherit java-ant-2 when using eant"
    - java-pkg_announce