From 09341a0d87c62c568ec5bc78208dc68d56af06f5 Mon Sep 17 00:00:00 2001 From: band-a-prend Date: Sat, 8 Jun 2019 00:57:39 +0300 Subject: [PATCH] dev-util/scons: 3.0.5-r1 repair JDK include installation paths MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Michał Górny --- .../scons/files/scons-3.0.5-jdk-include-path.patch | 14 ++++++++++++++ .../files/scons-3.0.5-jni.h-include-path.patch | 14 ++++++++++++++ dev-util/scons/scons-3.0.5-r1.ebuild | 6 ++++++ 3 files changed, 34 insertions(+) create mode 100644 dev-util/scons/files/scons-3.0.5-jdk-include-path.patch create mode 100644 dev-util/scons/files/scons-3.0.5-jni.h-include-path.patch 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 index 000000000000..708447592fa8 --- /dev/null +++ b/dev-util/scons/files/scons-3.0.5-jdk-include-path.patch @@ -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 index 000000000000..818db02279af --- /dev/null +++ b/dev-util/scons/files/scons-3.0.5-jni.h-include-path.patch @@ -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, diff --git a/dev-util/scons/scons-3.0.5-r1.ebuild b/dev-util/scons/scons-3.0.5-r1.ebuild index d38461f93b0d..9b0e05bcdd68 100644 --- a/dev-util/scons/scons-3.0.5-r1.ebuild +++ b/dev-util/scons/scons-3.0.5-r1.ebuild @@ -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() { -- 2.26.2