From 11dcf7655a7181b5071c63c6ffcf3cbb37e09150 Mon Sep 17 00:00:00 2001 From: Tomo Date: Wed, 30 Oct 2024 04:29:39 +0000 Subject: [PATCH] summoning-pixel-dungeon: use default gradle Upstream has made it possible to use a recent version of Gradle, thanks to some patches: * "1.2.6: changed JVM args to be compatible with Java 17" -> This is not directly applied, as it fails to apply cleanly; we use substituteInPlace instead -> https://github.com/TrashboxBobylev/Summoning-Pixel-Dungeon/commit/c8a6fdd57c49fd91bf65be48679ae6a77578ef9f * "1.2.6: updated desktop build script for Gradle 7.0+" -> https://github.com/TrashboxBobylev/Summoning-Pixel-Dungeon/commit/5610142126e161cbdc78a07c5d5abfbcd6eaf8a6 Additionally, allows this package to keep working after #352236 --- .../summoning-pixel-dungeon/default.nix | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/pkgs/games/shattered-pixel-dungeon/summoning-pixel-dungeon/default.nix b/pkgs/games/shattered-pixel-dungeon/summoning-pixel-dungeon/default.nix index 291b4b386cc52..86cd351f2c591 100644 --- a/pkgs/games/shattered-pixel-dungeon/summoning-pixel-dungeon/default.nix +++ b/pkgs/games/shattered-pixel-dungeon/summoning-pixel-dungeon/default.nix @@ -1,6 +1,6 @@ { callPackage , fetchFromGitHub -, gradle_6 +, fetchpatch , substitute }: @@ -16,10 +16,26 @@ callPackage ../generic.nix rec { hash = "sha256-VQcWkbGe/0qyt3M5WWgTxczwC5mE3lRHbYidOwRoukI="; }; - patches = [(substitute { - src = ./disable-git-version.patch; - substitutions = [ "--subst-var-by" "version" version ]; - })]; + patches = [ + (substitute { + src = ./disable-git-version.patch; + substitutions = [ "--subst-var-by" "version" version ]; + }) + # FIXME: Remove after next release + (fetchpatch { + name = "Update-desktop-build-script-for-Gradle-7.0+"; + url = "https://github.com/TrashboxBobylev/Summoning-Pixel-Dungeon/commit/5610142126e161cbdc78a07c5d5abfbcd6eaf8a6.patch"; + hash = "sha256-zAiOz/Cu89Y+VmAyLCf7fzq0Mr0sYFZu14sqBZ/XvZU="; + }) + ]; + + postPatch = '' + # Upstream patched this in https://github.com/TrashboxBobylev/Summoning-Pixel-Dungeon/commit/c8a6fdd57c49fd91bf65be48679ae6a77578ef9f, + # but the patch fails to apply cleanly. Manually replace the deprecated option instead. + # FIXME: Remove after next release + substituteInPlace gradle.properties \ + --replace-fail "-XX:MaxPermSize" "-XX:MaxMetaspaceSize" + ''; desktopName = "Summoning Pixel Dungeon"; @@ -28,7 +44,4 @@ callPackage ../generic.nix rec { downloadPage = "https://github.com/TrashboxBobylev/Summoning-Pixel-Dungeon/releases"; description = "A fork of the Shattered Pixel Dungeon roguelike with added summoning mechanics"; }; - - # Probably due to https://github.com/gradle/gradle/issues/17236 - gradle = gradle_6; }