summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2023-05-28 11:24:03 +0200
committerGitHub <noreply@github.com>2023-05-28 11:24:03 +0200
commit70bafae53101401de73b0448cb91e3e2d870f962 (patch)
treecd2cf81c72a51a6b6e19a78bc8903ea9438df6d6
parentMerge pull request #234549 from bobby285271/upd/gnome (diff)
parentmindustry-server: Fix (diff)
downloadnixpkgs-70bafae53101401de73b0448cb91e3e2d870f962.tar.gz
Merge pull request #233837 from chkno/mindustry-fix
mindustry-server: Fix
-rw-r--r--pkgs/games/mindustry/default.nix61
1 files changed, 33 insertions, 28 deletions
diff --git a/pkgs/games/mindustry/default.nix b/pkgs/games/mindustry/default.nix
index b6d1eff817e4..b8c661f7f483 100644
--- a/pkgs/games/mindustry/default.nix
+++ b/pkgs/games/mindustry/default.nix
@@ -191,36 +191,41 @@ stdenv.mkDerivation rec {
gradle --offline --no-daemon server:dist -Pbuildversion=${buildVersion}
'';
- installPhase = with lib; ''
- runHook preInstall
- '' + optionalString enableClient ''
- install -Dm644 desktop/build/libs/Mindustry.jar $out/share/mindustry.jar
- mkdir -p $out/bin
- makeWrapper ${jdk}/bin/java $out/bin/mindustry \
- --add-flags "-jar $out/share/mindustry.jar" \
- --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libpulseaudio alsa-lib libjack2]} \
- --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/'' + optionalString enableWayland '' \
- --set SDL_VIDEODRIVER wayland \
- --set SDL_VIDEO_WAYLAND_WMCLASS Mindustry
- '' + ''
+ installPhase = with lib; let
+ installClient = ''
+ install -Dm644 desktop/build/libs/Mindustry.jar $out/share/mindustry.jar
+ mkdir -p $out/bin
+ makeWrapper ${jdk}/bin/java $out/bin/mindustry \
+ --add-flags "-jar $out/share/mindustry.jar" \
+ --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libpulseaudio alsa-lib libjack2]} \
+ --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/'' + optionalString enableWayland '' \
+ --set SDL_VIDEODRIVER wayland \
+ --set SDL_VIDEO_WAYLAND_WMCLASS Mindustry
+ '' + ''
- # Retain runtime depends to prevent them from being cleaned up.
- # Since a jar is a compressed archive, nix can't figure out that the dependency is actually in there,
- # and will assume that it's not actually needed.
- # This can cause issues.
- # See https://github.com/NixOS/nixpkgs/issues/109798.
- echo "# Retained runtime dependencies: " >> $out/bin/mindustry
- for dep in ${SDL2.out} ${alsa-lib.out} ${selectedGlew.out}; do
- echo "# $dep" >> $out/bin/mindustry
- done
+ # Retain runtime depends to prevent them from being cleaned up.
+ # Since a jar is a compressed archive, nix can't figure out that the dependency is actually in there,
+ # and will assume that it's not actually needed.
+ # This can cause issues.
+ # See https://github.com/NixOS/nixpkgs/issues/109798.
+ echo "# Retained runtime dependencies: " >> $out/bin/mindustry
+ for dep in ${SDL2.out} ${alsa-lib.out} ${selectedGlew.out}; do
+ echo "# $dep" >> $out/bin/mindustry
+ done
- install -Dm644 core/assets/icons/icon_64.png $out/share/icons/hicolor/64x64/apps/mindustry.png
- '' + optionalString enableServer ''
- install -Dm644 server/build/libs/server-release.jar $out/share/mindustry-server.jar
- mkdir -p $out/bin
- makeWrapper ${jdk}/bin/java $out/bin/mindustry-server \
- --add-flags "-jar $out/share/mindustry-server.jar"
- '' + ''
+ install -Dm644 core/assets/icons/icon_64.png $out/share/icons/hicolor/64x64/apps/mindustry.png
+ '';
+ installServer = ''
+ install -Dm644 server/build/libs/server-release.jar $out/share/mindustry-server.jar
+ mkdir -p $out/bin
+ makeWrapper ${jdk}/bin/java $out/bin/mindustry-server \
+ --add-flags "-jar $out/share/mindustry-server.jar"
+ '';
+ in ''
+ runHook preInstall
+ '' + optionalString enableClient installClient
+ + optionalString enableServer installServer
+ + ''
runHook postInstall
'';