From a5472cf9b5b72c8e2fbd12ee9c7ad493cd1eb6cd Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Sun, 28 May 2023 14:42:56 +0200 Subject: [PATCH] shattered-pixel-dungeon: 1.1.2 -> 2.0.2 --- .../games/shattered-pixel-dungeon/default.nix | 24 +++++----- .../disable-beryx.patch | 47 +++++++++++++++++++ 2 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 pkgs/games/shattered-pixel-dungeon/disable-beryx.patch diff --git a/pkgs/games/shattered-pixel-dungeon/default.nix b/pkgs/games/shattered-pixel-dungeon/default.nix index 81baf3b664ba..3d31a56ae3db 100644 --- a/pkgs/games/shattered-pixel-dungeon/default.nix +++ b/pkgs/games/shattered-pixel-dungeon/default.nix @@ -2,7 +2,7 @@ , makeWrapper , fetchFromGitHub , nixosTests -, gradle_6 +, gradle , perl , jre , libpulseaudio @@ -10,17 +10,19 @@ let pname = "shattered-pixel-dungeon"; - version = "1.1.2"; + version = "2.0.2"; src = fetchFromGitHub { owner = "00-Evan"; repo = "shattered-pixel-dungeon"; - # NOTE: always use the commit sha, not the tag. Tags _will_ disappear! - # https://github.com/00-Evan/shattered-pixel-dungeon/issues/596 - rev = "5d1a2dce6b554b40f6737ead45d411fd98f4c67d"; - sha256 = "sha256-Vu7K0NnqFY298BIQV9AwNEahV0eJl14tAeq+rw6KrtM="; + rev = "v${version}"; + sha256 = "sha256-gg8FHLkw964mYejXvK5GClTvTLGK3FyXR8Kkxjl/pRs="; }; + patches = [ + ./disable-beryx.patch + ]; + postPatch = '' # disable gradle plugins with native code and their targets perl -i.bak1 -pe "s#(^\s*id '.+' version '.+'$)#// \1#" build.gradle @@ -32,8 +34,8 @@ let # fake build to pre-download deps into fixed-output derivation deps = stdenv.mkDerivation { pname = "${pname}-deps"; - inherit version src postPatch; - nativeBuildInputs = [ gradle_6 perl ]; + inherit version src patches postPatch; + nativeBuildInputs = [ gradle perl ]; buildPhase = '' export GRADLE_USER_HOME=$(mktemp -d) # https://github.com/gradle/gradle/issues/4426 @@ -47,13 +49,13 @@ let | sh ''; outputHashMode = "recursive"; - outputHash = "sha256-UI5/ZJbUtEz1Fr+qn6a8kzi9rrP+lVrpBbuDv8TG5y0="; + outputHash = "sha256-ojwvs6j3R31723lfRlKdeyR5+txnetyK3foJTLqy28Q="; }; in stdenv.mkDerivation rec { - inherit pname version src postPatch; + inherit pname version src patches postPatch; - nativeBuildInputs = [ gradle_6 perl makeWrapper ]; + nativeBuildInputs = [ gradle perl makeWrapper ]; buildPhase = '' export GRADLE_USER_HOME=$(mktemp -d) diff --git a/pkgs/games/shattered-pixel-dungeon/disable-beryx.patch b/pkgs/games/shattered-pixel-dungeon/disable-beryx.patch new file mode 100644 index 000000000000..5bd6e5bcf16c --- /dev/null +++ b/pkgs/games/shattered-pixel-dungeon/disable-beryx.patch @@ -0,0 +1,47 @@ +diff --git a/desktop/build.gradle b/desktop/build.gradle +index 97f35f7..afd5116 100644 +--- a/desktop/build.gradle ++++ b/desktop/build.gradle +@@ -1,6 +1,7 @@ +-plugins { +- id 'org.beryx.runtime' version '1.12.7' +-} ++//plugins { ++// id 'org.beryx.runtime' version '1.12.7' ++//} ++apply plugin: "java" + + [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' + sourceCompatibility = targetCompatibility = appJavaCompatibility +@@ -43,11 +44,11 @@ task release(type: Jar) { + attributes 'Implementation-Version': appVersionCode + } + } +-installDist.dependsOn release +-startScripts.dependsOn release +-jpackageImage.dependsOn release ++//installDist.dependsOn release ++//startScripts.dependsOn release ++//jpackageImage.dependsOn release + +-runtime { ++/*runtime { + modules = ['java.base', + 'java.desktop', + 'jdk.unsupported', +@@ -102,7 +103,7 @@ runtime { + } + } + +-} ++}*/ + + dependencies { + implementation project(':core') +@@ -123,4 +124,4 @@ dependencies { + + implementation project(':services:updates:githubUpdates') + implementation project(':services:news:shatteredNews') +-} +\ No newline at end of file ++}