nixpkgs/pkgs/applications/misc/yubioath-desktop/default.nix

57 lines
1.9 KiB
Nix
Raw Normal View History

2019-01-17 21:18:09 +00:00
{ stdenv, fetchurl, fetchFromGitHub
, qmake, qtbase, qtquickcontrols, qtsvg
, python3, pyotherside, ncurses
, pcsclite, yubikey-personalization
, yubikey-manager, makeWrapper }:
2019-01-17 21:18:09 +00:00
stdenv.mkDerivation rec {
pname = "yubioath-desktop";
version = "4.3.4";
2019-01-17 21:18:09 +00:00
src = fetchurl {
url = "https://developers.yubico.com/yubioath-desktop/Releases/yubioath-desktop-${version}.tar.gz";
sha256 = "0hb7j71032sigs8zd5r8yr0m59sjkb24vhs2l4jarpvj8q7hv30d";
};
2019-01-17 21:18:09 +00:00
doCheck = false;
2019-01-17 21:18:09 +00:00
buildInputs = [ stdenv qtbase qtquickcontrols pyotherside python3 ];
2019-01-17 21:18:09 +00:00
nativeBuildInputs = [ qmake makeWrapper python3.pkgs.wrapPython ];
2019-01-17 21:18:09 +00:00
postPatch = ''
substituteInPlace deployment.pri \
--replace '/usr/bin' "$out/bin"
'';
pythonPath = [ yubikey-manager ];
# Need LD_PRELOAD for libykpers as the Nix cpython disables ctypes.cdll.LoadLibrary
# support that the yubicommon library uses to load libykpers
postInstall = ''
buildPythonPath "$out $pythonPath"
wrapProgram $out/bin/yubioath-desktop \
--prefix PYTHONPATH : "$program_PYTHONPATH" \
--prefix LD_PRELOAD : "${yubikey-personalization}/lib/libykpers-1.so" \
--prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib"
mkdir -p $out/share/applications
2019-01-17 21:18:09 +00:00
cp resources/yubioath-desktop.desktop \
$out/share/applications/yubioath-desktop.desktop
mkdir -p $out/share/yubioath/icons
2019-01-17 21:18:09 +00:00
cp resources/icons/*.{icns,ico,png,xpm} $out/share/yubioath/icons
substituteInPlace $out/share/applications/yubioath-desktop.desktop \
--replace 'Exec=yubioath-desktop' "Exec=$out/bin/yubioath-desktop" \
'';
meta = with stdenv.lib; {
2019-01-17 21:18:09 +00:00
description = "Yubikey Desktop Authenticator";
2019-01-17 21:18:09 +00:00
homepage = https://www.yubico.com/support/knowledge-base/categories/articles/yubico-authenticator-download/;
2019-01-17 21:18:09 +00:00
license = stdenv.lib.licenses.gpl3;
maintainers = with maintainers; [ mic92 ];
2019-01-17 21:18:09 +00:00
};
}