yubikey-manager-qt: init at 1.1.0

This commit is contained in:
Claudio Bley 2019-02-11 23:21:53 +01:00
parent ad30ed66ae
commit 4128782464
2 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,81 @@
{ stdenv
, fetchurl
, makeWrapper
, pyotherside
, pythonPackages
, python3
, qmake
, qt5
, yubikey-manager
, yubikey-personalization
}:
with import <nixpkgs> {};
let
qmlPath = qmlLib: "${qmlLib}/${qt5.qtbase.qtQmlPrefix}";
qml2ImportPath = lib.concatMapStringsSep ";" qmlPath [
qt5.qtbase.bin qt5.qtdeclarative.bin pyotherside qt5.qtquickcontrols qt5.qtquickcontrols2.bin qt5.qtgraphicaleffects
];
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "yubikey-manager-qt";
version = "1.1.0";
src = fetchurl {
url = "https://developers.yubico.com/yubikey-manager-qt/Releases/yubikey-manager-qt-${version}.tar.gz";
sha256 = "8049a233a8cca07543d745a9f619c0fc3afb324f5d0030b93f037b34ac1c5e66";
};
nativeBuildInputs = [ makeWrapper python3.pkgs.wrapPython qmake ];
sourceRoot = ".";
postPatch = ''
substituteInPlace ykman-gui/deployment.pri --replace '/usr/bin' "$out/bin"
'';
buildInputs = [ pythonPackages.python stdenv qt5.qtbase qt5.qtgraphicaleffects qt5.qtquickcontrols qt5.qtquickcontrols2 pyotherside ];
buildPhase = ''
qmake
make
'';
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" \
--prefix LD_PRELOAD : "${yubikey-personalization}/lib/libykpers-1.so" \
--prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib" \
--set QML2_IMPORT_PATH "${qml2ImportPath}" \
--set QT_QPA_PLATFORM_PLUGIN_PATH ${qt5.qtbase.bin}/lib/qt-*/plugins/platforms \
--prefix QT_PLUGIN_PATH : "${qt5.qtsvg.bin}/${qt5.qtbase.qtPluginPrefix}"
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" \
'';
meta = with stdenv.lib; {
inherit version;
description = ''Cross-platform application for configuring any YubiKey over all USB interfaces.'';
homepage = https://developers.yubico.com/yubikey-manager-qt/;
license = licenses.bsd2;
maintainers = [ maintainers.cbley ];
platforms = platforms.linux;
homepage = "https://github.com/Yubico";
};
}

View file

@ -13099,6 +13099,10 @@ in
yubikey-manager = callPackage ../tools/misc/yubikey-manager { };
yubikey-manager-qt = libsForQt5.callPackage ../tools/misc/yubikey-manager-qt {
pythonPackages = python3Packages;
};
yubikey-neo-manager = callPackage ../tools/misc/yubikey-neo-manager { };
yubikey-personalization = callPackage ../tools/misc/yubikey-personalization {