summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Gardiner <bog@khumba.net>2023-05-25 21:47:39 -0700
committerSam James <sam@gentoo.org>2023-05-26 09:28:06 +0100
commitcf214682cf6f27a30d12877ecb98c8e9e4255ff0 (patch)
treea2985f4e358630820c3bce30b8485153192ee160 /sci-libs
parentgui-libs/gtk: backport fix for Nautilus delete (+ 2 other fixes) (diff)
downloadgentoo-cf214682cf6f27a30d12877ecb98c8e9e4255ff0.tar.gz
gentoo-cf214682cf6f27a30d12877ecb98c8e9e4255ff0.tar.bz2
gentoo-cf214682cf6f27a30d12877ecb98c8e9e4255ff0.zip
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@khumba.net> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/gdal/gdal-3.7.0.ebuild18
1 files changed, 18 insertions, 0 deletions
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
}