summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Worley <scottworley@scottworley.com>2023-05-24 07:41:40 -0700
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2023-05-28 09:24:39 +0000
commit2509259b742b69e703584fe9fc2cea26ae093b7f (patch)
treeebde64476836f976b893af15280fab1a569be5b9
parentthelounge: fix build (diff)
downloadnixpkgs-origin/backport-233837-to-release-23.05.tar.gz
(cherry picked from commit dfdb06dad3560358b3517331316e99a904ea69d4)
-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 ad433de83661..7af27af26bc1 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
'';