dev-util/scons: 3.0.5-r1 repair JDK include installation paths
authorband-a-prend <torokhov-s-a@yandex.ru>
Fri, 7 Jun 2019 21:57:39 +0000 (00:57 +0300)
committerMichał Górny <mgorny@gentoo.org>
Sat, 15 Jun 2019 14:19:20 +0000 (16:19 +0200)
The commit repairs the JDK installation paths to make
scons test scripts to know where the include directory is.

This fix the failure (couldn't find jni.h) of the following tests:

1. test/Java/multi-step.py
2. test/SWIG/SWIGOUTDIR.py

if java jdk is installed.

Signed-off-by: Sergey Torokhov <torokhov_s_a@mail.ru>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-util/scons/files/scons-3.0.5-jdk-include-path.patch [new file with mode: 0644]
dev-util/scons/files/scons-3.0.5-jni.h-include-path.patch [new file with mode: 0644]
dev-util/scons/scons-3.0.5-r1.ebuild

diff --git a/dev-util/scons/files/scons-3.0.5-jdk-include-path.patch b/dev-util/scons/files/scons-3.0.5-jdk-include-path.patch
new file mode 100644 (file)
index 0000000..7084475
--- /dev/null
@@ -0,0 +1,14 @@
+diff -Nur old/scons-3.0.5/src/engine/SCons/Tool/JavaCommon.py new/scons-3.0.5/src/engine/SCons/Tool/JavaCommon.py
+--- old/src/engine/SCons/Tool/JavaCommon.py    2019-03-27 02:16:32.000000000 +0300
++++ new/src/engine/SCons/Tool/JavaCommon.py    2019-06-04 10:44:01.000000000 +0300
+@@ -403,7 +403,8 @@
+ java_macos_version_include_dir = '/System/Library/Frameworks/JavaVM.framework/Versions/%s*/Headers/'
+-java_linux_include_dirs = ['/usr/lib/jvm/default-java/include',
+-                        '/usr/lib/jvm/java-*/include']
++java_linux_include_dirs = ['/usr/lib/jvm/*/include',
++                        '/opt/*jdk-bin-*/include',
++                        '/usr/lib*/openjdk-*/include']
+ # Need to match path like below (from Centos 7)
+ # /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/include/
+ java_linux_version_include_dirs = ['/usr/lib/jvm/java-*-sun-%s*/include',
diff --git a/dev-util/scons/files/scons-3.0.5-jni.h-include-path.patch b/dev-util/scons/files/scons-3.0.5-jni.h-include-path.patch
new file mode 100644 (file)
index 0000000..818db02
--- /dev/null
@@ -0,0 +1,14 @@
+diff -Nur old/testing/framework/TestSCons.py new/testing/framework/TestSCons.py
+--- old/testing/framework/TestSCons.py 2019-03-27 02:15:48.000000000 +0300
++++ new/testing/framework/TestSCons.py 2019-06-07 16:13:48.000000000 +0300
+@@ -742,7 +742,8 @@
+             version=''
+             jni_dirs = ['/System/Library/Frameworks/JavaVM.framework/Headers/jni.h',
+-                        '/usr/lib/jvm/default-java/include/jni.h',
+-                        '/usr/lib/jvm/java-*-oracle/include/jni.h']
++                        '/usr/lib/jvm/*/include/jni.h',
++                        '/opt/*jdk-bin-*/include/jni.h',
++                        '/usr/lib*/openjdk-*/include/jni.h']
+         else:
+             jni_dirs = ['/System/Library/Frameworks/JavaVM.framework/Versions/%s*/Headers/jni.h'%version]
+         jni_dirs.extend(['/usr/lib/jvm/java-*-sun-%s*/include/jni.h'%version,
index d38461f93b0d179064e4d63cae14d1d726353a92..9b0e05bcdd68597301b7a8dfc25d9fc8bb4840aa 100644 (file)
@@ -36,6 +36,8 @@ PATCHES=(
        "${FILESDIR}"/scons-3.0.1-env-passthrough.patch
        # respect CC, CXX, C*FLAGS, LDFLAGS by default
        "${FILESDIR}"/scons-3.0.3-respect-cc-etc-r1.patch
+       # add Gentoo JDK include installation paths
+       "${FILESDIR}"/scons-3.0.5-jdk-include-path.patch
 )
 
 src_unpack() {
@@ -59,6 +61,10 @@ src_prepare() {
        # and fix manpage install location
        sed -i -e '/cmdclass/,/},$/d' \
                -e '/data_files/s:man/:share/man/:' "${S}"/setup.py || die
+       if use test; then
+               # addtional fix for Gentoo JDK installation paths to find include directory with jni.h
+               eapply "${FILESDIR}"/scons-3.0.5-jni.h-include-path.patch
+       fi
 }
 
 python_test() {