Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / ow / owmods-cli / package.nix
blob23db013295115c12fa2d5a2df5b56845c9556148
1 { lib
2 , stdenv
3 , nix-update-script
4 , fetchFromGitHub
5 , rustPlatform
6 , pkg-config
7 , installShellFiles
8 , zstd
9 , libsoup_3
10 , makeWrapper
11 , mono
12 , wrapWithMono ? true
13 , openssl
14 , darwin
17 rustPlatform.buildRustPackage rec {
18   pname = "owmods-cli";
19   version = "0.14.3";
21   src = fetchFromGitHub {
22     owner = "ow-mods";
23     repo = "ow-mod-man";
24     rev = "cli_v${version}";
25     hash = "sha256-ONvmTBF9y3NMQx1KgNhJt+0nV57xc9cLalpfDqrTSq0=";
26   };
28   cargoHash = "sha256-I4OX27LHpT5YYW6yEhX+sCuA8m0KZd/qud4xdEUzkyA=";
30   nativeBuildInputs = [
31     pkg-config
32     installShellFiles
33   ] ++ lib.optional wrapWithMono makeWrapper;
35   buildInputs = [
36     zstd
37     libsoup_3
38   ] ++ lib.optionals stdenv.isLinux [
39     openssl
40   ] ++ lib.optionals stdenv.isDarwin [
41     darwin.apple_sdk.frameworks.Security
42     darwin.apple_sdk.frameworks.SystemConfiguration
43   ];
45   env = {
46     ZSTD_SYS_USE_PKG_CONFIG = true;
47   };
49   buildAndTestSubdir = "owmods_cli";
51   postInstall = ''
52     cargo xtask dist_cli
53     installManPage dist/cli/man/*
54     installShellCompletion --cmd owmods \
55     dist/cli/completions/owmods.{bash,fish,zsh}
56     '' + lib.optionalString wrapWithMono ''
57     wrapProgram $out/bin/${meta.mainProgram} --prefix PATH : '${mono}/bin'
58   '';
60   passthru.updateScript = nix-update-script {};
62   meta = with lib; {
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 = licenses.gpl3Plus;
69     maintainers = with maintainers; [ bwc9876 spoonbaker locochoco ];
70   };