linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / tools / misc / yubikey-manager-qt / default.nix
blob02982f9cc4a3d1a13240ac28639a622e4eb6b72a
1 { lib
2 , stdenv
3 , fetchurl
4 , wrapQtAppsHook
5 , pcsclite
6 , pyotherside
7 , pythonPackages
8 , python3
9 , qmake
10 , qtbase
11 , qtgraphicaleffects
12 , qtquickcontrols
13 , qtquickcontrols2
14 , yubikey-manager
15 , yubikey-personalization
18 stdenv.mkDerivation rec {
19   pname = "yubikey-manager-qt";
20   version = "1.1.5";
22   src = fetchurl {
23     url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
24     sha256 = "1yimlaqvhq34gw6wkqgil0qq8x9zbfzh4psqihjr2d9jaa2wygwy";
25   };
27   nativeBuildInputs = [ wrapQtAppsHook python3.pkgs.wrapPython qmake ];
29   postPatch = ''
30     substituteInPlace ykman-gui/deployment.pri --replace '/usr/bin' "$out/bin"
31   '';
33   buildInputs = [ pythonPackages.python qtbase qtgraphicaleffects qtquickcontrols qtquickcontrols2 pyotherside ];
35   pythonPath = [ yubikey-manager ];
37   dontWrapQtApps = true;
38   postInstall = ''
39     buildPythonPath "$pythonPath"
41     wrapQtApp $out/bin/ykman-gui \
42       --prefix LD_LIBRARY_PATH : "${lib.getLib pcsclite}/lib:${yubikey-personalization}/lib" \
43       --prefix PYTHONPATH : "$program_PYTHONPATH"
45     mkdir -p $out/share/applications
46     cp resources/ykman-gui.desktop $out/share/applications/ykman-gui.desktop
47     mkdir -p $out/share/ykman-gui/icons
48     cp resources/icons/*.{icns,ico,png,xpm} $out/share/ykman-gui/icons
49     substituteInPlace $out/share/applications/ykman-gui.desktop \
50       --replace 'Exec=ykman-gui' "Exec=$out/bin/ykman-gui" \
51   '';
53   meta = with lib; {
54     inherit version;
55     description = "Cross-platform application for configuring any YubiKey over all USB interfaces";
56     homepage = "https://developers.yubico.com/yubikey-manager-qt/";
57     license = licenses.bsd2;
58     maintainers = [ maintainers.cbley ];
59     platforms = platforms.linux;
60   };