about summary refs log tree commit diff
path: root/pkgs/applications/misc/yubioath-desktop
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2019-01-17 21:18:09 +0000
committerJörg Thalheim <joerg@thalheim.io>2019-01-17 22:33:13 +0000
commitd43b26f594a86f7ce84ae08f85e1faf06bc94001 (patch)
tree709a84e9de1d2cd20faf3877a98dd4ffe1ce5a03 /pkgs/applications/misc/yubioath-desktop
parent72983e22fab355d395e9293075e86570e9f27bac (diff)
yubioath-desktop: 3.1.0 -> 4.3.4
Diffstat (limited to 'pkgs/applications/misc/yubioath-desktop')
-rw-r--r--pkgs/applications/misc/yubioath-desktop/default.nix70
1 files changed, 42 insertions, 28 deletions
diff --git a/pkgs/applications/misc/yubioath-desktop/default.nix b/pkgs/applications/misc/yubioath-desktop/default.nix
index 8843c821ffb41..03cc9ef818a9a 100644
--- a/pkgs/applications/misc/yubioath-desktop/default.nix
+++ b/pkgs/applications/misc/yubioath-desktop/default.nix
@@ -1,41 +1,55 @@
-{ stdenv, fetchurl,  python27Packages, pcsclite, yubikey-personalization }:
+{ stdenv, fetchurl, fetchFromGitHub
+, qmake, qtbase, qtquickcontrols, qtsvg
+, python3, pyotherside, ncurses
+, pcsclite, yubikey-personalization
+, yubikey-manager, makeWrapper }:
 
-python27Packages.buildPythonApplication rec {
-    namePrefix = "";
-    name = "yubioath-desktop-${version}";
-    version = "3.1.0";
+stdenv.mkDerivation rec {
+  pname = "yubioath-desktop";
+  version = "4.3.4";
 
-    src = fetchurl {
-      url = "https://developers.yubico.com/yubioath-desktop/Releases/yubioath-desktop-${version}.tar.gz";
-      sha256 = "0jfvllgh88g2vwd8sg6willlnn2hq05nd9d3xmv98lhl7gyy1akw";
-    };
+  src = fetchurl {
+    url = "https://developers.yubico.com/yubioath-desktop/Releases/yubioath-desktop-${version}.tar.gz";
+    sha256 = "0hb7j71032sigs8zd5r8yr0m59sjkb24vhs2l4jarpvj8q7hv30d";
+  };
 
-    doCheck = false;
+  doCheck = false;
 
-    buildInputs = [ stdenv ];
+  buildInputs = [ stdenv qtbase qtquickcontrols pyotherside python3 ];
 
-    propagatedBuildInputs = [ python27Packages.pycrypto python27Packages.click python27Packages.pyscard python27Packages.pyside ];
+  nativeBuildInputs = [ qmake makeWrapper python3.pkgs.wrapPython ];
 
-    # Need LD_PRELOAD for libykpers as the Nix cpython disables ctypes.cdll.LoadLibrary
-    # support that the yubicommon library uses to load libykpers
-    makeWrapperArgs = ''--prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib" --prefix LD_PRELOAD : "${yubikey-personalization}/lib/libykpers-1.so"'';
+  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"
 
-    postInstall = ''
       mkdir -p $out/share/applications
-      cp resources/yubioath.desktop $out/share/applications/yubioath.desktop
+      cp resources/yubioath-desktop.desktop \
+        $out/share/applications/yubioath-desktop.desktop
       mkdir -p $out/share/yubioath/icons
-      cp resources/yubioath*.{icns,ico,png,xpm} $out/share/yubioath/icons
-      substituteInPlace $out/share/applications/yubioath.desktop \
-        --replace 'Exec=yubioath-gui' "Exec=$out/bin/yubioath-gui" \
-        --replace 'Icon=yubioath' "Icon=$out/share/yubioath/icons"
-
-    '';
+      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 = {
-      description = "Yubikey Desktop Authenticator";
+  meta = {
+    description = "Yubikey Desktop Authenticator";
 
-      homepage = https://www.yubico.com/support/knowledge-base/categories/articles/yubico-authenticator-download/;
+    homepage = https://www.yubico.com/support/knowledge-base/categories/articles/yubico-authenticator-download/;
 
-      license = stdenv.lib.licenses.gpl3;
-    };
+    license = stdenv.lib.licenses.gpl3;
+  };
 }