e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
56 lines
1.3 KiB
Nix
56 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.hostPlatform.isLinux [
|
|
qtwayland
|
|
];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
mkdir -p $out/Applications
|
|
cp -r qtwirediff.app $out/Applications
|
|
makeWrapper $out/{Applications/qtwirediff.app/Contents/MacOS,bin}/qtwirediff
|
|
'' + lib.optionalString stdenv.hostPlatform.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 = [ ];
|
|
};
|
|
}
|