commit: cf214682cf6f27a30d12877ecb98c8e9e4255ff0 Author: Bryan Gardiner <bog <AT> khumba <DOT> net> AuthorDate: Fri May 26 04:47:39 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri May 26 08:28:06 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf214682
sci-libs/gdal: fix the build of the Java bindings GDAL uses FindJNI.cmake which is unable to find a Java VM on its own. This change passes in the system VM symlink explicitly, and also installs the JNI shared library in the proper location for Gentoo via 'java-pkg_doso', rather than in the same directory as the JAR. Bug: https://bugs.gentoo.org/857816 Signed-off-by: Bryan Gardiner <bog <AT> khumba.net> Signed-off-by: Sam James <sam <AT> gentoo.org> sci-libs/gdal/gdal-3.7.0.ebuild | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sci-libs/gdal/gdal-3.7.0.ebuild b/sci-libs/gdal/gdal-3.7.0.ebuild index 7015e10d415d..81842eb4e7bf 100644 --- a/sci-libs/gdal/gdal-3.7.0.ebuild +++ b/sci-libs/gdal/gdal-3.7.0.ebuild @@ -212,6 +212,9 @@ src_configure() { # Bindings -DBUILD_PYTHON_BINDINGS=$(usex python) -DBUILD_JAVA_BINDINGS=$(usex java) + $(usex java -DJAVA_AWT_LIBRARY=/etc/java-config-2/current-system-vm/lib '') + $(usex java -DJAVA_JVM_LIBRARY=/etc/java-config-2/current-system-vm/lib '') + $(usex java -DJAVA_INCLUDE_PATH=/etc/java-config-2/current-system-vm/include '') # bug #845369 -DBUILD_CSHARP_BINDINGS=OFF @@ -260,10 +263,25 @@ src_test() { src_install() { cmake_src_install use python && python_optimize + + if use java; then + # Move the native library into the proper place for Gentoo. The + # library in ${D} has already had its RPATH fixed, so we use it + # rather than ${BUILD_DIR}/swig/java/libgdalalljni.so. + java-pkg_doso "${D}/usr/share/java/libgdalalljni.so" + rm "${D}/usr/share/java/libgdalalljni.so" || die + fi + # TODO: install docs? } pkg_postinst() { elog "Check available image and data formats after building with" elog "gdalinfo and ogrinfo (using the --formats switch)." + + if use java; then + elog + elog "To use the Java bindings, you need to pass the following to java:" + elog " -Djava.library.path=$(java-config -i gdal)" + fi }
