Skyler Turner | 038082f | 2022-02-08 18:34:01 +0000 | [diff] [blame] | 1 | final: prev: let |
Skyler Turner | 9bce712 | 2022-02-08 19:21:08 +0000 | [diff] [blame] | 2 | version = "135"; |
| 3 | |
| 4 | jdk = prev.adoptopenjdk-hotspot-bin-15; |
Skyler Turner | 038082f | 2022-02-08 18:34:01 +0000 | [diff] [blame] | 5 | |
Skyler Turner | 9cc9f09 | 2022-02-08 18:36:02 +0000 | [diff] [blame] | 6 | Mindustry = final.fetchFromGitHub { |
Skyler Turner | 038082f | 2022-02-08 18:34:01 +0000 | [diff] [blame] | 7 | owner = "Anuken"; |
| 8 | repo = "Mindustry"; |
| 9 | rev = "v${version}"; |
| 10 | sha256 = "URmjmfzQAVVl6erbh3+FVFdN7vGTNwYKPtcrwtt9vkg="; |
| 11 | }; |
Skyler Turner | 9cc9f09 | 2022-02-08 18:36:02 +0000 | [diff] [blame] | 12 | Arc = final.fetchFromGitHub { |
Skyler Turner | 038082f | 2022-02-08 18:34:01 +0000 | [diff] [blame] | 13 | owner = "Anuken"; |
| 14 | repo = "Arc"; |
Skyler Turner | 9bce712 | 2022-02-08 19:21:08 +0000 | [diff] [blame] | 15 | rev = "v${version}"; |
Skyler Turner | 038082f | 2022-02-08 18:34:01 +0000 | [diff] [blame] | 16 | sha256 = "pUUak5P9t4RmSdT+/oH/8oo6l7rjIN08XDJ06TcUn8I="; |
| 17 | }; |
Skyler Turner | 9cc9f09 | 2022-02-08 18:36:02 +0000 | [diff] [blame] | 18 | soloud = final.fetchFromGitHub { |
Skyler Turner | 038082f | 2022-02-08 18:34:01 +0000 | [diff] [blame] | 19 | owner = "Anuken"; |
| 20 | repo = "soloud"; |
| 21 | # this is never pinned in upstream, see https://github.com/Anuken/Arc/issues/39 |
| 22 | rev = "b33dfc5178fcb2613ee68136f4a4869cadc0b06a"; |
| 23 | sha256 = "1vf68i3pnsixch37285ib7afkwmlrc05v783395jsdjzj9i67lj3"; |
| 24 | }; |
| 25 | |
| 26 | unpackPhase = '' |
| 27 | cp -r ${Mindustry} Mindustry |
| 28 | cp -r ${Arc} Arc |
| 29 | chmod -R u+w -- Mindustry Arc |
| 30 | cp ${prev.stb.src}/stb_image.h Arc/arc-core/csrc/ |
| 31 | cp -r ${soloud} Arc/arc-core/csrc/soloud |
| 32 | chmod -R u+w -- Arc |
| 33 | ''; |
Skyler Turner | 9bce712 | 2022-02-08 19:21:08 +0000 | [diff] [blame] | 34 | |
| 35 | gradle_6 = (prev.gradleGen.override (old: { java = jdk; })).gradle_6_9; |
| 36 | |
| 37 | enableClient = prev.enableClient or true; |
| 38 | enableServer = prev.enableServer or true; |
Skyler Turner | 038082f | 2022-02-08 18:34:01 +0000 | [diff] [blame] | 39 | in { |
| 40 | mindustry-alpha-wayland = prev.mindustry-wayland.overrideAttrs (old: { |
| 41 | inherit version unpackPhase; |
Skyler Turner | 9bce712 | 2022-02-08 19:21:08 +0000 | [diff] [blame] | 42 | |
| 43 | nativeBuildInputs = [ |
| 44 | prev.pkg-config |
| 45 | gradle_6 |
| 46 | prev.makeWrapper |
| 47 | jdk |
| 48 | ] ++ prev.lib.optionals enableClient [ |
| 49 | prev.ant |
| 50 | prev.copyDesktopItems |
| 51 | ]; |
| 52 | |
| 53 | meta.lib.broken = false; |
| 54 | |
| 55 | installPhase = with prev.lib; '' |
| 56 | runHook preInstall |
| 57 | '' + optionalString enableClient '' |
| 58 | install -Dm644 desktop/build/libs/Mindustry.jar $out/share/mindustry.jar |
| 59 | mkdir -p $out/bin |
| 60 | makeWrapper ${jdk}/bin/java $out/bin/mindustry \ |
| 61 | --add-flags "-jar $out/share/mindustry.jar" |
| 62 | install -Dm644 core/assets/icons/icon_64.png $out/share/icons/hicolor/64x64/apps/mindustry.png |
| 63 | '' + optionalString enableServer '' |
| 64 | install -Dm644 server/build/libs/server-release.jar $out/share/mindustry-server.jar |
| 65 | mkdir -p $out/bin |
| 66 | makeWrapper ${jdk}/bin/java $out/bin/mindustry-server \ |
| 67 | --add-flags "-jar $out/share/mindustry-server.jar" |
| 68 | '' + '' |
| 69 | runHook postInstall |
| 70 | ''; |
Skyler Turner | b170233 | 2022-02-08 18:34:23 +0000 | [diff] [blame] | 71 | }); |
Skyler Turner | 038082f | 2022-02-08 18:34:01 +0000 | [diff] [blame] | 72 | } |