From 5153a6cf192bf840538b969da19af30a4a96e869 Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Thu, 11 Nov 2021 07:53:01 +0100 Subject: [PATCH] gradle: Clean up --- .../tools/build-managers/gradle/default.nix | 45 +++++++------------ .../gradle/gradle-4.10.3-spec.nix | 5 +++ .../gradle/gradle-5.6.4-spec.nix | 5 +++ pkgs/top-level/all-packages.nix | 3 +- 4 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 pkgs/development/tools/build-managers/gradle/gradle-4.10.3-spec.nix create mode 100644 pkgs/development/tools/build-managers/gradle/gradle-5.6.4-spec.nix diff --git a/pkgs/development/tools/build-managers/gradle/default.nix b/pkgs/development/tools/build-managers/gradle/default.nix index 877f28419055..443e91325af1 100644 --- a/pkgs/development/tools/build-managers/gradle/default.nix +++ b/pkgs/development/tools/build-managers/gradle/default.nix @@ -1,21 +1,20 @@ { lib, stdenv, fetchurl, unzip, jdk, java ? jdk, makeWrapper }: -let - gradleSpec = { version, nativeVersion, sha256 }: rec { - inherit nativeVersion; - name = "gradle-${version}"; +rec { + gradleGen = { version, nativeVersion, sha256 }: stdenv.mkDerivation { + pname = "gradle"; + inherit version; + src = fetchurl { inherit sha256; - url = "https://services.gradle.org/distributions/${name}-bin.zip"; + url = "https://services.gradle.org/distributions/gradle-${version}-bin.zip"; }; - }; -in -rec { - gradleGen = { name, src, nativeVersion }: stdenv.mkDerivation { - inherit name src nativeVersion; dontBuild = true; + nativeBuildInputs = [ makeWrapper unzip ]; + buildInputs = [ java ]; + installPhase = '' mkdir -pv $out/lib/gradle/ cp -rv lib/ $out/lib/gradle/ @@ -44,9 +43,6 @@ rec { echo ${stdenv.cc.cc} > $out/nix-support/manual-runtime-dependencies ''; - nativeBuildInputs = [ makeWrapper unzip ]; - buildInputs = [ java ]; - meta = with lib; { description = "Enterprise-grade build system"; longDescription = '' @@ -57,7 +53,9 @@ rec { between the flexibility of Ant and the convenience of a build-by-convention behavior. ''; - homepage = "http://www.gradle.org/"; + homepage = "https://www.gradle.org/"; + changelog = "https://docs.gradle.org/${version}/release-notes.html"; + downloadPage = "https://gradle.org/next-steps/?version=${version}"; license = licenses.asl20; platforms = platforms.unix; maintainers = with maintainers; [ lorenzleutgeb ]; @@ -65,20 +63,11 @@ rec { }; gradle_latest = gradle_7_3; - gradle_7_3 = gradleGen (gradleSpec (import ./gradle-7.3-spec.nix)); - gradle_6_9 = gradleGen (gradleSpec (import ./gradle-6.9.1-spec.nix)); - # NOTE: No GitHub Release for this release, so update.sh does not work. - gradle_5_6 = gradleGen (gradleSpec { - version = "5.6.4"; - nativeVersion = "0.18"; - sha256 = "03d86bbqd19h9xlanffcjcy3vg1k5905vzhf9mal9g21603nfc0z"; - }); + gradle_7_3 = gradleGen (import ./gradle-7.3-spec.nix); + gradle_6_9 = gradleGen (import ./gradle-6.9.1-spec.nix); - # NOTE: No GitHub Release for this release, so update.sh does not work. - gradle_4_10 = gradleGen (gradleSpec { - version = "4.10.3"; - nativeVersion = "0.14"; - sha256 = "0vhqxnk0yj3q9jam5w4kpia70i4h0q4pjxxqwynh3qml0vrcn9l6"; - }); + # NOTE: No GitHub Release for the following versions. Update.sh will not work. + gradle_5_6 = gradleGen (import ./gradle-5.6.4-spec.nix); + gradle_4_10 = gradleGen (import ./gradle-4.10.3-spec.nix); } diff --git a/pkgs/development/tools/build-managers/gradle/gradle-4.10.3-spec.nix b/pkgs/development/tools/build-managers/gradle/gradle-4.10.3-spec.nix new file mode 100644 index 000000000000..598deab87e06 --- /dev/null +++ b/pkgs/development/tools/build-managers/gradle/gradle-4.10.3-spec.nix @@ -0,0 +1,5 @@ +{ + version = "4.10.3"; + nativeVersion = "0.14"; + sha256 = "0vhqxnk0yj3q9jam5w4kpia70i4h0q4pjxxqwynh3qml0vrcn9l6"; +} diff --git a/pkgs/development/tools/build-managers/gradle/gradle-5.6.4-spec.nix b/pkgs/development/tools/build-managers/gradle/gradle-5.6.4-spec.nix new file mode 100644 index 000000000000..41e567c1449c --- /dev/null +++ b/pkgs/development/tools/build-managers/gradle/gradle-5.6.4-spec.nix @@ -0,0 +1,5 @@ +{ + version = "5.6.4"; + nativeVersion = "0.18"; + sha256 = "03d86bbqd19h9xlanffcjcy3vg1k5905vzhf9mal9g21603nfc0z"; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 83e3dba01778..eb4e939f3d07 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14597,8 +14597,7 @@ with pkgs; java = jdk8; # TODO: upgrade https://github.com/NixOS/nixpkgs/pull/89731 }; gradle = res.gradleGen.gradle_latest; - gradle_4_10 = res.gradleGen.gradle_4_10; - gradle_4 = gradle_4_10; + gradle_4 = res.gradleGen.gradle_4_10; gradle_5 = res.gradleGen.gradle_5_6; gradle_6 = res.gradleGen.gradle_6_9; gradle_7 = res.gradleGen.gradle_7_3;