Subject: [PATCH v4 07/12] gnu: java-openjfx-build: Do not use an embedded 3rd party libraries.

From: Alexey Abramov <[email-masked]>
Date: Sun, 7 Jun 2020 17:55:13 +0200

* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/java.scm (java-openjfx-build)[source]: Use it.
* gnu/packages/patches/java-openjfx-build-web-OptionsJava.cmake.patch: New file.

Signed-off-by: Alexey Abramov <[email-masked]>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/java.scm                         |  1 +
 ...-openjfx-build-web-OptionsJava.cmake.patch | 32 +++++++++++++++++++
 3 files changed, 34 insertions(+)
 create mode 100644 gnu/packages/patches/java-openjfx-build-web-OptionsJava.cmake.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f8a59da3da..71b2cf1d69 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1111,6 +1111,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/java-openjfx-build-jdk_version.patch     \
   %D%/packages/patches/java-openjfx-build-swing-JFXPanel-JDK8.patch     \
   %D%/packages/patches/java-openjfx-build-web-DumpRenderTree-java.patch	\
+  %D%/packages/patches/java-openjfx-build-web-OptionsJava.cmake.patch	\
   %D%/packages/patches/java-powermock-fix-java-files.patch		\
   %D%/packages/patches/java-simple-xml-fix-tests.patch		\
   %D%/packages/patches/java-svg-salamander-Fix-non-det.patch	\
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index d60ae7c8f1..8ce8043335 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2504,6 +2504,7 @@ new Date();"))
               (patches (search-patches "java-openjfx-build-jdk_version.patch"
                                        "java-openjfx-build-swing-JFXPanel-JDK8.patch"
                                        "java-openjfx-build-web-DumpRenderTree-java.patch"
+                                       "java-openjfx-build-web-OptionsJava.cmake.patch"
                                        ))))
     (build-system ant-build-system)
     (arguments
diff --git a/gnu/packages/patches/java-openjfx-build-web-OptionsJava.cmake.patch b/gnu/packages/patches/java-openjfx-build-web-OptionsJava.cmake.patch
new file mode 100644
index 0000000000..1f133571cb
--- /dev/null
+++ b/gnu/packages/patches/java-openjfx-build-web-OptionsJava.cmake.patch
@@ -0,0 +1,32 @@
+Subject: [PATCH] Use find_package.
+
+We remove all embedded 3rd-party libs like icu, libxml, libxslt and sqlite,
+and use libraries provided via guix inputs.
+---
+ .../web/src/main/native/Source/cmake/OptionsJava.cmake | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/modules/web/src/main/native/Source/cmake/OptionsJava.cmake b/modules/web/src/main/native/Source/cmake/OptionsJava.cmake
+index 76a6695..73c525b 100644
+--- a/modules/web/src/main/native/Source/cmake/OptionsJava.cmake
++++ b/modules/web/src/main/native/Source/cmake/OptionsJava.cmake
+@@ -26,13 +26,11 @@ endif ()
+ set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Absolute path to library installation directory")
+ set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}" CACHE PATH "Absolute path to executable installation directory")
+
+-set(SQLITE_LIBRARIES SqliteJava)
+-set(LIBXML2_LIBRARIES XMLJava)
+-set(LIBXSLT_LIBRARIES XSLTJava)
+
+-set(ICU_LIBRARIES icuuc icudata)
+-set(ICU_I18N_LIBRARIES icui18n icuuc icudata)
+-set(ICU_DATA_LIBRARIES icudata)
++find_package(Sqlite REQUIRED)
++find_package(LibXml2 REQUIRED)
++find_package(LibXslt REQUIRED)
++find_package(ICU REQUIRED)
+
+ find_package(JNI REQUIRED)
+ find_package(Threads REQUIRED)
+--
+2.26.2
-- 
2.26.2