Bug#947960: gdal: Doesn't build on ports without java
Samuel Thibault
sthibault at debian.org
Thu Jan 2 19:32:30 GMT 2020
Source: gdal
Version: 2.4.3+dfsg-1
Severity: important
Tags: patch
User: debian-hurd at lists.debian.org
Usertags: hurd
Hello,
gdal currently doesn't build on ports without java support. The attached
patch fix that: they disable the defaul-jdk-headless and ant build-deps
on non-java ports, they enable the libgdal-java package only on java
ports, pass --with-java to configure only on java ports, and install
java bits only on java ports.
Samuel
-- System Information:
Debian Release: bullseye/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'proposed-updates'), (500, 'oldstable-proposed-updates-debug'), (500, 'oldstable-proposed-updates'), (500, 'oldoldstable'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.4.0 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
--
Samuel
<r> make
<r> oops
<m> make clean
-------------- next part --------------
--- debian/control.original 2020-01-01 19:37:51.000000000 +0000
+++ debian/control 2020-01-02 02:40:25.000000000 +0000
@@ -8,10 +8,10 @@
dh-autoreconf,
dh-python,
d-shlibs,
- default-jdk-headless,
+ default-jdk-headless [!hppa !hurd-any !kfreebsd-any],
doxygen,
graphviz,
- ant,
+ ant [!hppa !hurd-any !kfreebsd-any],
chrpath,
libarmadillo-dev,
libcfitsio-dev,
@@ -317,7 +317,7 @@
GDAL/OGR library.
Package: libgdal-java
-Architecture: any
+Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32
Section: java
Depends: ${shlibs:Depends},
${misc:Depends}
--- debian/rules.original 2019-11-04 11:53:34.000000000 +0000
+++ debian/rules 2020-01-02 02:41:59.000000000 +0000
@@ -48,6 +48,14 @@
WITH_HDF5:=
endif
+ifeq (,$(findstring $(DEB_HOST_ARCH), hppa hurd-i386 kfreebsd-i386 kfreebsd-amd64))
+ WITH_JAVA:=--with-java=/usr/lib/jvm/default-java
+ BINDINGS:=perl java
+else
+ WITH_JAVA:=
+ BINDINGS:=perl
+endif
+
NJOBS := -j1
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
NJOBS := -j$(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
@@ -144,7 +152,7 @@
--with-xerces \
--with-zstd \
--with-dods-root=/usr \
- --with-java=/usr/lib/jvm/default-java \
+ $(WITH_JAVA) \
--with-perl \
--with-python; \
mv GDALmake.opt GDALmake.opt-$$V; \
@@ -155,7 +163,9 @@
$(MAKE) $(NJOBS) lib-target apps-target
rm -rf $(CURDIR)/swig/perl/*.c $(CURDIR)/swig/perl/*.cpp
$(MAKE) $(NJOBS) -C $(CURDIR)/swig/perl generate build doc
+ifneq ($(WITH_JAVA),)
$(MAKE) $(NJOBS) -C $(CURDIR)/swig/java clean generate build
+endif
# It needs pre-installing just after the building due to intermediate cleaning.
for V in $(PYVERS); do \
@@ -172,7 +182,7 @@
override_dh_auto_install:
cp `ls GDALmake.opt-*|tail -1` GDALmake.opt
- $(MAKE) $(NJOBS) install BINDINGS="perl java" DESTDIR=$(CURDIR)/debian/tmp
+ $(MAKE) $(NJOBS) install BINDINGS="$(BINDINGS)" DESTDIR=$(CURDIR)/debian/tmp
$(MAKE) $(NJOBS) install-docs DESTDIR=$(CURDIR)/debian/tmp \
"INST_DOCS=\$$(prefix)/share/doc/libgdal-doc"\
"INST_MAN=\$$(prefix)/share/man"
@@ -181,15 +191,18 @@
"INST_MAN=\$$(prefix)/share/man"
# install python stuff previuosly built and pre-installed
+ install -o root -g root -d $(CURDIR)/debian/tmp/usr/lib
cp -a $(CURDIR)/debian/python-tmp/usr/lib/* $(CURDIR)/debian/tmp/usr/lib/.
install -o root -g root -d $(CURDIR)/debian/tmp/usr/bin
install -o root -g root -m 755 $(CURDIR)/swig/python/scripts/*.py $(CURDIR)/debian/tmp/usr/bin/.
+ifneq ($(WITH_JAVA),)
# java stuff
mkdir -p $(CURDIR)/debian/tmp/usr/share/java $(CURDIR)/debian/tmp/usr/lib/jni
install -o root -g root -m 644 $(CURDIR)/swig/java/gdal.jar $(CURDIR)/debian/tmp/usr/share/java/.
install -o root -g root -m 644 $(CURDIR)/debian/tmp/usr/lib/*jni.so* $(CURDIR)/debian/tmp/usr/lib/jni
rm -f $(CURDIR)/debian/tmp/usr/lib/*jni.so*
+endif
# removing useless autogenerated man pages
rm -f $(CURDIR)/debian/tmp/usr/share/man/man1/_*_apps_.1
More information about the Pkg-grass-devel
mailing list