nixpkgs/pkgs/by-name/ow/owmods-cli/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.7 KiB
Nix
Raw Normal View History

2023-07-27 16:49:12 +03:00
{ lib
, stdenv
2023-11-08 18:26:31 +03:00
, nix-update-script
2023-07-27 16:49:12 +03:00
, fetchFromGitHub
, rustPlatform
, pkg-config
, installShellFiles
, zstd
, libsoup_3
, makeWrapper
, mono
, wrapWithMono ? true
2023-07-27 16:49:12 +03:00
, openssl
, darwin
2023-07-27 16:49:12 +03:00
}:
rustPlatform.buildRustPackage rec {
pname = "owmods-cli";
2024-03-24 14:01:08 +03:00
version = "0.13.1";
2023-07-27 16:49:12 +03:00
src = fetchFromGitHub {
owner = "ow-mods";
repo = "ow-mod-man";
rev = "cli_v${version}";
2024-03-24 14:01:08 +03:00
hash = "sha256-atP2nUOWs4WBo7jjugPfELW0BDz6kETyTaWkR9tsmb8=";
2023-07-27 16:49:12 +03:00
};
2024-03-24 14:01:08 +03:00
cargoHash = "sha256-PgPGSMvdvYKRgFc1zq1WN7Zu2ie8RwsupVnhW9Nw64Y=";
2023-07-27 16:49:12 +03:00
nativeBuildInputs = [
pkg-config
installShellFiles
] ++ lib.optional wrapWithMono makeWrapper;
2023-07-27 16:49:12 +03:00
buildInputs = [
zstd
libsoup_3
2023-07-27 16:49:12 +03:00
] ++ lib.optionals stdenv.isLinux [
openssl
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
2024-03-21 00:37:22 +03:00
darwin.apple_sdk.frameworks.SystemConfiguration
2023-07-27 16:49:12 +03:00
];
env = {
ZSTD_SYS_USE_PKG_CONFIG = true;
};
buildAndTestSubdir = "owmods_cli";
postInstall = ''
cargo xtask dist_cli
installManPage dist/cli/man/*
2023-07-27 16:49:12 +03:00
installShellCompletion --cmd owmods \
dist/cli/completions/owmods.{bash,fish,zsh}
'' + lib.optionalString wrapWithMono ''
wrapProgram $out/bin/${meta.mainProgram} --prefix PATH : '${mono}/bin'
2023-07-27 16:49:12 +03:00
'';
2023-11-08 18:26:31 +03:00
passthru.updateScript = nix-update-script {};
2023-07-27 16:49:12 +03:00
meta = with lib; {
description = "CLI version of the mod manager for Outer Wilds Mod Loader";
homepage = "https://github.com/ow-mods/ow-mod-man/tree/main/owmods_cli";
downloadPage = "https://github.com/ow-mods/ow-mod-man/releases/tag/cli_v${version}";
changelog = "https://github.com/ow-mods/ow-mod-man/releases/tag/cli_v${version}";
mainProgram = "owmods";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ bwc9876 spoonbaker locochoco ];
2023-07-27 16:49:12 +03:00
};
}