-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: zi3m5f <[email protected]>
- Loading branch information
1 parent
2997153
commit 7d50137
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
fetchFromGitHub, | ||
lib, | ||
stdenv, | ||
rustPlatform, | ||
gtk4, | ||
pkg-config, | ||
pango, | ||
wrapGAppsHook4, | ||
darwin, | ||
versionCheckHook, | ||
}: | ||
|
||
rustPlatform.buildRustPackage rec { | ||
pname = "packetry"; | ||
version = "0.3.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "greatscottgadgets"; | ||
repo = "packetry"; | ||
rev = "refs/tags/v${version}"; | ||
hash = "sha256-yar4HusBSaiKj2QMwtt83jmbfzwt+oFTQ6UVVbOZbYQ="; | ||
}; | ||
|
||
cargoHash = "sha256-W3J3MnRPxhXXc7MBQemnYKloVnuU52p48vrNsd+FCY4="; | ||
|
||
nativeBuildInputs = [ | ||
pkg-config | ||
wrapGAppsHook4 | ||
]; | ||
|
||
buildInputs = | ||
[ | ||
gtk4 | ||
pango | ||
] | ||
++ lib.optionals stdenv.isDarwin [ | ||
darwin.apple_sdk_11_0.frameworks.AppKit | ||
]; | ||
|
||
# Disable test_replay tests as they need a gui | ||
preCheck = '' | ||
sed -i 's:#\[test\]:#[test] #[ignore]:' src/test_replay.rs | ||
''; | ||
|
||
nativeInstallCheckInputs = [ versionCheckHook ]; | ||
versionCheckProgramArg = "--version"; | ||
doInstallCheck = true; | ||
|
||
# packetry-cli is only necessary on windows https://github.com/greatscottgadgets/packetry/pull/154 | ||
postInstall = '' | ||
rm $out/bin/packetry-cli | ||
''; | ||
|
||
meta = { | ||
description = "USB 2.0 protocol analysis application for use with Cynthion"; | ||
homepage = "https://github.com/greatscottgadgets/packetry"; | ||
license = lib.licenses.bsd3; | ||
maintainers = with lib.maintainers; [ carlossless ]; | ||
mainProgram = "packetry"; | ||
platforms = lib.platforms.linux ++ lib.platforms.darwin; | ||
}; | ||
} |