Files
brotli4j/brotli4j-loadlibrary.patch
Fridrich Strba 90ec65b68a Accepting request 1042190 from home:urbic:java
- Update to v1.8.0
  * Changes:
    + Apple Silicon M1 support
    + Dependencies upgrade
- Update to v1.7.1
  * Minor code improvements
- Update to v1.7.0
  * Use Netty Buffer API for Buffer pooling
  * Avoid creating 'byte[]' copies on decompression which leads
    to less garbage generation
- Update patch brotli4j-loadlibrary.patch
- Add build dependency on mvn(io.netty:netty-buffer) and add netty
  to build classpath

OBS-URL: https://build.opensuse.org/request/show/1042190
OBS-URL: https://build.opensuse.org/package/show/Java:packages/brotli4j?expand=0&rev=7
2022-12-12 07:20:42 +00:00

37 lines
1.7 KiB
Diff

diff -up Brotli4j-1.7.1/brotli4j/src/main/java/com/aayushatharva/brotli4j/Brotli4jLoader.java.fix Brotli4j-1.7.1/brotli4j/src/main/java/com/aayushatharva/brotli4j/Brotli4jLoader.java
--- Brotli4j-1.7.1/brotli4j/src/main/java/com/aayushatharva/brotli4j/Brotli4jLoader.java.fix 2022-04-27 16:07:17.625617915 +0300
+++ Brotli4j-1.7.1/brotli4j/src/main/java/com/aayushatharva/brotli4j/Brotli4jLoader.java 2022-04-27 16:11:54.854104500 +0300
@@ -34,30 +34,11 @@ public class Brotli4jLoader {
static {
Throwable cause = null;
try {
- System.loadLibrary("brotli");
- } catch (Throwable t) {
- try {
- String nativeLibName = System.mapLibraryName("brotli");
- String libPath = "/lib/" + getPlatform() + "/" + nativeLibName;
-
- File tempDir = new File(System.getProperty("java.io.tmpdir"), "com_aayushatharva_brotli4j_" + System.nanoTime());
- tempDir.mkdir();
- tempDir.deleteOnExit();
-
- File tempFile = new File(tempDir, nativeLibName);
-
- try (InputStream in = Brotli4jLoader.class.getResourceAsStream(libPath)) {
- Files.copy(in, tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
- } catch (Throwable throwable) {
- tempFile.delete();
- throw throwable;
- }
-
- System.load(tempFile.getAbsolutePath());
+ String nativeLibPath = "@LIBDIR@/" + System.mapLibraryName("brotli");
+ System.load(nativeLibPath);
} catch (Throwable throwable) {
cause = throwable;
}
- }
UNAVAILABILITY_CAUSE = cause;
}