Subject: [PATCH] gnu: icedtea-7: Add native-search-paths.

From: Julien Lepiller <[email-masked]>
Date: Sun, 12 Jun 2022 14:45:39 +0200

Hi Guix!

This short patch adds a CLASSPATH native-search-path to our icedtea and
openjdk packages. It lets users build java on their machine using
Guix-provided dependencies and the JVM/JDK won't complain anymore it
can't find the dependencies :)

Unfortunately, this requires rebuilding all of Java, so it should go to
staging. I tested the patch on my computer and rebuilt all packages up
to java-jmh. No breakage to report, except a two undeterministic test
failures in jmh and commons-collections4.
>From 8c35ca59ab1977eb56d4a157fda774645f7702fd Mon Sep 17 00:00:00 2001
From: Julien Lepiller <[email-masked]>
Date: Sun, 12 Jun 2022 14:39:42 +0200
Subject: [PATCH] gnu: icedtea-7: Add native-search-paths.

This is inherited by other icedtea and openjdk versions.

* gnu/packages/java.scm (icedtea-7): Add CLASSPATH support.
---
 gnu/packages/java.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index fcac0c2367..ad7ecc3d84 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -798,6 +798,12 @@ (define-public icedtea-7
       (outputs '("out"   ; Java Runtime Environment
                  "jdk"   ; Java Development Kit
                  "doc")) ; all documentation
+      (native-search-paths
+        (list (search-path-specification
+                (variable "CLASSPATH")
+                (files '("lib/m2" "share/java"))
+                (file-type 'regular)
+                (file-pattern ".*\\.jar$"))))
       (arguments
        `(;; There are many test failures.  Some are known to
          ;; fail upstream, others relate to not having an X
-- 
2.35.1