Blob Blame Raw
From d3695f95a95e834ed13c8f02f21feaf22ce51627 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 8 Mar 2012 14:54:23 +0100
Subject: [PATCH] Fix JNI

Prefer JNI and poved JNI files per Java Fedora packaging guidelines
---
 packages/jpl/jpl.pl                |    5 +++--
 packages/jpl/src/java/jpl/JPL.java |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/packages/jpl/jpl.pl b/packages/jpl/jpl.pl
index 83b8aee..f614d9e 100644
--- a/packages/jpl/jpl.pl
+++ b/packages/jpl/jpl.pl
@@ -4390,7 +4390,8 @@ prolog:error_message(java_exception(Ex)) -->
 :- multifile user:file_search_path/2.
 :- dynamic   user:file_search_path/2.
 
-user:file_search_path(jar, swi(lib)).
+user:file_search_path(jar, 'LIBDIR/swipl-jpl').
+user:file_search_path(jni, 'LIBDIR/swipl-jpl').
 
 %%	add_search_path(+Var, +Value) is det.
 %
@@ -4534,7 +4535,7 @@ add_jpl_to_classpath :-
 
 libjpl(File) :-
 	(   current_prolog_flag(unix, true)
-	->  File = foreign(libjpl)
+	->  File = jni(libjpl)
 	;   File = foreign(jpl)
 	).
 
diff --git a/packages/jpl/src/java/jpl/JPL.java b/packages/jpl/src/java/jpl/JPL.java
index 1c82d83..311355c 100644
--- a/packages/jpl/src/java/jpl/JPL.java
+++ b/packages/jpl/src/java/jpl/JPL.java
@@ -97,7 +97,7 @@ public class JPL {
 		} else if (nativeLibraryDir != null) {
             System.load((new File(nativeLibraryDir, System.mapLibraryName(nativeLibraryName))).getAbsolutePath());
 		} else {
-			System.loadLibrary(nativeLibraryName); // as resolved somewhere on system property 'java.library.path'
+			System.load((new File(LIBDIR, System.mapLibraryName(nativeLibraryName))).getAbsolutePath());
 		}
 	}
 	// setDTMMode
-- 
1.7.7.6