diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-27 22:51:10 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-27 22:51:10 +0000 |
commit | ee0c4d5e506a6c64994a15c3af5cf1ca22045567 (patch) | |
tree | bdf578939023d42f04092ddb4bcd190eb391770f /dev-java/lz4-java | |
parent | 161eaa4b12ca6314376288834bba20b7824d0d77 (diff) |
gentoo auto-resync : 27:11:2023 - 22:51:09
Diffstat (limited to 'dev-java/lz4-java')
-rw-r--r-- | dev-java/lz4-java/Manifest | 3 | ||||
-rw-r--r-- | dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch | 32 | ||||
-rw-r--r-- | dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild | 97 | ||||
-rw-r--r-- | dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild | 95 |
4 files changed, 129 insertions, 98 deletions
diff --git a/dev-java/lz4-java/Manifest b/dev-java/lz4-java/Manifest index 2e1b0dca1748..7168f4ce0567 100644 --- a/dev-java/lz4-java/Manifest +++ b/dev-java/lz4-java/Manifest @@ -1,8 +1,9 @@ +AUX lz4-java-1.8.0-fix-load.patch 894 BLAKE2B 30e0dfc301a4926d1cb8846c4391dacb20d07f2e33f0e36c48efb220acf994c916f9f592f645352102448e4f69652a55eda739faac8f7ba0378abdd3e9c5fc10 SHA512 d7d40e091ee45bb11bcb95f251707d9b1678ff658d02369def9e92114b16b4b21d55953719d35570d78faec561e6eca571d54e7bf9074ac7147b9578ab5e90db AUX lz4-java-1.8.0-gentoo-classpath.xml 179 BLAKE2B 78a1d2615b0ceca3990b58891fa560ed2eeabb8dff397cef99b9f3281cb3d70a563257639051f2f96fa574fe5edefe3bae231a6553a6c1daf96df5e97a44aaee SHA512 b815a4f876a9d8fc30b1c68ec4b8c2fbee5e544247d5272af033d04ffb60fe018713b15f04740348306411c69775bcbc339e30df35bb147a208d119e1c11c017 AUX lz4-java-1.8.0-print-os-props.patch 880 BLAKE2B 53256984d5afc08d85bee460f6f7ce4a333ea5960fbe3a6a6322338477d701582ee33bf52b05ec3105147fca3ea58424f82b742f965b6d638e56b5cf7e0f3135 SHA512 9c5dedab3cfa09014f9235d4a20dc9a7136b6925d53840e0721c7a58d7a2d2faa3e066440a7e23be60e79c1817813a683a9e76c9947d23ac168882421a498f5b AUX lz4-java-1.8.0-r1-Makefile 1528 BLAKE2B e3f8825785c329fc2c9a480dc5e7dbb00268a87d0fa84fb09c70af5259f7a108970c9abbbd9276218d7ae3500ae28d5b4a782e1e9e80046af0e394d8a677944d SHA512 1b391cf872cfdc30e7b7b3f74b7cf4b6f1d9c8268be2556cfce4b9f51fe8bd5c1bf717bdfd2c7a5b05db63231ccb5b315fd34de7aa96e4eb418124bf4c47d3dd AUX lz4-java-1.8.0-skip-ivy.patch 3236 BLAKE2B cae70a2600d8bc6f3e89e901728261d23102ec61ae35dfe678542953ecd5467f33d724154903dae3e7214c4c5bfcbf5b6956ae70f7806e270a9cb747b3661d47 SHA512 fd24db414b0944cac78e0b39014d9de38d694e958352d9dc4b83560c84c16790844f197a80bb4f90f084bb882406992ed72da5e54dc774122a347c2df2c76301 DIST lz4-java-1.8.0.tar.gz 1069398 BLAKE2B 02ee363fc42eeeade01f04649416dd874513f4517264c6e1b6474d64e8b81e2ee9ff1f55e51b508608929e8d78cb30e98d929cc4a118c03f86b0e69bae237e8a SHA512 ae78748d984d2ede18018d5e9ae6aee0d5fe6ac8b56d717f863968cfad6e9f85b62305692345ba16002bee68278e87a0364aa98aeb92e2af6dc169e5d5b612d4 EBUILD lz4-java-1.8.0-r1.ebuild 3162 BLAKE2B af48a8774cc7e0c67fbeea0b48383fc48b909d90cc05f03217846f082741416253dd215b073cb41cf1508b2b42eb7b22b45ba9191b8a739ce0276de078b40209 SHA512 0fd583fcfba0fb4760c263aec6a2d4cb3334c7c780c47ebee392ce3c78e4b6a1f0bc181a9d7470e49ce48e9bc72166bb785a522a29e4842fe640629fd5ed00e9 -EBUILD lz4-java-1.8.0-r2.ebuild 3012 BLAKE2B 0e668ff01aa4fbf2814ab283e16ff2c5301e7dc987b7e72557014eadaf66566c2cb0ff44ee666435d91a3bf0a3a348c6f5b8fcccf1338b9c35be4a27be7d9fe0 SHA512 37621d8a9a082b6a2beaca8336d2799ad3c797c283f524c7e0617fed160992aaada5d0762a08421e6b6b31a3494ab5e9ce4aea0734478c5d23659e32111cbd41 +EBUILD lz4-java-1.8.0-r4.ebuild 2749 BLAKE2B 66b107659c66dbfb570e4d37e4fe66a04ea097c09362d46633cc7b7fe4b44eccffda9a9411ec5b626832dcd7aeb57090d7fe74113394ed11eb49011487558fc9 SHA512 c6f2254ee07ca3f8b807a01282e132693430776a5ea3c805b4e8934116b2354efd96cfa9fe9e5aa2bfecec01ec0e5c89c48c4f62e9a7a8ec9d646488f42730fd MISC metadata.xml 314 BLAKE2B 029f69d900ca078525f401c897f9ebc3eb63d5fdbc201f8d42cadec684a66d1797fe4217ae4c8e874974fcfe74a2a1c024d7bf8bb165c8a9ec22ea103b11e5d7 SHA512 6a8817e187e78b1f175b35a07c9fa498f4b8af167a971320845148409ba352e5aa560cd907fb7e94336ebda07b7c7b5db407f0e9bdc94356e5d2090ee5f2fc9c diff --git a/dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch b/dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch new file mode 100644 index 000000000000..e6c15cc1dbc9 --- /dev/null +++ b/dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch @@ -0,0 +1,32 @@ +--- a/src/java/net/jpountz/util/Native.java ++++ b/src/java/net/jpountz/util/Native.java +@@ -100,17 +100,18 @@ public enum Native { + return; + } + +- cleanupOldTempLibs(); ++// cleanupOldTempLibs(); + + // Try to load lz4-java (liblz4-java.so on Linux) from the java.library.path. ++ final File library = new File(System.mapLibraryName("lz4-java")); + try { +- System.loadLibrary("lz4-java"); ++ System.load(library.getAbsolutePath()); + loaded = true; + return; + } catch (UnsatisfiedLinkError ex) { + // Doesn't exist, so proceed to loading bundled library. + } +- ++/* + String resourceName = resourceName(); + InputStream is = Native.class.getResourceAsStream(resourceName); + if (is == null) { +@@ -158,6 +159,6 @@ public enum Native { + tempLib.deleteOnExit(); + tempLibLock.deleteOnExit(); + } +- } ++ }*/ + } + } diff --git a/dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild b/dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild deleted file mode 100644 index 45a7f75b6a3c..000000000000 --- a/dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright 2021-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -JAVA_PKG_IUSE="doc source test" -MAVEN_ID="org.lz4:lz4-java:1.8.0" - -inherit java-pkg-2 java-ant-2 toolchain-funcs - -DESCRIPTION="LZ4 compression for Java" -HOMEPAGE="https://github.com/lz4/lz4-java" -SRC_URI="https://github.com/lz4/lz4-java/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" - -# Tests require com.carrotsearch.randomizedtesting:junit4-ant, which is yet to -# be packaged. Some extra steps are required before running the tests: -# 1. Download junit4-ant 2.7.x from https://mvnrepository.com/artifact/com.carrotsearch.randomizedtesting/junit4-ant -# 2. Set EANT_GENTOO_CLASSPATH_EXTRA to the path to junit4-ant-2.7.*.jar -# 3. ppc64 only: Install test dependencies that are unkeyworded -# 4. Set ALLOW_TEST="all" -RESTRICT="test" - -CDEPEND=" - app-arch/lz4:= -" - -DEPEND=" - >=virtual/jdk-1.8:* - dev-java/mvel:2.5 - dev-libs/xxhash - test? ( - dev-java/junit:4 - dev-java/randomized-runner:0 - ) - ${CDEPEND} -" - -RDEPEND=" - >=virtual/jre-1.8:* - ${CDEPEND} -" - -# Ant is only needed to generate JNI headers; -# the JNI shared object will be built by the custom Makefile -EANT_BUILD_TARGET="compile-java generate-headers" -EANT_DOC_TARGET="docs" -EANT_EXTRA_ARGS="-Djava.io.tmpdir=${T}" -EANT_TEST_GENTOO_CLASSPATH="randomized-runner" - -pkg_setup() { - java-pkg-2_pkg_setup - local build_only_cp="$(java-pkg_getjars --build-only mvel-2.5)" - if [[ -z "${EANT_GENTOO_CLASSPATH_EXTRA}" ]]; then - EANT_GENTOO_CLASSPATH_EXTRA="${build_only_cp}" - else - EANT_GENTOO_CLASSPATH_EXTRA+=":${build_only_cp}" - fi -} - -src_prepare() { - eapply "${FILESDIR}/${P}-print-os-props.patch" - eapply "${FILESDIR}/${P}-skip-ivy.patch" - cp "${FILESDIR}/${P}-r1-Makefile" Makefile || die "Failed to copy Makefile" - cp "${FILESDIR}/${P}-gentoo-classpath.xml" gentoo-classpath.xml || - die "Failed to copy Gentoo classpath injection XML" - java-pkg-2_src_prepare - rm -r src/resources || die "Failed to remove pre-built shared libraries" -} - -src_compile() { - java-pkg-2_src_compile - emake CC="$(tc-getCC)" JAVA_HOME="${JAVA_HOME}" - # JNI has already been built by the Makefile at this point - # Also pretend cpptasks is available, which is required by build.xml - EANT_EXTRA_ARGS+=" -Dcpptasks.available=true -Dskip.jni=true" - # Manually call 'ant jar' to include the JNI shared object in JAR - eant jar -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGS} -} - -src_test() { - java-pkg-2_src_test -} - -src_install() { - java-pkg_newjar 'dist/${ivy.module}.jar' - java-pkg_doso $(find build/jni -name "*.so") - use doc && java-pkg_dojavadoc build/docs - # Ant project's 'sources' target generates a source JAR rather than a Zip - # archive; we simply let java-utils-2.eclass create the source Zip archive - # from the same source directories the 'sources' target would access - # https://github.com/lz4/lz4-java/blob/1.8.0/build.xml#L323-L330 - use source && java-pkg_dosrc src/java/* src/java-unsafe/* -} diff --git a/dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild b/dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild new file mode 100644 index 000000000000..430ed388f301 --- /dev/null +++ b/dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild @@ -0,0 +1,95 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="org.lz4:lz4-java:${PV}" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple toolchain-funcs + +DESCRIPTION="LZ4 compression for Java" +HOMEPAGE="https://github.com/lz4/lz4-java" +SRC_URI="https://github.com/lz4/lz4-java/archive/${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${P}" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + +DEPEND=" + app-arch/lz4:= + dev-java/mvel:2.5 + dev-libs/xxhash:0 + >=virtual/jdk-1.8:* + test? ( dev-java/randomized-runner:0 )" +RDEPEND=" + app-arch/lz4:= + >=virtual/jre-1.8:*" + +PATCHES=( "${FILESDIR}/${P}-fix-load.patch" ) + +DOCS=( CHANGES.md README.md ) + +JAVA_AUTOMATIC_MODULE_NAME="org.lz4.java" +JAVA_SRC_DIR=( src/java{,-unsafe} ) +JAVA_TEST_GENTOO_CLASSPATH="junit-4 randomized-runner" +JAVA_TEST_RESOURCE_DIRS="src/test-resources" +JAVA_TEST_SRC_DIR="src/test" + +src_prepare() { + default +} + +src_compile() { + # remove precompiled native libraries + rm -r src/resources || die + + # cannot include template 'decompressor.template': file not found.] + cp src/build/source_templates/* . || die + + einfo "Code generation" + "$(java-config -J)" \ + -Dout.dir="src/java" \ + -cp "$(java-pkg_getjars --build-only mvel-2.5)" \ + org.mvel2.sh.Main \ + src/build/gen_sources.mvel \ + || die + + java-pkg-simple_src_compile + + einfo "Generate headers" # build.xml lines 194-204 + ejavac -h build/jni-headers -classpath "target/classes" \ + src/java/net/jpountz/xxhash/XXHashJNI.java \ + src/java/net/jpountz/lz4/LZ4JNI.java || die + + einfo "Generate native library" + # https://devmanual.gentoo.org/ebuild-writing/functions/src_compile/no-build-system + mkdir -p build/objects/src/jni + mkdir -p build/jni/net/jpountz/util/linux/amd64 + "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \ + -I$(java-config -O)/../include -I$(java-config -O)/../include/linux \ + -I$(java-config -O)/include -I$(java-config -O)/include/linux \ + -Ibuild/jni-headers \ + -c -o build/objects/src/jni/net_jpountz_lz4_LZ4JNI.o \ + src/jni/net_jpountz_lz4_LZ4JNI.c + "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \ + -I$(java-config -O)/../include -I$(java-config -O)/../include/linux \ + -I$(java-config -O)/include -I$(java-config -O)/include/linux \ + -Ibuild/jni-headers \ + -c -o build/objects/src/jni/net_jpountz_xxhash_XXHashJNI.o \ + src/jni/net_jpountz_xxhash_XXHashJNI.c + + "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \ + -shared \ + -Wl,-soname,liblz4-java.so \ + -o liblz4-java.so \ + build/objects/src/jni/net_jpountz_lz4_LZ4JNI.o \ + build/objects/src/jni/net_jpountz_xxhash_XXHashJNI.o -llz4 +} + +src_install() { + java-pkg-simple_src_install + java-pkg_doso liblz4-java.so +} |