Package: gkl / 0.8.10+dfsg-3

load_native_library_from_canonical_dir.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Description: loading the native library from /usr/lib/jni as we don't want to
 bundle the shared libraries into the jar.
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2022-09-22

--- a/src/main/java/com/intel/gkl/NativeLibraryLoader.java
+++ b/src/main/java/com/intel/gkl/NativeLibraryLoader.java
@@ -96,7 +96,7 @@
         final String systemLibraryName = System.mapLibraryName(libraryName);
 
         // load from the java.library.path
-        if (System.getenv(USE_LIBRARY_PATH) != null) {
+        //if (System.getenv(USE_LIBRARY_PATH) != null) {
             final String javaLibraryPath = System.getProperty("java.library.path");
 
             try {
@@ -108,35 +108,6 @@
                 logger.warn(String.format("OVERRIDE DEFAULT: Unable to load %s from %s", systemLibraryName, javaLibraryPath));
                 return false;
             }
-        }
-
-        // load from the java classpath
-        final String resourcePath = "native/" +  systemLibraryName;
-        final URL inputUrl = NativeLibraryLoader.class.getResource(resourcePath);
-        if (inputUrl == null) {
-            logger.warn(String.format("Unable to find native library: %s" , resourcePath));
-            return false;
-        }
-        logger.info(String.format("Loading %s from %s", systemLibraryName, inputUrl.toString()));
-
-        try {
-            final File temp = File.createTempFile(FilenameUtils.getBaseName(resourcePath),
-                    "." + FilenameUtils.getExtension(resourcePath), tempDir);
-            FileUtils.copyURLToFile(inputUrl, temp);
-            temp.deleteOnExit();
-            if(checkPath(temp.getAbsolutePath())) {
-                System.load(temp.getAbsolutePath());
-                logger.debug(String.format("Extracting %s to %s", systemLibraryName, temp.getAbsolutePath()));
-            }
-            else{
-                logger.warn(String.format("Unable to load %s to %s", systemLibraryName, temp.getAbsolutePath()));
-            }
-        } catch (Exception|Error e) {
-            logger.warn(String.format("Unable to load %s from %s (%s)", systemLibraryName, resourcePath, e.getMessage()));
-            return false;
-        }
-
-        loadedLibraries.add(libraryName);
-        return true;
+        //}
     }
 }
--- a/build.gradle
+++ b/build.gradle
@@ -136,6 +136,7 @@
     baseName = "gkl"
     // include LICENSE file in jar
     from "LICENSE"
+    exclude('**/*.so')
 }
 
 task javadocJar(type: Jar, dependsOn: javadoc) {