Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java bindings: change default installation directory of JNI shared lbrary and control it with GDAL_JAVA_JNI_INSTALL_DIR #8125

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

rouault
Copy link
Member

@rouault rouault commented Jul 20, 2023

No description provided.

…brary and control it with GDAL_JAVA_JNI_INSTALL_DIR
@rouault rouault added this to the 3.8.0 milestone Jul 20, 2023
@landryb
Copy link
Contributor

landryb commented Jul 20, 2023

thanks @rouault, that makes total sense and matches the previous autoconf behaviour.

@rouault
Copy link
Member Author

rouault commented Jul 20, 2023

matches the previous autoconf behaviour.

not exactly. the jni lib was installed in ${libdir}, not ${libdir}/jni . I've adopted the later based on the Debian conventions but it doesn't look there's a universal concensus on where to install those jni libs

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 66.972% (-0.001%) from 66.973% when pulling ab0acef on rouault:GDAL_JAVA_JNI_INSTALL_DIR into 6e268bb on OSGeo:master.

@landryb
Copy link
Contributor

landryb commented Jul 20, 2023

matches the previous autoconf behaviour.

not exactly. the jni lib was installed in ${libdir}, not ${libdir}/jni . I've adopted the later based on the Debian conventions but it doesn't look there's a universal concensus on where to install those jni libs

yes it seems jni is a debian thing, by default i've been told that the jvm looks into LD_LIBRARY_PATH/java.library.path which might differ depending on distros/oses.. @sebastic any opinion ?

@sebastic
Copy link
Contributor

yes it seems jni is a debian thing, by default i've been told that the jvm looks into LD_LIBRARY_PATH/java.library.path which might differ depending on distros/oses.. @sebastic any opinion ?

The jni subdirectory is a Debian convention, from the Java Policy:

If a Java library relies on native code, the dynamic libraries containing this compiled native code should be installed into the directory /usr/lib/jni.

Fedora has a different convention:

  • JNI shared objects MUST be placed in %{_libdir}/%{name}

[...]
Macro expansions
%{_jnidir} expands into %{_prefix}/lib/java, even on 64-bit systems. Java packages using JNI do not support multiarch installation.

@rouault
Copy link
Member Author

rouault commented Jul 21, 2023

@landryb @sebastic Do you think this is a move in the right direction ? Obviously the default value of the CMake variables will have to be customized in most situations

@sebastic
Copy link
Contributor

Do you think this is a move in the right direction ?

No sure. It's easy enough for packagers to move the files to the expected location for their distribution.

Since the Debian package doesn't include the Java bindings any more, it's all moot.

@landryb
Copy link
Contributor

landryb commented Jul 24, 2023

i think it's a move in the right direction because as a packager i wouldn't expect the .so to end up in the same place as the jars, but i agree it all depends on the default settings/lookup paths of the jdks for both types of files.

and it's more 'standard' to use cmake provided configure options to set the paths, rather than moving files post-install...

@rouault rouault merged commit 14d3423 into OSGeo:master Jul 24, 2023
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants