about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorAidan Gauland <aidalgol@fastmail.net>2022-11-25 21:58:37 +1300
committerAidan Gauland <aidalgol@fastmail.net>2022-11-25 21:58:37 +1300
commit383ac1066e9d2c2829fbfbdee3663c3ebe1bd757 (patch)
treeceee32659ba69eb8ab8f3b0772466e8e75e80738 /pkgs/games
parent7b3a88ed2694394be889fc1ea40bef5cfaff70c9 (diff)
starsector: reduce nix profile pollution
Install to $out/share/starsector instead of the top level of $out, in order to
reduce clutter in the user's ~/.nix-profile/ directory.
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/starsector/default.nix12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkgs/games/starsector/default.nix b/pkgs/games/starsector/default.nix
index bbc781d6ab27d..ed995e4a5e640 100644
--- a/pkgs/games/starsector/default.nix
+++ b/pkgs/games/starsector/default.nix
@@ -41,20 +41,20 @@ stdenv.mkDerivation rec {
   installPhase = ''
     runHook preInstall
 
-    mkdir -p $out/bin
+    mkdir -p $out/bin $out/share/starsector
     rm -r jre_linux # remove bundled jre7
     rm starfarer.api.zip
-    cp -r ./* $out
+    cp -r ./* $out/share/starsector
 
     mkdir -p $out/share/icons/hicolor/64x64/apps
     ln -s $out/graphics/ui/s_icon64.png $out/share/icons/hicolor/64x64/apps/starsector.png
 
-    wrapProgram $out/starsector.sh \
+    wrapProgram $out/share/starsector/starsector.sh \
       --prefix PATH : ${lib.makeBinPath [ openjdk ]} \
       --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs} \
       --run 'mkdir -p ''${XDG_DATA_HOME:-~/.local/share}/starsector' \
-      --chdir "$out"
-    ln -s $out/starsector.sh $out/bin/starsector
+      --chdir "$out/share/starsector"
+    ln -s $out/share/starsector/starsector.sh $out/bin/starsector
 
     runHook postInstall
   '';
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
   postPatch = ''
     substituteInPlace starsector.sh \
       --replace "./jre_linux/bin/java" "${openjdk}/bin/java" \
-      --replace "./native/linux" "$out/native/linux" \
+      --replace "./native/linux" "$out/share/starsector/native/linux" \
       --replace "=." "=\''${XDG_DATA_HOME:-\$HOME/.local/share}/starsector" \
       --replace "-XX:+CompilerThreadHintNoPreempt" "-XX:+UnlockDiagnosticVMOptions -XX:-BytecodeVerificationRemote -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSConcurrentMTEnabled -XX:+DisableExplicitGC"
   '';