2023-07-25 09:03:57 -06:00
|
|
|
{ lib, fetchFromGitHub, makeWrapper, maven, jdk }:
|
2024-07-15 07:12:57 -06:00
|
|
|
|
|
|
|
maven.buildMavenPackage rec {
|
2023-06-13 17:12:10 -06:00
|
|
|
pname = "slipstream";
|
|
|
|
version = "1.9.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Vhati";
|
|
|
|
repo = "Slipstream-Mod-Manager";
|
2023-07-02 05:29:22 -06:00
|
|
|
rev = "v${version}";
|
2023-06-19 17:40:12 -06:00
|
|
|
hash = "sha256-F+o94Oh9qxVdfgwdmyOv+WZl1BjQuzhQWaVrAgScgIU=";
|
2023-06-13 17:12:10 -06:00
|
|
|
};
|
|
|
|
|
2024-07-15 07:12:57 -06:00
|
|
|
mvnJdk = jdk;
|
2024-07-03 17:14:47 -06:00
|
|
|
mvnHash = "sha256-woOSkF5TuzaJ84EndryMoXTMbbK/V/BShM1k+WB8D/c=";
|
2023-06-13 17:12:10 -06:00
|
|
|
|
2023-07-31 12:52:36 -06:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2023-06-13 17:12:10 -06:00
|
|
|
|
|
|
|
installPhase = ''
|
2023-07-02 05:45:06 -06:00
|
|
|
runHook preInstall
|
|
|
|
|
2023-06-13 17:12:10 -06:00
|
|
|
mkdir -p $out/share/java
|
2023-07-02 05:29:22 -06:00
|
|
|
install -Dm644 target/ftl-mod-manager-${version}.jar $out/share/java
|
2023-06-13 17:12:10 -06:00
|
|
|
install -Dm644 target/modman.jar $out/share/java
|
|
|
|
|
2023-07-03 16:37:57 -06:00
|
|
|
# slipstream is very finniky about having specific
|
|
|
|
# folders at startup, so wrapper creates them for it.
|
|
|
|
# this is because slipstream expects to be started from
|
|
|
|
# archive it comes from, but we can't do that since
|
|
|
|
# we need the mods directory to be writable.
|
|
|
|
# see: https://github.com/Vhati/Slipstream-Mod-Manager/blob/85cad4ffbef8583d908b189204d7d22a26be43f8/src/main/java/net/vhati/modmanager/cli/SlipstreamCLI.java#L105
|
2023-07-03 16:19:53 -06:00
|
|
|
makeWrapper ${jdk}/bin/java $out/bin/${pname} \
|
|
|
|
--run '_dir="''${XDG_DATA_HOME:-$HOME/.local/share}/slipstream"' \
|
|
|
|
--run 'mkdir -p $_dir/{mods,backup}' \
|
|
|
|
--run 'cd $_dir' \
|
|
|
|
--append-flags "-jar $out/share/java/modman.jar"
|
2023-07-02 05:45:06 -06:00
|
|
|
|
|
|
|
runHook postInstall
|
2023-06-13 17:12:10 -06:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Mod manager for FTL: Faster Than Light";
|
|
|
|
homepage = "https://github.com/Vhati/Slipstream-Mod-Manager";
|
2024-04-26 05:35:31 -06:00
|
|
|
license = licenses.gpl2Only;
|
2023-06-13 17:12:10 -06:00
|
|
|
maintainers = with maintainers; [ mib ];
|
2024-02-10 19:19:15 -07:00
|
|
|
mainProgram = "slipstream";
|
2023-06-13 17:12:10 -06:00
|
|
|
};
|
2023-07-02 05:29:22 -06:00
|
|
|
}
|