gentoo-ebuilds/dev-java/lz4-java/files/lz4-java-1.8.0-fix-load.patch
Miroslav Šulc 8daa785e9e
1.8.0: fixed loading of native library + enabled tests
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
2023-11-27 13:30:04 +01:00

32 lines
894 B
Diff

--- 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();
}
- }
+ }*/
}
}