From bc1dc4c6db3904926a254b58a235f75893646045 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 13 Dec 2024 16:31:05 +0530 Subject: [PATCH 1/2] gradle: remove unused jdk11 argument --- pkgs/development/tools/build-managers/gradle/default.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/build-managers/gradle/default.nix b/pkgs/development/tools/build-managers/gradle/default.nix index 5f34894e8dc37..9c2eb8517907d 100644 --- a/pkgs/development/tools/build-managers/gradle/default.nix +++ b/pkgs/development/tools/build-managers/gradle/default.nix @@ -1,4 +1,4 @@ -{ jdk11, jdk17, jdk21 }: +{ jdk17, jdk21 }: rec { gen = diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9a81e3ccada75..5bc05229965c1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8182,7 +8182,7 @@ with pkgs; gnumake = callPackage ../development/tools/build-managers/gnumake { }; gradle-packages = import ../development/tools/build-managers/gradle { - inherit jdk11 jdk17 jdk21; + inherit jdk17 jdk21; }; gradleGen = gradle-packages.gen; wrapGradle = callPackage gradle-packages.wrapGradle { }; From edfdc11f7add8f77ed57b2056e4170802bc70147 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 13 Dec 2024 16:36:44 +0530 Subject: [PATCH 2/2] gradle: add support for the new file-events library format --- .../tools/build-managers/gradle/default.nix | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/build-managers/gradle/default.nix b/pkgs/development/tools/build-managers/gradle/default.nix index 9c2eb8517907d..087b2d303952d 100644 --- a/pkgs/development/tools/build-managers/gradle/default.nix +++ b/pkgs/development/tools/build-managers/gradle/default.nix @@ -104,7 +104,9 @@ rec { dontFixup = !stdenv.hostPlatform.isLinux; - fixupPhase = let arch = if stdenv.hostPlatform.is64bit then "amd64" else "i386"; + fixupPhase = let + arch = if stdenv.hostPlatform.is64bit then "amd64" else "i386"; + newFileEvents = toString (lib.versionAtLeast version "8.12"); in '' . ${./patching.sh} @@ -117,10 +119,17 @@ rec { # The file-events library _seems_ to follow the native-platform version, but # we won’t assume that. - fileEventsVersion="$(extractVersion file-events $out/lib/gradle/lib/file-events-*.jar)" - autoPatchelfInJar \ - $out/lib/gradle/lib/file-events-linux-${arch}-''${fileEventsVersion}.jar \ - "${lib.getLib stdenv.cc.cc}/lib64:${lib.makeLibraryPath [ stdenv.cc.cc ]}" + if [ -n "${newFileEvents}" ]; then + fileEventsVersion="$(extractVersion gradle-fileevents $out/lib/gradle/lib/gradle-fileevents-*.jar)" + autoPatchelfInJar \ + $out/lib/gradle/lib/gradle-fileevents-''${fileEventsVersion}.jar \ + "${lib.getLib stdenv.cc.cc}/lib64:${lib.makeLibraryPath [ stdenv.cc.cc ]}" + else + fileEventsVersion="$(extractVersion file-events $out/lib/gradle/lib/file-events-*.jar)" + autoPatchelfInJar \ + $out/lib/gradle/lib/file-events-linux-${arch}-''${fileEventsVersion}.jar \ + "${lib.getLib stdenv.cc.cc}/lib64:${lib.makeLibraryPath [ stdenv.cc.cc ]}" + fi # The scanner doesn't pick up the runtime dependency in the jar. # Manually add a reference where it will be found.