nixpkgs/pkgs/by-name/cy/cyme/package.nix

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

69 lines
1.6 KiB
Nix
Raw Normal View History

2023-10-23 22:03:36 +02:00
{
lib,
fetchFromGitHub,
rustPlatform,
pkg-config,
installShellFiles,
2023-10-25 08:49:01 +02:00
stdenv,
darwin,
versionCheckHook,
2023-10-23 22:03:36 +02:00
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "cyme";
2025-08-03 14:37:34 +00:00
version = "2.2.4";
2023-10-23 22:03:36 +02:00
src = fetchFromGitHub {
owner = "tuna-f1sh";
repo = "cyme";
rev = "v${version}";
2025-08-03 14:37:34 +00:00
hash = "sha256-zwte2YzjEMW1wVti02tOa2IZMd2Z8amYUB9RHevx5bg=";
2023-10-23 22:03:36 +02:00
};
2025-08-03 14:37:34 +00:00
cargoHash = "sha256-wOOcIkEgyR5Af78uMuCksalVH8VPFXptg232It/ilXE=";
2023-10-23 22:03:36 +02:00
2023-10-25 08:49:01 +02:00
nativeBuildInputs = [
pkg-config
installShellFiles
2023-10-25 08:49:01 +02:00
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.DarwinTools
];
checkFlags = [
# doctest that requires access outside sandbox
"--skip=udev::hwdb::get"
# - system_profiler is not available in the sandbox
# - workaround for "Io Error: No such file or directory"
"--skip=test_run"
2023-10-25 08:49:01 +02:00
];
postInstall = ''
installManPage doc/cyme.1
installShellCompletion --cmd cyme \
--bash doc/cyme.bash \
--fish doc/cyme.fish \
--zsh doc/_cyme
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/${meta.mainProgram}";
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
2023-10-23 22:03:36 +02:00
meta = with lib; {
homepage = "https://github.com/tuna-f1sh/cyme";
2024-06-16 22:48:03 +02:00
changelog = "https://github.com/tuna-f1sh/cyme/releases/tag/${src.rev}";
2023-10-23 22:03:36 +02:00
description = "Modern cross-platform lsusb";
2023-10-25 08:48:27 +02:00
license = licenses.gpl3Plus;
2023-10-23 22:03:36 +02:00
maintainers = with maintainers; [ h7x4 ];
2023-10-25 08:48:27 +02:00
platforms = platforms.linux ++ platforms.darwin ++ platforms.windows;
2023-10-23 22:03:36 +02:00
mainProgram = "cyme";
};
}