Hi Alexey,
On Sat, 22 Feb 2020 21:17:49 +0100
Alexey Abramov <address@hidden> wrote:
* gnu/packages/java.scm: Add patch
* gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch:
New file. Allows you to run gradlew to run properly. Useful for
debugging. ---
This sentence sounds suspicious :-)
In Guix, we build everything from source. If we need a compiler,
library, or build-tool, we build that also from source.
Here, the problem is that:
gradle/wrapper/gradle-wrapper.jar
is a binary JAR-file included in the sources, which is used by the
'gradlew' script. This jar-file should not be part of the original
sources used to to compile this package.
Whenever sources contain unwanted binaries, we use 'snippets' to remove
them before doing any further steps. You will find them in many places
in the java.scm file, just search for 'snippet', for example in the
package java-cisd-jhdf5.
For using gradle, we need to compile gradle from sources, but this is
very hard, there are some bootstrapping problems involed in this.
So, first we should first snipp away the jar-files from the original
java-openjfx-build package by Julien.
And second, I hope you don't rely on the gradle build in any way
here :-)
Björn
gnu/packages/java.scm | 3 ++-
.../java-openjfx-build-get_guix_jdk_version.patch | 14
++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
create mode 100644
gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 9371901e1f..01541ee419 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2355,7 +2355,8 @@ new Date();"))
(file-name (string-append name "-" version
"-checkout")) (sha256
(base32
-
"0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))))
+
"0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
+ (patches (search-patches
"java-openjfx-build-get_guix_jdk_version.patch")))) (build-system
ant-build-system) (arguments
`(#:jar-name "java-openjfx.jar"
diff --git
a/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
new file mode 100644 index 0000000000..214ef9949c --- /dev/null
+++
b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
@@ -0,0 +1,14 @@ +--- a/build.gradle
++++ b/build.gradle
+@@ -742,9 +742,9 @@
+ if (inStream.readLine() != null) {
+ String v = inStream.readLine();
+ if (v != null) {
+- int ib = v.indexOf(" (build ");
++ int ib = v.indexOf(" (guix build ");
+ if (ib != -1) {
+- String ver = v.substring(ib + 8, v.size() - 1);
++ String ver = v.substring(ib + 13, v.size() - 1);
+
+ defineProperty("jdkRuntimeVersion", ver)
+ defineProperty("jdkVersion",
jdkRuntimeVersion.split("-")[0])