2019-02-12 01:21:53 +03:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
2019-02-12 09:17:59 +03:00
|
|
|
, pcsclite
|
2019-02-12 01:21:53 +03:00
|
|
|
, pyotherside
|
|
|
|
, pythonPackages
|
|
|
|
, python3
|
|
|
|
, qmake
|
2019-02-16 00:19:35 +03:00
|
|
|
, qtbase
|
|
|
|
, qtgraphicaleffects
|
|
|
|
, qtquickcontrols
|
|
|
|
, qtquickcontrols2
|
|
|
|
, qtdeclarative
|
|
|
|
, qtsvg
|
2019-02-12 01:21:53 +03:00
|
|
|
, yubikey-manager
|
|
|
|
, yubikey-personalization
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2019-02-16 00:19:35 +03:00
|
|
|
qmlPath = qmlLib: "${qmlLib}/${qtbase.qtQmlPrefix}";
|
|
|
|
|
|
|
|
inherit (stdenv) lib;
|
2019-02-12 01:21:53 +03:00
|
|
|
|
2019-02-12 09:17:59 +03:00
|
|
|
qml2ImportPath = lib.concatMapStringsSep ":" qmlPath [
|
2019-02-16 00:19:35 +03:00
|
|
|
qtbase.bin qtdeclarative.bin pyotherside qtquickcontrols qtquickcontrols2.bin qtgraphicaleffects
|
2019-02-12 01:21:53 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "yubikey-manager-qt";
|
2019-03-13 00:40:29 +03:00
|
|
|
version = "1.1.1";
|
2019-02-12 01:21:53 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-03-13 00:40:29 +03:00
|
|
|
url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "0hcfl0mh4gqy9c8ghmi58asqr8v009n6li0mgcy3r8fyjr7qryvy";
|
2019-02-12 01:21:53 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper python3.pkgs.wrapPython qmake ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ykman-gui/deployment.pri --replace '/usr/bin' "$out/bin"
|
|
|
|
'';
|
|
|
|
|
2019-02-16 00:19:35 +03:00
|
|
|
buildInputs = [ pythonPackages.python qtbase qtgraphicaleffects qtquickcontrols qtquickcontrols2 pyotherside ];
|
2019-02-12 01:21:53 +03:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
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 "$pythonPath"
|
|
|
|
|
|
|
|
wrapProgram $out/bin/ykman-gui \
|
|
|
|
--prefix PYTHONPATH : "$program_PYTHONPATH" \
|
|
|
|
--set QML2_IMPORT_PATH "${qml2ImportPath}" \
|
2019-02-16 00:19:35 +03:00
|
|
|
--set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase.bin}/lib/qt-*/plugins/platforms \
|
|
|
|
--prefix QT_PLUGIN_PATH : "${qtsvg.bin}/${qtbase.qtPluginPrefix}"
|
2019-02-12 01:21:53 +03: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-16 00:19:35 +03:00
|
|
|
meta = with lib; {
|
2019-02-12 01:21:53 +03:00
|
|
|
inherit version;
|
2019-02-12 09:17:59 +03:00
|
|
|
description = "Cross-platform application for configuring any YubiKey over all USB interfaces.";
|
2019-02-12 01:21:53 +03:00
|
|
|
homepage = https://developers.yubico.com/yubikey-manager-qt/;
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = [ maintainers.cbley ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|