@@ -22,14 +22,14 @@ let
2222 # Note: when raising the version, ensure that all SNAPSHOT versions in
2323 # build.gradle are replaced by a fixed version
2424 # (the current one at the time of release) (see postPatch).
25− version = "121.4";
25+ version = "122";
2626 buildVersion = makeBuildVersion version;
2727
2828 src = fetchFromGitHub {
2929 owner = "Anuken";
3030 repo = "Mindustry";
3131 rev = "v${version}";
32− sha256 = "14w0fkn8q5bj84py7vx33wdk9d37ncrq6rdj5ryz4mvlxbix2n4n";
32+ sha256 = "19dxqscnny0c5w3pyg88hflrkhsqgd7zx19240kh4h69y3wwaz0m";
3333 };
3434
3535 desktopItem = makeDesktopItem {
@@ -50,6 +50,13 @@ let
5050 sed -i 's/com.github.anuken:packr:-SNAPSHOT/com.github.anuken:packr:034efe51781d2d8faa90370492133241bfb0283c/' build.gradle
5151 '';
5252
53+ preBuild = ''
54+ # Arc is run at build time for sprite packing, and it needs to see
55+ # the runtime libraries
56+ ${stdenv.lib.optionalString stdenv.isLinux "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${alsaLib}/lib"}
57+ export GRADLE_USER_HOME=$(mktemp -d)
58+ '';
59+
5360 # The default one still uses jdk8 (#89731)
5461 gradle_6 = (gradleGen.override (old: { java = jdk14; })).gradle_6_7;
5562
@@ -62,7 +69,7 @@ let
6269 # one hash for 'deps'. Deps can be garbage collected after the build,
6370 # so this is not really an issue.
6471 buildPhase = ''
65− export GRADLE_USER_HOME=$(mktemp -d)
72+ ${preBuild}
6673 gradle --no-daemon desktop:dist -Pbuildversion=${buildVersion}
6774 gradle --no-daemon server:dist -Pbuildversion=${buildVersion}
6875 '';
@@ -74,7 +81,7 @@ let
7481 '';
7582 outputHashAlgo = "sha256";
7683 outputHashMode = "recursive";
77− outputHash = "18n671aa013cnsnp9aaw61llqz4s4vn7zgja8cazd0cg632x8jca";
84+ outputHash = "1kymfrd2vd23y1rmx19q47wc212r6qx03x6g58pxbqyylxmcw5zq";
7885 };
7986
8087 # Separate commands for building and installing the server and the client
@@ -109,7 +116,7 @@ stdenv.mkDerivation rec {
109116 nativeBuildInputs = [ gradle_6 makeWrapper ];
110117
111118 buildPhase = with stdenv.lib; ''
112− export GRADLE_USER_HOME=$(mktemp -d)
119+ ${preBuild}
113120 # point to offline repo
114121 sed -ie "s#mavenLocal()#mavenLocal(); maven { url '${deps}' }#g" build.gradle
115122 ${optionalString enableClient buildClient}
@@ -125,11 +132,15 @@ stdenv.mkDerivation rec {
125132 homepage = "https://mindustrygame.github.io/";
126133 downloadPage = "https://github.com/Anuken/Mindustry/releases";
127134 description = "A sandbox tower defense game";
128− license = licenses.gpl3;
135+ license = licenses.gpl3Plus;
129136 maintainers = with maintainers; [ fgaz ];
130137 platforms = platforms.all;
131138 # Hash mismatch on darwin:
132139 # https://github.com/NixOS/nixpkgs/pull/105590#issuecomment-737120293
133− broken = stdenv.isDarwin;
140+ # Problems with native libraries in aarch64:
141+ # https://github.com/NixOS/nixpkgs/pull/107646
142+ # https://logs.nix.ci/?key=nixos/nixpkgs.107646&attempt_id=3032c060-72e9-4a76-8186-4739544397dd
143+ broken = stdenv.isDarwin ||
144+ stdenv.isAarch64;
134145 };
135146}