3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/yubikey-manager-qt/default.nix

67 lines
1.8 KiB
Nix
Raw Normal View History

2019-02-11 22:21:53 +00:00
{ stdenv
, fetchurl
, wrapQtAppsHook
, pcsclite
2019-02-11 22:21:53 +00:00
, pyotherside
, pythonPackages
, python3
, qmake
, qtbase
, qtgraphicaleffects
, qtquickcontrols
, qtquickcontrols2
, qtdeclarative
, qtsvg
2019-02-11 22:21:53 +00:00
, yubikey-manager
, yubikey-personalization
}:
let inherit (stdenv) lib; in
stdenv.mkDerivation rec {
2019-02-11 22:21:53 +00:00
pname = "yubikey-manager-qt";
2019-08-20 15:03:35 +01:00
version = "1.1.3";
2019-02-11 22:21:53 +00:00
src = fetchurl {
url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
2019-08-20 15:03:35 +01:00
sha256 = "087ms9i0n3rm8a0hvc4a2dk3rffbm6rmgz0m8gbjk6g37iml6nb7";
2019-02-11 22:21:53 +00:00
};
nativeBuildInputs = [ wrapQtAppsHook python3.pkgs.wrapPython qmake ];
2019-02-11 22:21:53 +00:00
postPatch = ''
substituteInPlace ykman-gui/deployment.pri --replace '/usr/bin' "$out/bin"
'';
buildInputs = [ pythonPackages.python qtbase qtgraphicaleffects qtquickcontrols qtquickcontrols2 pyotherside ];
2019-02-11 22:21:53 +00:00
enableParallelBuilding = true;
pythonPath = [ yubikey-manager ];
dontWrapQtApps = true;
2019-02-11 22:21:53 +00:00
postInstall = ''
buildPythonPath "$pythonPath"
wrapQtApp $out/bin/ykman-gui \
--prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib" \
--prefix PYTHONPATH : "$program_PYTHONPATH"
2019-02-11 22:21:53 +00:00
mkdir -p $out/share/applications
cp resources/ykman-gui.desktop $out/share/applications/ykman-gui.desktop
mkdir -p $out/share/ykman-gui/icons
cp resources/icons/*.{icns,ico,png,xpm} $out/share/ykman-gui/icons
substituteInPlace $out/share/applications/ykman-gui.desktop \
--replace 'Exec=ykman-gui' "Exec=$out/bin/ykman-gui" \
2019-02-11 22:21:53 +00:00
'';
meta = with lib; {
2019-02-11 22:21:53 +00:00
inherit version;
description = "Cross-platform application for configuring any YubiKey over all USB interfaces.";
2019-02-11 22:21:53 +00:00
homepage = https://developers.yubico.com/yubikey-manager-qt/;
license = licenses.bsd2;
maintainers = [ maintainers.cbley ];
platforms = platforms.linux;
};
}