nixpkgs-suyu/pkgs/applications/networking/sniffers/qtwirediff/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

55 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, qtbase
, qmake
, qtwayland
, wrapQtAppsHook
, wireshark-cli
}:
stdenv.mkDerivation {
pname = "qtwirediff";
version = "unstable-2023-03-07";
src = fetchFromGitHub {
owner = "aaptel";
repo = "qtwirediff";
rev = "e0a38180cdf9d94b7535c441487dcefb3a8ec72e";
hash = "sha256-QS4PslSHe2qhxayF7IHvtFASgd4A7vVtSY8tFQ6dqXM=";
};
nativeBuildInputs = [
qmake
wrapQtAppsHook
];
buildInputs = [
qtbase
] ++ lib.optionals stdenv.isLinux [
qtwayland
];
installPhase = ''
runHook preInstall
'' + lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
cp -r qtwirediff.app $out/Applications
makeWrapper $out/{Applications/qtwirediff.app/Contents/MacOS,bin}/qtwirediff
'' + lib.optionalString stdenv.isLinux ''
install -Dm755 -T qtwirediff $out/bin/qtwirediff
wrapProgram $out/bin/qtwirediff \
--prefix PATH : "${lib.makeBinPath [ wireshark-cli ]}"
'' + ''
runHook postInstall
'';
meta = {
description = "Debugging tool to diff network traffic leveraging Wireshark";
mainProgram = "qtwirediff";
homepage = "https://github.com/aaptel/qtwirediff";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ janik ];
};
}