nixpkgs/pkgs/by-name/ur/urh/package.nix
Paw Møller 47b5e2e54c
urh: 2.9.6 -> 2.9.8; install desktop file (#357930)
* urh: 2.9.6 -> 2.9.8

* urh: dont double wrap binary with GApps

Fix for previous pull-request #357400. See https://nixos.org/manual/nixpkgs/stable/#ssec-gnome-common-issues-double-wrapped

* urh: install desktop-file

---------

Co-authored-by: Franz Pletz <fpletz@fnordicwalking.de>
Co-authored-by: Aleksana <alexander.huang.y@gmail.com>
2024-12-05 16:35:56 +08:00

67 lines
1.7 KiB
Nix

{ stdenv, lib, fetchFromGitHub, python3Packages
, hackrf, rtl-sdr, airspy, limesuite, libiio
, libbladeRF
, imagemagick
, makeDesktopItem
, copyDesktopItems
, qt5
, wrapGAppsHook3
, USRPSupport ? false, uhd }:
python3Packages.buildPythonApplication rec {
pname = "urh";
version = "2.9.8";
src = fetchFromGitHub {
owner = "jopohl";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-r3d80dzGwgf5Tuwt1IWGcmNbblwBNKTKKm+GGx1r2HE=";
};
nativeBuildInputs = [ qt5.wrapQtAppsHook wrapGAppsHook3 copyDesktopItems ];
buildInputs = [ hackrf rtl-sdr airspy limesuite libiio libbladeRF ]
++ lib.optional USRPSupport uhd
++ lib.optional stdenv.hostPlatform.isLinux qt5.qtwayland;
propagatedBuildInputs = with python3Packages; [
pyqt5 numpy psutil cython pyzmq pyaudio setuptools
];
# dont double wrap
# https://nixos.org/manual/nixpkgs/stable/#ssec-gnome-common-issues-double-wrapped
dontWrapGApps = true;
dontWrapQtApps = true;
preFixup = ''
makeWrapperArgs+=(
''${gappsWrapperArgs[@]}
''${qtWrapperArgs[@]}
)
'';
doCheck = false;
desktopItems = [
(makeDesktopItem {
name = "urh";
exec = "urh";
icon = "urh";
desktopName = "Universal Radio Hacker";
categories = [ "Network" "HamRadio" ];
comment = meta.description;
})
];
postInstall = ''
install -Dm644 data/icons/appicon.png $out/share/pixmaps/urh.png
'';
meta = with lib; {
homepage = "https://github.com/jopohl/urh";
description = "Universal Radio Hacker: investigate wireless protocols like a boss";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = with maintainers; [ fpletz ];
};
}