Merge pull request #233837 from chkno/mindustry-fix

mindustry-server: Fix

authored by

Francesco Gazzetta and committed by
GitHub
70bafae5 7742ca11

+33 -28
+33 -28
pkgs/games/mindustry/default.nix
··· 191 191 gradle --offline --no-daemon server:dist -Pbuildversion=${buildVersion} 192 192 ''; 193 193 194 - installPhase = with lib; '' 195 - runHook preInstall 196 - '' + optionalString enableClient '' 197 - install -Dm644 desktop/build/libs/Mindustry.jar $out/share/mindustry.jar 198 - mkdir -p $out/bin 199 - makeWrapper ${jdk}/bin/java $out/bin/mindustry \ 200 - --add-flags "-jar $out/share/mindustry.jar" \ 201 - --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libpulseaudio alsa-lib libjack2]} \ 202 - --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/'' + optionalString enableWayland '' \ 203 - --set SDL_VIDEODRIVER wayland \ 204 - --set SDL_VIDEO_WAYLAND_WMCLASS Mindustry 205 - '' + '' 194 + installPhase = with lib; let 195 + installClient = '' 196 + install -Dm644 desktop/build/libs/Mindustry.jar $out/share/mindustry.jar 197 + mkdir -p $out/bin 198 + makeWrapper ${jdk}/bin/java $out/bin/mindustry \ 199 + --add-flags "-jar $out/share/mindustry.jar" \ 200 + --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libpulseaudio alsa-lib libjack2]} \ 201 + --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/'' + optionalString enableWayland '' \ 202 + --set SDL_VIDEODRIVER wayland \ 203 + --set SDL_VIDEO_WAYLAND_WMCLASS Mindustry 204 + '' + '' 206 205 207 - # Retain runtime depends to prevent them from being cleaned up. 208 - # Since a jar is a compressed archive, nix can't figure out that the dependency is actually in there, 209 - # and will assume that it's not actually needed. 210 - # This can cause issues. 211 - # See https://github.com/NixOS/nixpkgs/issues/109798. 212 - echo "# Retained runtime dependencies: " >> $out/bin/mindustry 213 - for dep in ${SDL2.out} ${alsa-lib.out} ${selectedGlew.out}; do 214 - echo "# $dep" >> $out/bin/mindustry 215 - done 206 + # Retain runtime depends to prevent them from being cleaned up. 207 + # Since a jar is a compressed archive, nix can't figure out that the dependency is actually in there, 208 + # and will assume that it's not actually needed. 209 + # This can cause issues. 210 + # See https://github.com/NixOS/nixpkgs/issues/109798. 211 + echo "# Retained runtime dependencies: " >> $out/bin/mindustry 212 + for dep in ${SDL2.out} ${alsa-lib.out} ${selectedGlew.out}; do 213 + echo "# $dep" >> $out/bin/mindustry 214 + done 216 215 217 - install -Dm644 core/assets/icons/icon_64.png $out/share/icons/hicolor/64x64/apps/mindustry.png 218 - '' + optionalString enableServer '' 219 - install -Dm644 server/build/libs/server-release.jar $out/share/mindustry-server.jar 220 - mkdir -p $out/bin 221 - makeWrapper ${jdk}/bin/java $out/bin/mindustry-server \ 222 - --add-flags "-jar $out/share/mindustry-server.jar" 223 - '' + '' 216 + install -Dm644 core/assets/icons/icon_64.png $out/share/icons/hicolor/64x64/apps/mindustry.png 217 + ''; 218 + installServer = '' 219 + install -Dm644 server/build/libs/server-release.jar $out/share/mindustry-server.jar 220 + mkdir -p $out/bin 221 + makeWrapper ${jdk}/bin/java $out/bin/mindustry-server \ 222 + --add-flags "-jar $out/share/mindustry-server.jar" 223 + ''; 224 + in '' 225 + runHook preInstall 226 + '' + optionalString enableClient installClient 227 + + optionalString enableServer installServer 228 + + '' 224 229 runHook postInstall 225 230 ''; 226 231