summaryrefslogtreecommitdiff
path: root/dev-java
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/Manifest.gzbin58148 -> 58151 bytes
-rw-r--r--dev-java/json-smart/Manifest4
-rw-r--r--dev-java/json-smart/json-smart-2.5.0.ebuild71
-rw-r--r--dev-java/json-smart/metadata.xml1
-rw-r--r--dev-java/json/Manifest5
-rw-r--r--dev-java/json/files/json-20231013-JSONObjectTest.patch31
-rw-r--r--dev-java/json/json-20231013-r1.ebuild (renamed from dev-java/json/json-20231013.ebuild)14
-rw-r--r--dev-java/lz4-java/Manifest3
-rw-r--r--dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch32
-rw-r--r--dev-java/lz4-java/lz4-java-1.8.0-r2.ebuild97
-rw-r--r--dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild95
11 files changed, 210 insertions, 143 deletions
diff --git a/dev-java/Manifest.gz b/dev-java/Manifest.gz
index 62ae71b00261..d76c31738c86 100644
--- a/dev-java/Manifest.gz
+++ b/dev-java/Manifest.gz
Binary files differ
diff --git a/dev-java/json-smart/Manifest b/dev-java/json-smart/Manifest
index 959ada7a750b..cc44bcbcad93 100644
--- a/dev-java/json-smart/Manifest
+++ b/dev-java/json-smart/Manifest
@@ -1,3 +1,5 @@
DIST json-smart-1.3.3.tar.gz 49430 BLAKE2B 805e16e0de5321a2e8164468757e9b722849f0fe90fd6822cc99f7afffd9f4e480fc4e14c2bbd12b325a27abc8ca7e93b4a17ce56ac352117cef336e1ebb3fe9 SHA512 c6006c6a00a085ea8810e18889450d11240dc3671351f20602214db418107808df1f413fe67c199d6529e4c0087f2533601826666ac4fa493bcaf72d2c18ed83
+DIST json-smart-2.5.0.tar.gz 88839 BLAKE2B 25760bd9c9ddecfef2fc3e60fc28b83def2223c7fc1e52ef39b3e6d01e5f2f29f36a35bfd43fc4d6ce6d5df5fcb25f59b1c86e1864a3044c69a6d0010335280b SHA512 4bffadf68998da4b63b34bcc9dbf804fd2b21b8d9514de4e155127d5a2eb3db74c7e396959b54c61c08e169eeed85dff3ad2f1d899cfddca53e501c45cebae21
EBUILD json-smart-1.3.3.ebuild 677 BLAKE2B 089132dec7953a4be817a978d8c858e4bc795781235f280c687cbb2f77e30ab7e0d48cb3899e5f69bc68d916adbc29563202d5c8dc84b7fc31f6a72ea7dba288 SHA512 db7c3ae30ca5a871aab7ee28e898cfdef844e395bae3b35621ae79fa2b3485d0f694635efeb507fd03ebce679dbbec87e6f938b88f1b459f3e86a3a9eb6d4cc2
-MISC metadata.xml 581 BLAKE2B cb4940f8ccd37d65394767bb34d8bbc8b6894c04cce7c414a7aa999f970315dda859a9d44a99cf64bb808910d7e48f11807d3dc495e0b74f85bfe727889d257d SHA512 19ffaef2fcf62e7ce10bbd689d935d41a74ffbbc528255740dced2a63cf4748de4f4f337d7c974404a746936e1db7e96520952b6edad42405b013bed649f2716
+EBUILD json-smart-2.5.0.ebuild 1633 BLAKE2B 93a8d99d0c5c2dc7cbbc65e0c4f0bff46948ca48e5aae496703dee4d010f9cdd4f57c0194351f2a650c2f2414e75d2c716e696eaf47ccec73c8d5b55c8349ecd SHA512 b0d3e4bc422a1e95296334e8867b0a7b259cbfb019c526ca7856534e1a4eb3fc372887abc8de340cc8ef2356d4a0da558e13be8a9fe0d867d5f6511c2fdc0cfd
+MISC metadata.xml 642 BLAKE2B c365803a643b02f870ff0658d1184c227a243f1d9801ddfa9f5c487412f390a4714b75f461ad5b4acf589da5f0201df19e10126c5ccd2a2685c77edd5c774765 SHA512 f28271bf046bdcec40f7c8fa824d8eaf0d222c082412c08f9e9f3a766769d8c5c29e32cb4136f0722ae4400ce9fbf28776880c0d10903ccabe2a1d6953cee3ac
diff --git a/dev-java/json-smart/json-smart-2.5.0.ebuild b/dev-java/json-smart/json-smart-2.5.0.ebuild
new file mode 100644
index 000000000000..bed1dc2846b3
--- /dev/null
+++ b/dev-java/json-smart/json-smart-2.5.0.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc source test"
+MAVEN_PROVIDES="
+ net.minidev:accessors-smart:${PV}
+ net.minidev:json-smart:${PV}
+"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="JSON Small and Fast Parser"
+HOMEPAGE="https://urielch.github.io"
+SRC_URI="https://github.com/netplex/json-smart-v2/archive/${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-v2-${PV}"
+
+LICENSE="Apache-2.0"
+SLOT="2"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+RESTRICT="test" #839681
+
+DEPEND="
+ dev-java/asm:9
+ >=virtual/jdk-1.8:*
+"
+RDEPEND=">=virtual/jre-1.8:*"
+
+src_compile() {
+ einfo "Compiling accessors-smart.jar"
+ JAVA_CLASSPATH_EXTRA="asm-9"
+ JAVA_JAR_FILENAME="accessors-smart.jar"
+ JAVA_SRC_DIR="accessors-smart/src/main/java"
+ java-pkg-simple_src_compile
+ JAVA_GENTOO_CLASSPATH_EXTRA+=":accessors-smart.jar"
+ rm -r target || die
+
+ einfo "Compiling json-smart.jar"
+ JAVA_JAR_FILENAME="json-smart.jar"
+ JAVA_SRC_DIR="json-smart/src/main/java"
+ java-pkg-simple_src_compile
+ JAVA_GENTOO_CLASSPATH_EXTRA+=":json-smart.jar"
+ rm -r target || die
+
+ if use doc; then
+ einfo "Compiling javadocs"
+ JAVA_SRC_DIR=(
+ accessors-smart/src/main/java
+ json-smart/src/main/java
+ )
+ JAVA_JAR_FILENAME="ignoreme.jar"
+ java-pkg-simple_src_compile
+ fi
+}
+
+src_install() {
+ einstalldocs
+ java-pkg_dojar "accessors-smart.jar"
+ java-pkg_dojar "json-smart.jar"
+
+ if use doc; then
+ java-pkg_dojavadoc target/api
+ fi
+
+ if use source; then
+ java-pkg_dosrc "accessors-smart/src/main/java/*"
+ java-pkg_dosrc "json-smart/src/main/java/*"
+ fi
+}
diff --git a/dev-java/json-smart/metadata.xml b/dev-java/json-smart/metadata.xml
index 4edced72dcda..d5b2471c532c 100644
--- a/dev-java/json-smart/metadata.xml
+++ b/dev-java/json-smart/metadata.xml
@@ -15,5 +15,6 @@
</maintainer>
<upstream>
<remote-id type="github">netplex/json-smart-v1</remote-id>
+ <remote-id type="github">netplex/json-smart-v2</remote-id>
</upstream>
</pkgmetadata>
diff --git a/dev-java/json/Manifest b/dev-java/json/Manifest
index 9d42235ee19a..f242a93b2403 100644
--- a/dev-java/json/Manifest
+++ b/dev-java/json/Manifest
@@ -1,9 +1,6 @@
-AUX json-20231013-JSONObjectTest.patch 1361 BLAKE2B 959e4593b032594e7f6e8b1e901f57e8efc72291723aba9fb49c374b7a5e359f0e99a943bfbbd82450a2b780f95d4c4c6c703d5cacedeede5db9e247696726b4 SHA512 5ab446ca02d8d17568e45000f91d859a3a150fae442aed0ae2f8139e5af61b26d62f59878a1fe5643e76518655cfda812525069b95bc485c59e5f47ebb90a349
-DIST asm-1.0.2.jar 71757 BLAKE2B f4aaaba90cbe5a0e22c236c7d368e1ee7513511d924d8c19a4218abcbc874832bfa219024c0758933b855cd4eba351458c500bbbe66123d54a4d384383dfcb4d SHA512 469ad53734d02b685506921e9318fc649da373eab5febfe23697f0ed948d04aa74e77792834f7cf2438a6b8bb91550cbb4d64c5037556dafa48118842fa7c881
DIST json-20220320.tar.gz 229462 BLAKE2B 9d549e4e905e2a63985b0b2d9a6cfbf7483776799d6b907455356940b48242fda9344874f1625da06215991eae1cfa1e87f3f8f0a204807795ed50f3f9afdbc2 SHA512 1bcd99c69201ea6609a41ec1679467504cd129a8c5a9caede0829cd8eb70b0e59e504a4bc409f57e6b27091e11acbf6108830c6f1fe16919d0cb1daff643bdf0
DIST json-20231013.tar.gz 240211 BLAKE2B c0594f89c2b02273c736c0fc362f1e3d519d3d88b7e708e64bbd5ca202f539368e9856e311dd9ad42a24c317cfd727feed5af215fbc5e9bbcb18e797323684c8 SHA512 4c5eb3e9ef77825c9e7b874c9084b5bb75b39c527c3cb419fc45171e0d11b24796931a2d16255500ed86610da3ac7805b302ec0b1051f97c97795580dca7c183
DIST json-path-2.1.0.jar 189658 BLAKE2B 2813abfc3b6c758f600bb5e8f8b73eac8dc2a642d461bc26c569a650378ea65cebf691afe975fa2dca406eb324863c36c4623b21c1df2cb83c92e6859b5a9d85 SHA512 c16fc68a04945ad49eb96c38f68a8b4ff351ab1bbc51685f42d22723b2dee4b827ba45cb6b8167199e3f4d22e668ef58665558beec8e11399ac547e9fcebd9f6
-DIST json-smart-2.5.0.jar 120233 BLAKE2B fb6f89b6df02789d24b650b9c55130363ee235af09f1446926135bf2f4de33757a3d4fd26f0e7f24e44532e21c5453022c781d8fec85e34ea4da92ce4ac992ae SHA512 56284bb3cee2bcc3684cdcc610115c7eacafdbd70aa852cb0209616b0503dfd448c5110b50e11a71b1c61a6e7ea27594ff63cc968230374555cc6f652d69d372
EBUILD json-20220320.ebuild 1482 BLAKE2B 36157695be78f2cce807513e2525c1446f32618596d6a181c83cd8d9c4ebc139eacb2c314325352e49dfb9ec36d1a508c8fd5664522b956172de289706f2ef55 SHA512 aa15265508c64bc0486b911766cf988b2a6d38a50ef4519c7a60690278d533e9bcc4fb9f04084999da2022882f90220bceabd400408c3253bba4fdcb5bca2076
-EBUILD json-20231013.ebuild 1901 BLAKE2B 62eb8a7abab48dcb598c215d541b3a6252e5ca6d9f7f43a40e3f2f2b6d92243f95c80050864ecd3b71e71f8312e86ec7c4575b0eaa3e2c91ba7d7d6b15a60b3c SHA512 d080582f71b67c82fa3dcb82c0ba7e478c9a56ead393a38df8864c5966c5cc61ddf672715560186fb6819d62b32f06d2c5937818ee2a296016fbd59f8d19400c
+EBUILD json-20231013-r1.ebuild 1496 BLAKE2B 994d4f2418ab8abd682dfde91c49ab04f4f6b9f79cab43f661277b2036234ad2e4827b630e618cb296de8d486f455e76dd3e6a29dda249136280802d961b7cac SHA512 062dd624d56f1069f778c11b17cdeb4fa70a0aa78488bc7fb7cbff2e1c7bbd840608da41ee4a2977ee015ade666d5177219a784c3d001d71bf30fd617f466178
MISC metadata.xml 1083 BLAKE2B 9dfa3392b02d2bb6ae3198a884c154a52926de81aead27309fd0bbe25011a1b0ea89c0c7fa3694c56fee4cb339c2fd161384c9d7c780369cc3da4464d3abd40a SHA512 3d0f231f0e67e178f838474e6aa07e88dffc26e26261a49515124c3e68120d323cc1a790be017b082af8f27dd051121750c1e1829e7a2fc2714821caf9a8802b
diff --git a/dev-java/json/files/json-20231013-JSONObjectTest.patch b/dev-java/json/files/json-20231013-JSONObjectTest.patch
deleted file mode 100644
index e077f19bd5a1..000000000000
--- a/dev-java/json/files/json-20231013-JSONObjectTest.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-There was 1 failure:
-1) jsonObjectByBean1(org.json.junit.JSONObjectTest)
-com.jayway.jsonpath.PathNotFoundException: No results for path: $['mockitoInterceptor']
- at com.jayway.jsonpath.internal.path.EvaluationContextImpl.getValue(EvaluationContextImpl.java:131)
- at com.jayway.jsonpath.JsonPath.read(JsonPath.java:187)
- at com.jayway.jsonpath.internal.JsonContext.read(JsonContext.java:164)
- at com.jayway.jsonpath.internal.JsonContext.read(JsonContext.java:151)
- at com.jayway.jsonpath.JsonPath.read(JsonPath.java:488)
- at org.json.junit.JSONObjectTest.jsonObjectByBean1(JSONObjectTest.java:634)
-
-FAILURES!!!
-Tests run: 668, Failures: 1
---- a/src/test/java/org/json/junit/JSONObjectTest.java
-+++ b/src/test/java/org/json/junit/JSONObjectTest.java
-@@ -56,6 +56,7 @@ import org.json.junit.data.Singleton;
- import org.json.junit.data.SingletonEnum;
- import org.json.junit.data.WeirdList;
- import org.junit.Test;
-+import org.junit.Ignore;
-
- import com.jayway.jsonpath.Configuration;
- import com.jayway.jsonpath.JsonPath;
-@@ -601,7 +602,7 @@ public class JSONObjectTest {
- * bean getters return valid JSON types
- */
- @SuppressWarnings("boxing")
-- @Test
-+ @Test @Ignore
- public void jsonObjectByBean1() {
- /**
- * Default access classes have to be mocked since JSONObject, which is
diff --git a/dev-java/json/json-20231013.ebuild b/dev-java/json/json-20231013-r1.ebuild
index 3a3262132a5c..a11eb3f69c95 100644
--- a/dev-java/json/json-20231013.ebuild
+++ b/dev-java/json/json-20231013-r1.ebuild
@@ -14,8 +14,6 @@ HOMEPAGE="https://github.com/stleary/JSON-java"
SRC_URI="https://codeload.github.com/stleary/JSON-java/tar.gz/${PV} -> ${P}.tar.gz
test? (
https://repo1.maven.org/maven2/com/jayway/jsonpath/json-path/2.1.0/json-path-2.1.0.jar
- https://repo1.maven.org/maven2/net/minidev/json-smart/2.5.0/json-smart-2.5.0.jar
- https://repo1.maven.org/maven2/net/minidev/asm/1.0.2/asm-1.0.2.jar
)"
S="${WORKDIR}/JSON-java-${PV}"
@@ -26,23 +24,25 @@ KEYWORDS="~amd64 ~x86"
DEPEND="
>=virtual/jdk-1.8:*
test? (
+ dev-java/asm:9
+ dev-java/json-smart:2
+ dev-java/mockito:4
dev-java/slf4j-api:0
- dev-java/mockito:0
)
"
RDEPEND=">=virtual/jre-1.8:*"
DOCS=( {CONTRIBUTING,README,SECURITY}.md )
-PATCHES=( "${FILESDIR}/json-20231013-JSONObjectTest.patch" )
JAVA_AUTOMATIC_MODULE_NAME="org.json"
JAVA_SRC_DIR="src/main/java"
JAVA_TEST_GENTOO_CLASSPATH="
asm-9
+ json-smart-2
junit-4
- mockito
+ mockito-4
slf4j-api
"
JAVA_TEST_RESOURCE_DIRS="src/test/resources"
@@ -55,10 +55,6 @@ src_prepare() {
src_test() {
JAVA_GENTOO_CLASSPATH_EXTRA="${DISTDIR}/json-path-2.1.0.jar" # Test compile dependency
- JAVA_GENTOO_CLASSPATH_EXTRA+=":${DISTDIR}/json-smart-2.5.0.jar" # Test runtime dependency
-
- # Exception java.lang.NoClassDefFoundError: net/minidev/asm/FieldFilter
- JAVA_GENTOO_CLASSPATH_EXTRA+=":${DISTDIR}/asm-1.0.2.jar" # Test runtime dependency
local vm_version="$(java-config -g PROVIDES_VERSION)"
if ver_test "${vm_version}" -ge 17; then
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
+}