2019-06-16 21:59:06 +02:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, qmake, qtbase, qtquickcontrols
|
|
|
|
, python3, pyotherside
|
2019-01-17 22:18:09 +01:00
|
|
|
, pcsclite, yubikey-personalization
|
|
|
|
, yubikey-manager, makeWrapper }:
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-01-17 22:18:09 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "yubioath-desktop";
|
2019-05-30 01:49:34 +02:00
|
|
|
version = "4.3.6";
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-01-17 22:18:09 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://developers.yubico.com/yubioath-desktop/Releases/yubioath-desktop-${version}.tar.gz";
|
2019-05-30 01:49:34 +02:00
|
|
|
sha256 = "0s04anjbb5zm98kfdpp9hr68k3mx3gqlp8fa1miy7nq87pr4f7a5";
|
2019-01-17 22:18:09 +01:00
|
|
|
};
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-01-17 22:18:09 +01:00
|
|
|
doCheck = false;
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-03-09 15:29:56 +01:00
|
|
|
buildInputs = [ stdenv qtbase qtquickcontrols python3 ];
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-01-17 22:18:09 +01:00
|
|
|
nativeBuildInputs = [ qmake makeWrapper python3.pkgs.wrapPython ];
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-01-17 22:18:09 +01: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" \
|
2019-03-09 15:29:56 +01:00
|
|
|
--prefix QML2_IMPORT_PATH : "${pyotherside}/${qtbase.qtQmlPrefix}" \
|
2019-01-17 22:18:09 +01:00
|
|
|
--prefix LD_PRELOAD : "${yubikey-personalization}/lib/libykpers-1.so" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib"
|
2017-01-17 02:18:27 +01:00
|
|
|
|
|
|
|
mkdir -p $out/share/applications
|
2019-01-17 22:18:09 +01:00
|
|
|
cp resources/yubioath-desktop.desktop \
|
|
|
|
$out/share/applications/yubioath-desktop.desktop
|
2017-01-17 02:18:27 +01:00
|
|
|
mkdir -p $out/share/yubioath/icons
|
2019-01-17 22:18:09 +01: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" \
|
|
|
|
'';
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-01-17 22:20:51 +01:00
|
|
|
meta = with stdenv.lib; {
|
2019-01-17 22:18:09 +01:00
|
|
|
description = "Yubikey Desktop Authenticator";
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-01-17 22:18:09 +01:00
|
|
|
homepage = https://www.yubico.com/support/knowledge-base/categories/articles/yubico-authenticator-download/;
|
2017-01-17 02:18:27 +01:00
|
|
|
|
2019-01-17 22:18:09 +01:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2019-01-17 22:20:51 +01:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2019-01-17 22:18:09 +01:00
|
|
|
};
|
2017-01-17 02:18:27 +01:00
|
|
|
}
|