diff options
author | Volkmar W. Pogatzki <gentoo@pogatzki.net> | 2022-07-14 20:00:09 +0200 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2022-07-22 15:45:11 +0200 |
commit | cb922e47e811f847bc7cd931715d90e4906a57ee (patch) | |
tree | 35044e8a1447bddb7fedfdf91b2bdbdb9a9c5fa6 /eclass | |
parent | net-dns/c-ares: stable on amd64, bug #860099 (diff) | |
download | gentoo-cb922e47e811f847bc7cd931715d90e4906a57ee.tar.gz gentoo-cb922e47e811f847bc7cd931715d90e4906a57ee.tar.bz2 gentoo-cb922e47e811f847bc7cd931715d90e4906a57ee.zip |
java-pkg-simple.eclass: Automatic-Module-Name
The new variable JAVA_AUTOMATIC_MODULE_NAME can be defined in the
ebuild. Its value will be transferred to the MANIFEST.MF of the jar
file.
Closes: https://bugs.gentoo.org/857468
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/26406
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/java-pkg-simple.eclass | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass index 1e101a828c40..c0a6b4d21df9 100644 --- a/eclass/java-pkg-simple.eclass +++ b/eclass/java-pkg-simple.eclass @@ -134,6 +134,12 @@ fi # JAVA_MAIN_CLASS="org.gentoo.java.ebuilder.Main" # @CODE +# @ECLASS_VARIABLE: JAVA_AUTOMATIC_MODULE_NAME +# @DEFAULT_UNSET +# @DESCRIPTION: +# The value of the Automatic-Module-Name entry, which is going to be added to +# MANIFEST.MF. + # @ECLASS_VARIABLE: JAVADOC_ARGS # @DEFAULT_UNSET # @DESCRIPTION: @@ -418,6 +424,12 @@ java-pkg-simple_src_compile() { jar_args="cf ${JAVA_JAR_FILENAME}" fi jar ${jar_args} -C ${classes} . || die "jar failed" + if [[ -v JAVA_AUTOMATIC_MODULE_NAME ]]; then + cat > "${T}/add-to-MANIFEST.MF" <<< "Automatic-Module-Name: ${JAVA_AUTOMATIC_MODULE_NAME}" \ + || die "add-to-MANIFEST.MF failed" + jar ufmv ${JAVA_JAR_FILENAME} "${T}/add-to-MANIFEST.MF" \ + || die "updating MANIFEST.MF failed" + fi } # @FUNCTION: java-pkg-simple_src_install |