diff options
author | Miroslav Šulc <fordfrog@gentoo.org> | 2023-11-27 13:29:53 +0100 |
---|---|---|
committer | Miroslav Šulc <fordfrog@gentoo.org> | 2023-11-27 13:30:04 +0100 |
commit | 8daa785e9ed2b599d57e8a13d6e064c4fbde5b85 (patch) | |
tree | 6d1111027868b695aab30a5b47af2ed2f1ea5320 /dev-java | |
parent | app-doc/doxygen: sync live (diff) | |
download | gentoo-8daa785e9ed2b599d57e8a13d6e064c4fbde5b85.tar.gz gentoo-8daa785e9ed2b599d57e8a13d6e064c4fbde5b85.tar.bz2 gentoo-8daa785e9ed2b599d57e8a13d6e064c4fbde5b85.zip |
1.8.0: fixed loading of native library + enabled tests
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-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-r4.ebuild (renamed from dev-java/lz4-java/lz4-java-1.8.0-r3.ebuild) | 9 |
2 files changed, 38 insertions, 3 deletions
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-r3.ebuild b/dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild index 36385b98f07f..430ed388f301 100644 --- a/dev-java/lz4-java/lz4-java-1.8.0-r3.ebuild +++ b/dev-java/lz4-java/lz4-java-1.8.0-r4.ebuild @@ -17,9 +17,6 @@ S="${WORKDIR}/${P}" LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" -# tests want sofile built into jar. -# cannot find /net/jpountz/util/linux/amd64/liblz4-java.so -RESTRICT="test" DEPEND=" app-arch/lz4:= @@ -31,6 +28,8 @@ 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" @@ -39,6 +38,10 @@ 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 |