Skip to content

Commit

Permalink
shattered-pixel-dungeon: 1.1.2 -> 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fgaz committed May 28, 2023
1 parent a96075f commit a5472cf
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pkgs/games/shattered-pixel-dungeon/default.nix
Expand Up @@ -2,25 +2,27 @@
, makeWrapper
, fetchFromGitHub
, nixosTests
, gradle_6
, gradle
, perl
, jre
, libpulseaudio
}:

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
Expand All @@ -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
Expand All @@ -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)
Expand Down
47 changes: 47 additions & 0 deletions 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
+}

0 comments on commit a5472cf

Please sign in to comment.