base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12 (#356361)
[NixPkgs.git] / pkgs / tools / games / slipstream / default.nix
blobf1fa38f893f89912d9fce752611c1620e178e5c3
1 { lib, fetchFromGitHub, makeWrapper, maven, jdk }:
3 maven.buildMavenPackage rec {
4   pname = "slipstream";
5   version = "1.9.1";
7   src = fetchFromGitHub {
8     owner = "Vhati";
9     repo = "Slipstream-Mod-Manager";
10     rev = "v${version}";
11     hash = "sha256-F+o94Oh9qxVdfgwdmyOv+WZl1BjQuzhQWaVrAgScgIU=";
12   };
14   mvnJdk = jdk;
15   mvnHash = "sha256-woOSkF5TuzaJ84EndryMoXTMbbK/V/BShM1k+WB8D/c=";
17   nativeBuildInputs = [ makeWrapper ];
19   installPhase = ''
20     runHook preInstall
22     mkdir -p $out/share/java
23     install -Dm644 target/ftl-mod-manager-${version}.jar $out/share/java
24     install -Dm644 target/modman.jar $out/share/java
26     # slipstream is very finniky about having specific
27     # folders at startup, so wrapper creates them for it.
28     # this is because slipstream expects to be started from
29     # archive it comes from, but we can't do that since
30     # we need the mods directory to be writable.
31     # see: https://github.com/Vhati/Slipstream-Mod-Manager/blob/85cad4ffbef8583d908b189204d7d22a26be43f8/src/main/java/net/vhati/modmanager/cli/SlipstreamCLI.java#L105
32     makeWrapper ${jdk}/bin/java $out/bin/${pname} \
33       --run '_dir="''${XDG_DATA_HOME:-$HOME/.local/share}/slipstream"' \
34       --run 'mkdir -p $_dir/{mods,backup}' \
35       --run 'cd $_dir' \
36       --append-flags "-jar $out/share/java/modman.jar"
38     runHook postInstall
39   '';
41   meta = with lib; {
42     description = "Mod manager for FTL: Faster Than Light";
43     homepage = "https://github.com/Vhati/Slipstream-Mod-Manager";
44     license = licenses.gpl2Only;
45     maintainers = with maintainers; [ mib ];
46     mainProgram = "slipstream";
47   };