Bug#892200: qdbm: FTBFS on arches without openjdk

Jason Duerstock <[email protected]>
Newsgroups gmane.linux.debian.ports.ia64
Message-ID <152035358813.24474.1950226055837807285.reportbug__31014.7264659919$1520353712$gmane$org@deb-ia64.gallaudet.edu>
Source: qdbm
Severity: normal
Tags: patch
User: [email protected]
Usertags: ia64

Dear Maintainer,

As currently configured, gcc-7 does not know where to find the Java jni.h headers if the arch is
using gcj rather than openjdk. [1]  The attached patch should clean up the Java detection and set
the relevant environment variables correctly.

[1] https://buildd.debian.org/status/fetch.php?pkg=qdbm&arch=ia64&ver=1.8.78-6.2&stamp=1518046955&raw=0


-- System Information:
Debian Release: buster/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: ia64

Kernel: Linux 3.14-0.bpo.2-mckinley (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
qdbm.diff.1 (text/plain, 782 B)
--- qdbm-1.8.78/debian/rules	2018-02-06 10:12:44.000000000 -0500
+++ qdbm-1.8.78-new/debian/rules	2018-03-06 11:19:25.125571799 -0500
@@ -43,13 +43,12 @@
 	--includedir=\$${prefix}/include/qdbm \
 	--enable-pthread --enable-zlib --enable-iconv
 
-DEFAULT_JAVA ?= $(shell readlink /etc/alternatives/java | sed s@/jre/bin/java@@)
-ifneq (,$(findstring /usr/bin/gij,$(DEFAULT_JAVA)))
+JAVA_HOME = /usr/lib/jvm/default-java
+CONFIGURE_VARS += JAVA_HOME="$(JAVA_HOME)"
+DEFAULT_JAVA ?= $(shell readlink -f $(JAVA_HOME)/bin/java)
+ifneq (,$(filter /usr/bin/%gij%, $(DEFAULT_JAVA)))
 CONFIGURE_VARS += JAVAC="gcj-wrapper" JAR="fastjar"
 CONFIGURE_SWITCHES += --with-gcj
-else
-JAVA_HOME = $(DEFAULT_JAVA)
-CONFIGURE_VARS += JAVA_HOME="$(JAVA_HOME)"
 endif
 
 build: build-arch build-indep
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.