1{
2 lib,
3 stdenv,
4 nix-update-script,
5 fetchFromGitHub,
6 rustPlatform,
7 pkg-config,
8 installShellFiles,
9 zstd,
10 libsoup_3,
11 makeWrapper,
12 mono,
13 wrapWithMono ? true,
14 openssl,
15}:
16
17rustPlatform.buildRustPackage rec {
18 pname = "owmods-cli";
19 version = "0.15.2";
20
21 src = fetchFromGitHub {
22 owner = "ow-mods";
23 repo = "ow-mod-man";
24 rev = "cli_v${version}";
25 hash = "sha256-5ymU9X4J5UPLHxV+7WB29e5Wuq++wYA9bqI2YPjDtWs=";
26 };
27
28 cargoHash = "sha256-Z/muI8JLjOFJBSIMWlvCyFW4JI3lP6/O0AI8Uj8AtBo=";
29
30 nativeBuildInputs = [
31 pkg-config
32 installShellFiles
33 ]
34 ++ lib.optional wrapWithMono makeWrapper;
35
36 buildInputs = [
37 zstd
38 libsoup_3
39 ]
40 ++ lib.optionals stdenv.hostPlatform.isLinux [
41 openssl
42 ];
43
44 env = {
45 ZSTD_SYS_USE_PKG_CONFIG = true;
46 };
47
48 buildAndTestSubdir = "owmods_cli";
49
50 postInstall = ''
51 cargo xtask dist_cli
52 installManPage dist/cli/man/*
53 installShellCompletion --cmd owmods \
54 dist/cli/completions/owmods.{bash,fish,zsh}
55 ''
56 + lib.optionalString wrapWithMono ''
57 wrapProgram $out/bin/${meta.mainProgram} --prefix PATH : '${mono}/bin'
58 '';
59
60 passthru.updateScript = nix-update-script { };
61
62 meta = {
63 description = "CLI version of the mod manager for Outer Wilds Mod Loader";
64 homepage = "https://github.com/ow-mods/ow-mod-man/tree/main/owmods_cli";
65 downloadPage = "https://github.com/ow-mods/ow-mod-man/releases/tag/cli_v${version}";
66 changelog = "https://github.com/ow-mods/ow-mod-man/releases/tag/cli_v${version}";
67 mainProgram = "owmods";
68 license = lib.licenses.gpl3Plus;
69 maintainers = with lib.maintainers; [
70 bwc9876
71 spoonbaker
72 locochoco
73 ];
74 };
75}