about summary refs log tree commit diff
diff options
context:
space:
mode:
authorrafaelrc7 <contact@rafaelrc.com>2024-02-05 19:51:17 -0300
committerrafaelrc7 <contact@rafaelrc.com>2024-02-08 20:38:21 -0300
commitff5a8516dd95a2197877e977e71c43e75650ef9f (patch)
treefac44bfee884ea6f40cd88e8ab93e09797a16c7b
parent4b1aab22192b787355733c9495d47f4c66af084c (diff)
starsector: update JVM flags
During this update, due to a new version of Java, the software broke.
On startup it crashed with the error: "Conflicting collector
combinations in option list". This was due to mixing the default
`-XX:+UseG1GC` and the `-XX:+UseConcMarkSweepGC -XX:+UseParNewGC` flags.
I removed the latter flags, leaving the default garbage collector

Furthermore, on succesful launch, the game wound warn about the
`-XX:PermSize=192m -XX:MaxPermSize=192m` flags, that were removed in
Java 8. Thus, those flags were also removed.

The `substituteInPlace` deprecated `--replace` argument was also
replaced by the new alternatives.
-rw-r--r--pkgs/games/starsector/default.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/games/starsector/default.nix b/pkgs/games/starsector/default.nix
index 2dbb0ed547915..cfcd70a0bb940 100644
--- a/pkgs/games/starsector/default.nix
+++ b/pkgs/games/starsector/default.nix
@@ -63,12 +63,14 @@ stdenv.mkDerivation rec {
   # it tries to run everything with relative paths, which makes it CWD dependent
   # also point mod, screenshot, and save directory to $XDG_DATA_HOME
   # additionally, add some GC options to improve performance of the game
+  # and remove flags "PermSize" and "MaxPermSize" that were removed with Java 8
   postPatch = ''
     substituteInPlace starsector.sh \
-      --replace "./jre_linux/bin/java" "${openjdk}/bin/java" \
-      --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"
+      --replace-fail "./jre_linux/bin/java" "${openjdk}/bin/java" \
+      --replace-fail "./native/linux" "$out/share/starsector/native/linux" \
+      --replace-fail "=." "=\''${XDG_DATA_HOME:-\$HOME/.local/share}/starsector" \
+      --replace-warn "-XX:+CompilerThreadHintNoPreempt" "-XX:+UnlockDiagnosticVMOptions -XX:-BytecodeVerificationRemote -XX:+CMSConcurrentMTEnabled -XX:+DisableExplicitGC" \
+      --replace-quiet " -XX:PermSize=192m -XX:MaxPermSize=192m" ""
   '';
 
   meta = with lib; {