Dear Maintainer,

Sorry for confusing initial report.
I'm copying the original message bellow and attaching the debdiff for
review again.


Currently gettext FTBFS when building with openjdk-9 due to:

cp: cannot stat 'debian/tmp/usr/share/gettext/libintl.jar': No such
file or directory

which in turn is caused by a configure failing to detect openjdk:
checking for Java virtual machine... java
configure: WARNING: unknown target-version 9, please update gt_JAVACOMP macro
checking for Java compiler... no


For comparison, the above message, when compiling with OpenJDK 8 is:
checking for Java virtual machine... java
configure: WARNING: unknown target-version 1.8, please update gt_JAVACOMP macro
checking for Java compiler... /usr/lib/jvm/default-java/bin/javac
-target 1.1 -source 1.3


The attached debdiff, copied from opensuse and modified to include
support for source/target 1.7 and 1.8, fixes this issue.

The configure message, with the patch applied, is:
checking for Java virtual machine... java
configure: WARNING: unknown target-version 9, please update gt_JAVACOMP macro
checking for Java compiler... no


Please consider applying it to enable the work for transitioning
default-jdk from openjdk-8 to openjdk-9.

thanks
Tiago Daitx
diff -Nru gettext-0.19.8.1/debian/changelog gettext-0.19.8.1/debian/changelog
--- gettext-0.19.8.1/debian/changelog	2018-03-04 09:24:05.000000000 +0100
+++ gettext-0.19.8.1/debian/changelog	2018-03-20 19:47:19.000000000 +0100
@@ -1,3 +1,10 @@
+gettext (0.19.8.1-4ubuntu5~02) UNRELEASED; urgency=medium
+
+  * d/p/04-enable-jdk9-compatibility.patch: enable building with
+    source and target flags set to 1.8; update gt_JAVACOMP macro.
+
+ -- Tiago Stürmer Daitx <tiago.da...@ubuntu.com>  Tue, 20 Mar 2018 18:47:19 +0000
+
gettext (0.19.8.1-4) unstable; urgency=medium

  * Avoid extraneous NUL bytes in .mo files. Closes: #872869.
diff -Nru gettext-0.19.8.1/debian/patches/04-enable-jdk9-compatibility.patch gettext-0.19.8.1/debian/patches/04-enable-jdk9-compatibility.patch
--- gettext-0.19.8.1/debian/patches/04-enable-jdk9-compatibility.patch	1970-01-01 01:00:00.000000000 +0100
+++ gettext-0.19.8.1/debian/patches/04-enable-jdk9-compatibility.patch	2018-03-20 19:47:19.000000000 +0100
@@ -0,0 +1,235 @@
+Description: Enable compatibility with JDK 9+
+ According to JEP-182 OpenJDK 9 will only support 1.6 or later for source and
+ target flags. This patch adds supports for 1.6, 1.7, and 1.8 flags for
+ detecting and building gettext java.
+ Modified from opensuse to include support for 1.7 and 1.8.
+Origin: opensuse, https://build.opensuse.org/package/view_file/openSUSE:Factory/gettext-runtime/gettext-0.19.8.1-jdk9.patch
+Bug-Debian: 
+Forwarded: no
+Last-Update: 2018-03-21
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: gettext-0.19.8.1/gettext-runtime/configure.ac
+===================================================================
+--- gettext-0.19.8.1.orig/gettext-runtime/configure.ac
++++ gettext-0.19.8.1/gettext-runtime/configure.ac
+@@ -35,7 +35,7 @@ AC_PROG_YACC
+ 
+ gt_JAVA_CHOICE
+ 
+-gt_JAVACOMP([1.3], [1.1])
++gt_JAVACOMP([1.6], [1.6])
+ AC_CHECK_PROG([JAR], [jar], [jar])
+ if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
+   BUILDJAVA=yes
+Index: gettext-0.19.8.1/gettext-runtime/gnulib-m4/javacomp.m4
+===================================================================
+--- gettext-0.19.8.1.orig/gettext-runtime/gnulib-m4/javacomp.m4
++++ gettext-0.19.8.1/gettext-runtime/gnulib-m4/javacomp.m4
+@@ -16,6 +16,8 @@ dnl with or without modifications, as lo
+ #           1.4             assert keyword
+ #           1.5             generic classes and methods
+ #           1.6             (not yet supported)
++#           1.7             (not yet supported)
++#           1.8             (not yet supported)
+ #
+ # target-version can be:  classfile version:
+ #           1.1                 45.3
+@@ -24,6 +26,8 @@ dnl with or without modifications, as lo
+ #           1.4                 48.0
+ #           1.5                 49.0
+ #           1.6                 50.0
++#           1.7                 51.0
++#           1.8                 52.0
+ # The classfile version of a .class file can be determined through the "file"
+ # command. More portably, the classfile major version can be determined through
+ # "od -A n -t d1 -j 7 -N 1 classfile".
+@@ -36,6 +40,8 @@ dnl with or without modifications, as lo
+ #           1.4         JDK/JRE 1.4, gij 4.0, 4.1
+ #           1.5         JDK/JRE 1.5
+ #           1.6         JDK/JRE 1.6
++#           1.7         JDK/JRE 7
++#           1.8         JDK/JRE 8
+ # Note: gij >= 3.3 can in some cases handle classes compiled with -target 1.4,
+ # and gij >= 4.1 can in some cases partially handle classes compiled with
+ # -target 1.5, but I have no idea how complete this support is.
+@@ -47,7 +53,9 @@ dnl with or without modifications, as lo
+ # It is unreasonable to ask for:
+ #   - target-version < 1.4 with source-version >= 1.4, or
+ #   - target-version < 1.5 with source-version >= 1.5, or
+-#   - target-version < 1.6 with source-version >= 1.6,
++#   - target-version < 1.6 with source-version >= 1.6, or
++#   - target-version < 1.7 with source-version >= 1.7, or
++#   - target-version < 1.8 with source-version >= 1.8
+ # because even Sun's javac doesn't support these combinations.
+ #
+ # It is redundant to ask for a target-version > source-version, since the
+@@ -99,7 +107,7 @@ changequote([,])dnl
+          CLASSPATH=.${CLASSPATH:+$CLASSPATH_SEPARATOR$CLASSPATH} $CONF_JAVA conftestver 2>&AS_MESSAGE_LOG_FD
+        }`
+        case "$target_version" in
+-         1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6) ;;
++         1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8) ;;
+          null)
+            dnl JDK 1.1.X returns null.
+            target_version=1.1 ;;
+@@ -118,6 +126,12 @@ changequote([,])dnl
+          failcode='class conftestfail<T> { T foo() { return null; } }' ;;
+     1.5) goodcode='class conftest<T>     { T foo() { return null; } }'
+          failcode='class conftestfail syntax error' ;;
++    1.6) goodcode='class conftest<T>     { T foo() { return null; } }'
++         failcode='class conftestfail syntax error' ;;
++    1.7) goodcode='class conftest<T>     { T foo() { return null; } }'
++         failcode='class conftestfail syntax error' ;;
++    1.8) goodcode='class conftest<T>     { T foo() { return null; } }'
++         failcode='class conftestfail syntax error' ;;
+     *) AC_MSG_ERROR([invalid source-version argument to gt_@&t@JAVACOMP: $source_version]) ;;
+   esac
+   case "$target_version" in
+@@ -127,6 +141,8 @@ changequote([,])dnl
+     1.4) cfversion=48 ;;
+     1.5) cfversion=49 ;;
+     1.6) cfversion=50 ;;
++    1.7) cfversion=51 ;;
++    1.8) cfversion=52 ;;
+     *) AC_MSG_ERROR([invalid target-version argument to gt_@&t@JAVACOMP: $target_version]) ;;
+   esac
+   # Function to output the classfile version of a file (8th byte) in decimal.
+Index: gettext-0.19.8.1/gettext-tools/configure.ac
+===================================================================
+--- gettext-0.19.8.1.orig/gettext-tools/configure.ac
++++ gettext-0.19.8.1/gettext-tools/configure.ac
+@@ -44,7 +44,7 @@ fi
+ AC_SUBST([BUILDJAVAEXE])
+ 
+ gt_JAVAEXEC
+-gt_JAVACOMP([1.3])
++gt_JAVACOMP([1.6], [1.6])
+ AC_CHECK_PROG([JAR], [jar], [jar])
+ if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
+   BUILDJAVA=yes
+Index: gettext-0.19.8.1/gettext-tools/examples/hello-java/configure.ac
+===================================================================
+--- gettext-0.19.8.1.orig/gettext-tools/examples/hello-java/configure.ac
++++ gettext-0.19.8.1/gettext-tools/examples/hello-java/configure.ac
+@@ -24,7 +24,7 @@ AC_PROG_RANLIB
+ dnl Check whether we can execute Java programs.
+ gt_JAVAEXEC
+ dnl Check whether we can build Java programs.
+-gt_JAVACOMP([1.3])
++gt_JAVACOMP([1.6], [1.6])
+ AC_CHECK_PROG(JAR, jar, jar)
+ if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then
+   BUILDJAVA=yes
+Index: gettext-0.19.8.1/gettext-tools/examples/hello-java-awt/configure.ac
+===================================================================
+--- gettext-0.19.8.1.orig/gettext-tools/examples/hello-java-awt/configure.ac
++++ gettext-0.19.8.1/gettext-tools/examples/hello-java-awt/configure.ac
+@@ -24,7 +24,7 @@ AC_PROG_RANLIB
+ dnl Check whether we can execute Java programs.
+ gt_JAVAEXEC([TestAWT], [$srcdir/m4])
+ dnl Check whether we can build Java programs.
+-gt_JAVACOMP([1.3])
++gt_JAVACOMP([1.6], [1.6])
+ AC_CHECK_PROG(JAR, jar, jar)
+ if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then
+   BUILDJAVA=yes
+Index: gettext-0.19.8.1/gettext-tools/examples/hello-java-qtjambi/configure.ac
+===================================================================
+--- gettext-0.19.8.1.orig/gettext-tools/examples/hello-java-qtjambi/configure.ac
++++ gettext-0.19.8.1/gettext-tools/examples/hello-java-qtjambi/configure.ac
+@@ -26,7 +26,7 @@ AC_PROG_RANLIB
+ dnl Check whether we can execute Java programs.
+ gt_JAVAEXEC([Test15], [$srcdir/m4])
+ dnl Check whether we can build Java programs.
+-gt_JAVACOMP([1.5], [1.5])
++gt_JAVACOMP([1.6], [1.6])
+ AC_CHECK_PROG(JAR, jar, jar)
+ if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then
+   BUILDJAVA=yes
+Index: gettext-0.19.8.1/gettext-tools/examples/hello-java-swing/configure.ac
+===================================================================
+--- gettext-0.19.8.1.orig/gettext-tools/examples/hello-java-swing/configure.ac
++++ gettext-0.19.8.1/gettext-tools/examples/hello-java-swing/configure.ac
+@@ -24,7 +24,7 @@ AC_PROG_RANLIB
+ dnl Check whether we can execute Java programs.
+ gt_JAVAEXEC([TestAWT], [$srcdir/m4])
+ dnl Check whether we can build Java programs.
+-gt_JAVACOMP([1.3])
++gt_JAVACOMP([1.6], [1.6])
+ AC_CHECK_PROG(JAR, jar, jar)
+ if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then
+   BUILDJAVA=yes
+Index: gettext-0.19.8.1/gettext-tools/gnulib-m4/javacomp.m4
+===================================================================
+--- gettext-0.19.8.1.orig/gettext-tools/gnulib-m4/javacomp.m4
++++ gettext-0.19.8.1/gettext-tools/gnulib-m4/javacomp.m4
+@@ -16,6 +16,8 @@ dnl with or without modifications, as lo
+ #           1.4             assert keyword
+ #           1.5             generic classes and methods
+ #           1.6             (not yet supported)
++#           1.7             (not yet supported)
++#           1.8             (not yet supported)
+ #
+ # target-version can be:  classfile version:
+ #           1.1                 45.3
+@@ -24,6 +26,8 @@ dnl with or without modifications, as lo
+ #           1.4                 48.0
+ #           1.5                 49.0
+ #           1.6                 50.0
++#           1.7                 51.0
++#           1.8                 52.0
+ # The classfile version of a .class file can be determined through the "file"
+ # command. More portably, the classfile major version can be determined through
+ # "od -A n -t d1 -j 7 -N 1 classfile".
+@@ -36,6 +40,8 @@ dnl with or without modifications, as lo
+ #           1.4         JDK/JRE 1.4, gij 4.0, 4.1
+ #           1.5         JDK/JRE 1.5
+ #           1.6         JDK/JRE 1.6
++#           1.7         JDK/JRE 7
++#           1.8         JDK/JRE 8
+ # Note: gij >= 3.3 can in some cases handle classes compiled with -target 1.4,
+ # and gij >= 4.1 can in some cases partially handle classes compiled with
+ # -target 1.5, but I have no idea how complete this support is.
+@@ -47,7 +53,9 @@ dnl with or without modifications, as lo
+ # It is unreasonable to ask for:
+ #   - target-version < 1.4 with source-version >= 1.4, or
+ #   - target-version < 1.5 with source-version >= 1.5, or
+-#   - target-version < 1.6 with source-version >= 1.6,
++#   - target-version < 1.6 with source-version >= 1.6, or
++#   - target-version < 1.7 with source-version >= 1.7, or
++#   - target-version < 1.8 with source-version >= 1.8
+ # because even Sun's javac doesn't support these combinations.
+ #
+ # It is redundant to ask for a target-version > source-version, since the
+@@ -99,7 +107,7 @@ changequote([,])dnl
+          CLASSPATH=.${CLASSPATH:+$CLASSPATH_SEPARATOR$CLASSPATH} $CONF_JAVA conftestver 2>&AS_MESSAGE_LOG_FD
+        }`
+        case "$target_version" in
+-         1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6) ;;
++         1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8) ;;
+          null)
+            dnl JDK 1.1.X returns null.
+            target_version=1.1 ;;
+@@ -118,6 +126,12 @@ changequote([,])dnl
+          failcode='class conftestfail<T> { T foo() { return null; } }' ;;
+     1.5) goodcode='class conftest<T>     { T foo() { return null; } }'
+          failcode='class conftestfail syntax error' ;;
++    1.6) goodcode='class conftest<T>     { T foo() { return null; } }'
++         failcode='class conftestfail syntax error' ;;
++    1.7) goodcode='class conftest<T>     { T foo() { return null; } }'
++         failcode='class conftestfail syntax error' ;;
++    1.8) goodcode='class conftest<T>     { T foo() { return null; } }'
++         failcode='class conftestfail syntax error' ;;
+     *) AC_MSG_ERROR([invalid source-version argument to gt_@&t@JAVACOMP: $source_version]) ;;
+   esac
+   case "$target_version" in
+@@ -127,6 +141,8 @@ changequote([,])dnl
+     1.4) cfversion=48 ;;
+     1.5) cfversion=49 ;;
+     1.6) cfversion=50 ;;
++    1.7) cfversion=51 ;;
++    1.8) cfversion=52 ;;
+     *) AC_MSG_ERROR([invalid target-version argument to gt_@&t@JAVACOMP: $target_version]) ;;
+   esac
+   # Function to output the classfile version of a file (8th byte) in decimal.
diff -Nru gettext-0.19.8.1/debian/patches/series gettext-0.19.8.1/debian/patches/series
--- gettext-0.19.8.1/debian/patches/series	2017-08-22 06:08:46.000000000 +0200
+++ gettext-0.19.8.1/debian/patches/series	2018-03-20 19:47:09.000000000 +0100
@@ -1,3 +1,4 @@
 01-do-not-use-java-in-urlget.patch
 02-msgfmt-remove-pot-creation-date.patch
 03-avoid-extraneous-nul-bytes.patch
+04-enable-jdk9-compatibility.patch

Reply via email to