From 03442b65265a4ebfeed88bcb2fb7631f0c5e664d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Thu, 15 Aug 2024 10:53:06 +0200 Subject: [PATCH] Support finding libjvm.so for all OpenJDK variants Closes: #1078712 --- ...g-libjvm.so-for-all-OpenJDK-variants.patch | 34 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 debian/patches/0002-Support-finding-libjvm.so-for-all-OpenJDK-variants.patch diff --git a/debian/patches/0002-Support-finding-libjvm.so-for-all-OpenJDK-variants.patch b/debian/patches/0002-Support-finding-libjvm.so-for-all-OpenJDK-variants.patch new file mode 100644 index 000000000..2046be8f5 --- /dev/null +++ b/debian/patches/0002-Support-finding-libjvm.so-for-all-OpenJDK-variants.patch @@ -0,0 +1,34 @@ +From: WANG Xuerui +Date: Tue, 13 Aug 2024 16:06:38 +0800 +Subject: Support finding libjvm.so for all OpenJDK variants + +Formerly only the "client" and "server" variant directories are being +checked for libjvm.so, but according to a 2021 OpenJDK upstream change +present in OpenJDK >= 18, there can be "minimal" and "zero" variants as +well. In particular, formerly (OpenJDK <= 17) the Zero variant had its +libjvm.so in "server/", but "zero/" in newer versions, which regressed +downstream CMake project builds running on systems with OpenJDK Zero VM. + +Fix it by checking all 4 variant directories for libjvm.so. + +Forwarded: not-needed +Origin: upstream, https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9725 +Bug-Debian: https://bugs.debian.org/1078712 +--- + Modules/FindJNI.cmake | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake +index abc76cf..51f05b9 100644 +--- a/Modules/FindJNI.cmake ++++ b/Modules/FindJNI.cmake +@@ -343,7 +343,9 @@ foreach(dir IN LISTS JAVA_AWT_LIBRARY_DIRECTORIES) + list(APPEND JAVA_JVM_LIBRARY_DIRECTORIES + "${dir}" + "${dir}/client" ++ "${dir}/minimal" + "${dir}/server" ++ "${dir}/zero" + # IBM SDK, Java Technology Edition, specific paths + "${dir}/j9vm" + "${dir}/default" diff --git a/debian/patches/series b/debian/patches/series index 812333042..6bd20641d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-Prefer-default-Python-version.patch +0002-Support-finding-libjvm.so-for-all-OpenJDK-variants.patch