1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-01 18:12:46 +00:00

Merge pull request #132680 from zimbatm/gradle-7.1.1

This commit is contained in:
Sandro 2021-08-04 22:19:48 +02:00 committed by GitHub
commit b59f55862b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,8 +9,9 @@ let
url = "https://services.gradle.org/distributions/${name}-bin.zip"; url = "https://services.gradle.org/distributions/${name}-bin.zip";
}; };
}; };
in rec { in
gradleGen = {name, src, nativeVersion} : stdenv.mkDerivation { rec {
gradleGen = { name, src, nativeVersion }: stdenv.mkDerivation {
inherit name src nativeVersion; inherit name src nativeVersion;
dontBuild = true; dontBuild = true;
@ -27,20 +28,21 @@ in rec {
''; '';
fixupPhase = if (!stdenv.isLinux) then ":" else fixupPhase = if (!stdenv.isLinux) then ":" else
let arch = if stdenv.is64bit then "amd64" else "i386"; in '' let arch = if stdenv.is64bit then "amd64" else "i386"; in
mkdir patching ''
pushd patching mkdir patching
jar xf $out/lib/gradle/lib/native-platform-linux-${arch}-${nativeVersion}.jar pushd patching
patchelf --set-rpath "${stdenv.cc.cc.lib}/lib:${stdenv.cc.cc.lib}/lib64" net/rubygrapefruit/platform/linux-${arch}/libnative-platform.so jar xf $out/lib/gradle/lib/native-platform-linux-${arch}-${nativeVersion}.jar
jar cf native-platform-linux-${arch}-${nativeVersion}.jar . patchelf --set-rpath "${stdenv.cc.cc.lib}/lib:${stdenv.cc.cc.lib}/lib64" net/rubygrapefruit/platform/linux-${arch}/libnative-platform.so
mv native-platform-linux-${arch}-${nativeVersion}.jar $out/lib/gradle/lib/ jar cf native-platform-linux-${arch}-${nativeVersion}.jar .
popd mv native-platform-linux-${arch}-${nativeVersion}.jar $out/lib/gradle/lib/
popd
# The scanner doesn't pick up the runtime dependency in the jar. # The scanner doesn't pick up the runtime dependency in the jar.
# Manually add a reference where it will be found. # Manually add a reference where it will be found.
mkdir $out/nix-support mkdir $out/nix-support
echo ${stdenv.cc.cc} > $out/nix-support/manual-runtime-dependencies echo ${stdenv.cc.cc} > $out/nix-support/manual-runtime-dependencies
''; '';
nativeBuildInputs = [ makeWrapper unzip ]; nativeBuildInputs = [ makeWrapper unzip ];
buildInputs = [ java ]; buildInputs = [ java ];
@ -64,9 +66,9 @@ in rec {
gradle_latest = gradle_7; gradle_latest = gradle_7;
gradle_7 = gradleGen (gradleSpec { gradle_7 = gradleGen (gradleSpec {
version = "7.1"; version = "7.1.1";
nativeVersion = "0.22-milestone-16"; nativeVersion = "0.22-milestone-16";
sha256 = "0yyqksq3zza7r9ls389ha81l3s768j7dfdqiwk3846qy4wcyxsrd"; sha256 = "0p9nss2xywwhjbpdcyma3d0ijvkav9hzmldpkcp447ch92cqd2xz";
}); });
gradle_6_8 = gradleGen (gradleSpec { gradle_6_8 = gradleGen (gradleSpec {