2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, mkDerivation
|
|
|
|
, qmake
|
|
|
|
, qtbase
|
|
|
|
, qtquickcontrols2
|
|
|
|
, qtgraphicaleffects
|
|
|
|
, qtmultimedia
|
|
|
|
, python3
|
|
|
|
, pyotherside
|
|
|
|
, pcsclite
|
|
|
|
, yubikey-personalization
|
|
|
|
, yubikey-manager
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "yubioath-desktop";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "5.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://developers.yubico.com/yubioath-desktop/Releases/yubioath-desktop-${version}.tar.gz";
|
2022-05-18 14:49:53 +00:00
|
|
|
hash = "sha256-Lm9F4eaG9T5brAV7XDAkoj0WClmXEYIhuUzh2rk0oc0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
buildInputs = [ qtbase qtquickcontrols2 qtgraphicaleffects qtmultimedia python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ qmake makeWrapper python3.pkgs.wrapPython ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-05-18 14:49:53 +00:00
|
|
|
substituteInPlace QZXing/QZXing-components.pri \
|
|
|
|
--replace 'target.path = $$PREFIX/lib' 'target.path = $$PREFIX/bin'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 QML2_IMPORT_PATH : "${pyotherside}/${qtbase.qtQmlPrefix}" \
|
|
|
|
--prefix LD_PRELOAD : "${yubikey-personalization}/lib/libykpers-1.so" \
|
2021-01-15 22:18:51 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.getLib pcsclite}/lib:${yubikey-personalization}/lib"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/applications
|
2020-05-15 21:57:56 +00:00
|
|
|
cp resources/com.yubico.yubioath.desktop \
|
|
|
|
$out/share/applications/com.yubico.yubioath.desktop
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/share/yubioath/icons
|
2020-05-15 21:57:56 +00:00
|
|
|
cp resources/icons/*.{icns,ico,png,svg} $out/share/yubioath/icons
|
|
|
|
substituteInPlace $out/share/applications/com.yubico.yubioath.desktop \
|
2020-04-24 23:36:52 +00:00
|
|
|
--replace 'Exec=yubioath-desktop' "Exec=$out/bin/yubioath-desktop" \
|
2021-04-17 00:35:05 +00:00
|
|
|
--replace 'Icon=com.yubico.yubioath' "Icon=$out/share/yubioath/icons/com.yubico.yubioath.png"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Yubico Authenticator";
|
|
|
|
longDescription = ''
|
|
|
|
Application for generating Open Authentication (OATH) time-based TOTP and
|
|
|
|
event-based HOTP one-time password codes, with the help of a YubiKey that
|
|
|
|
protects the shared secrets.
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = "https://developers.yubico.com/yubioath-desktop";
|
|
|
|
downloadPage = "https://developers.yubico.com/yubioath-desktop/Releases/";
|
|
|
|
changelog = "https://developers.yubico.com/yubioath-desktop/Release_Notes.html";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.bsd2;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ mic92 risson ];
|
|
|
|
};
|
|
|
|
}
|