From d3e3346530570dce9eb7d647aa4c49a3fdd136e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 17 Jan 2019 21:15:18 +0000 Subject: [PATCH 1/5] pyotherside: init at 1.5.3 --- .../libraries/pyotherside/default.nix | 29 +++++++++++++++++++ .../libraries/pyotherside/qml-path.patch | 12 ++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 43 insertions(+) create mode 100644 pkgs/development/libraries/pyotherside/default.nix create mode 100644 pkgs/development/libraries/pyotherside/qml-path.patch diff --git a/pkgs/development/libraries/pyotherside/default.nix b/pkgs/development/libraries/pyotherside/default.nix new file mode 100644 index 00000000000..0c2d4fa2b28 --- /dev/null +++ b/pkgs/development/libraries/pyotherside/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub +, python3, qmake, qtbase, qtquickcontrols, qtsvg, ncurses }: + +stdenv.mkDerivation rec { + pname = "pyotherside"; + version = "1.5.3"; + + src = fetchFromGitHub { + owner = "thp"; + repo = "pyotherside"; + rev = version; + sha256 = "1xaw1aarj8gpgpm4z3lk8klbssadrsf3xdyzqx10zcwy16amka7k"; + }; + + nativeBuildInputs = [ qmake ]; + buildInputs = [ + python3 qtbase qtquickcontrols qtsvg ncurses + ]; + + patches = [ ./qml-path.patch ]; + installTargets = [ "sub-src-install_subtargets" ]; + + meta = with stdenv.lib; { + description = "Asynchronous Python 3 Bindings for Qt 5"; + homepage = https://thp.io/2011/pyotherside/; + license = licenses.isc; + maintainers = [ maintainers.mic92 ]; + }; +} diff --git a/pkgs/development/libraries/pyotherside/qml-path.patch b/pkgs/development/libraries/pyotherside/qml-path.patch new file mode 100644 index 00000000000..9f720890997 --- /dev/null +++ b/pkgs/development/libraries/pyotherside/qml-path.patch @@ -0,0 +1,12 @@ +diff -Naur --strip-trailing-cr source.org/src/src.pro source/src/src.pro +--- source.org/src/src.pro 1970-01-01 01:00:01.000000000 +0100 ++++ source/src/src.pro 2019-01-17 19:14:46.256821852 +0000 +@@ -10,7 +10,7 @@ + CONFIG += qt plugin + QT += qml quick svg + +-target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH ++target.path = $$NIX_OUTPUT_QML/$$PLUGIN_IMPORT_PATH + INSTALLS += target + + qmldir.files += $$_PRO_FILE_PWD_/qmldir $$_PRO_FILE_PWD_/pyotherside.qmltypes diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 50f06c19088..08220edb6d8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12118,6 +12118,8 @@ in qtxmlpatterns = qt59.qtxmlpatterns; }; + pyotherside = libsForQt5.callPackage ../development/libraries/pyotherside {}; + re2 = callPackage ../development/libraries/re2 { }; qbs = libsForQt5.callPackage ../development/tools/build-managers/qbs { }; From 72983e22fab355d395e9293075e86570e9f27bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 17 Jan 2019 21:17:12 +0000 Subject: [PATCH 2/5] yubikey-manager: 1.0.1 -> 2.0.0 --- pkgs/tools/misc/yubikey-manager/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/misc/yubikey-manager/default.nix b/pkgs/tools/misc/yubikey-manager/default.nix index e80eee2db3a..8bccb982b54 100644 --- a/pkgs/tools/misc/yubikey-manager/default.nix +++ b/pkgs/tools/misc/yubikey-manager/default.nix @@ -1,17 +1,16 @@ -{ pythonPackages, fetchurl, lib, +{ python3Packages, fetchurl, lib, yubikey-personalization, libu2f-host, libusb1 }: -pythonPackages.buildPythonPackage rec { - name = "yubikey-manager-1.0.1"; +python3Packages.buildPythonPackage rec { + name = "yubikey-manager-2.0.0"; srcs = fetchurl { url = "https://developers.yubico.com/yubikey-manager/Releases/${name}.tar.gz"; - sha256 = "0i7w1f89hqlw7g800fjhbb6yvq9wjmj5d7w7p6v8bkyvk645v48z"; + sha256 = "1x36pyg9g3by2pa11j6d73d79sdlb7qy98lwwn05f43fjm74qnz9"; }; propagatedBuildInputs = - with pythonPackages; - lib.optional (!pythonPackages.pythonAtLeast "3.4") enum34 ++ [ + with python3Packages; [ click cryptography pyscard From d43b26f594a86f7ce84ae08f85e1faf06bc94001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 17 Jan 2019 21:18:09 +0000 Subject: [PATCH 3/5] yubioath-desktop: 3.1.0 -> 4.3.4 --- .../misc/yubioath-desktop/default.nix | 70 +++++++++++-------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/pkgs/applications/misc/yubioath-desktop/default.nix b/pkgs/applications/misc/yubioath-desktop/default.nix index 8843c821ffb..03cc9ef818a 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; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 08220edb6d8..ec2b89a24e4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13137,7 +13137,7 @@ in yojimbo = callPackage ../development/libraries/yojimbo { }; - yubioath-desktop = callPackage ../applications/misc/yubioath-desktop { }; + yubioath-desktop = libsForQt5.callPackage ../applications/misc/yubioath-desktop { }; yubico-piv-tool = callPackage ../tools/misc/yubico-piv-tool { }; From 5aa12178deea7195bb36fea10b59d0361ddadb05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 17 Jan 2019 21:19:43 +0000 Subject: [PATCH 4/5] yubikey-manager: add myself as maintainer --- pkgs/tools/misc/yubikey-manager/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/misc/yubikey-manager/default.nix b/pkgs/tools/misc/yubikey-manager/default.nix index 8bccb982b54..df07c291e26 100644 --- a/pkgs/tools/misc/yubikey-manager/default.nix +++ b/pkgs/tools/misc/yubikey-manager/default.nix @@ -43,6 +43,6 @@ python3Packages.buildPythonPackage rec { license = licenses.bsd2; platforms = platforms.unix; - maintainers = with maintainers; [ benley ]; + maintainers = with maintainers; [ benley mic92 ]; }; } From 3c2d5eba5f76de902a75234b97fb646399f7657c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 17 Jan 2019 21:20:51 +0000 Subject: [PATCH 5/5] yubioath-desktop: add myself as maintainer --- pkgs/applications/misc/yubioath-desktop/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/yubioath-desktop/default.nix b/pkgs/applications/misc/yubioath-desktop/default.nix index 03cc9ef818a..d1fa28318d0 100644 --- a/pkgs/applications/misc/yubioath-desktop/default.nix +++ b/pkgs/applications/misc/yubioath-desktop/default.nix @@ -45,11 +45,12 @@ stdenv.mkDerivation rec { --replace 'Exec=yubioath-desktop' "Exec=$out/bin/yubioath-desktop" \ ''; - meta = { + meta = with stdenv.lib; { description = "Yubikey Desktop Authenticator"; homepage = https://www.yubico.com/support/knowledge-base/categories/articles/yubico-authenticator-download/; license = stdenv.lib.licenses.gpl3; + maintainers = with maintainers; [ mic92 ]; }; }