Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #54215 from Mic92/yubikey

yubioath-desktop: 3.1.0 -> 4.3.4; yubikey-manager: 1.0.1 -> 2.0.0

authored by

Jörg Thalheim and committed by
GitHub
fdfd5ba3 64139656

+93 -36
+43 -28
pkgs/applications/misc/yubioath-desktop/default.nix
··· 1 - { stdenv, fetchurl, python27Packages, pcsclite, yubikey-personalization }: 1 + { stdenv, fetchurl, fetchFromGitHub 2 + , qmake, qtbase, qtquickcontrols, qtsvg 3 + , python3, pyotherside, ncurses 4 + , pcsclite, yubikey-personalization 5 + , yubikey-manager, makeWrapper }: 2 6 3 - python27Packages.buildPythonApplication rec { 4 - namePrefix = ""; 5 - name = "yubioath-desktop-${version}"; 6 - version = "3.1.0"; 7 + stdenv.mkDerivation rec { 8 + pname = "yubioath-desktop"; 9 + version = "4.3.4"; 7 10 8 - src = fetchurl { 9 - url = "https://developers.yubico.com/yubioath-desktop/Releases/yubioath-desktop-${version}.tar.gz"; 10 - sha256 = "0jfvllgh88g2vwd8sg6willlnn2hq05nd9d3xmv98lhl7gyy1akw"; 11 - }; 11 + src = fetchurl { 12 + url = "https://developers.yubico.com/yubioath-desktop/Releases/yubioath-desktop-${version}.tar.gz"; 13 + sha256 = "0hb7j71032sigs8zd5r8yr0m59sjkb24vhs2l4jarpvj8q7hv30d"; 14 + }; 15 + 16 + doCheck = false; 12 17 13 - doCheck = false; 18 + buildInputs = [ stdenv qtbase qtquickcontrols pyotherside python3 ]; 14 19 15 - buildInputs = [ stdenv ]; 20 + nativeBuildInputs = [ qmake makeWrapper python3.pkgs.wrapPython ]; 16 21 17 - propagatedBuildInputs = [ python27Packages.pycrypto python27Packages.click python27Packages.pyscard python27Packages.pyside ]; 22 + postPatch = '' 23 + substituteInPlace deployment.pri \ 24 + --replace '/usr/bin' "$out/bin" 25 + ''; 26 + 27 + pythonPath = [ yubikey-manager ]; 28 + 29 + # Need LD_PRELOAD for libykpers as the Nix cpython disables ctypes.cdll.LoadLibrary 30 + # support that the yubicommon library uses to load libykpers 18 31 19 - # Need LD_PRELOAD for libykpers as the Nix cpython disables ctypes.cdll.LoadLibrary 20 - # support that the yubicommon library uses to load libykpers 21 - makeWrapperArgs = ''--prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib" --prefix LD_PRELOAD : "${yubikey-personalization}/lib/libykpers-1.so"''; 32 + postInstall = '' 33 + buildPythonPath "$out $pythonPath" 34 + wrapProgram $out/bin/yubioath-desktop \ 35 + --prefix PYTHONPATH : "$program_PYTHONPATH" \ 36 + --prefix LD_PRELOAD : "${yubikey-personalization}/lib/libykpers-1.so" \ 37 + --prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib" 22 38 23 - postInstall = '' 24 39 mkdir -p $out/share/applications 25 - cp resources/yubioath.desktop $out/share/applications/yubioath.desktop 40 + cp resources/yubioath-desktop.desktop \ 41 + $out/share/applications/yubioath-desktop.desktop 26 42 mkdir -p $out/share/yubioath/icons 27 - cp resources/yubioath*.{icns,ico,png,xpm} $out/share/yubioath/icons 28 - substituteInPlace $out/share/applications/yubioath.desktop \ 29 - --replace 'Exec=yubioath-gui' "Exec=$out/bin/yubioath-gui" \ 30 - --replace 'Icon=yubioath' "Icon=$out/share/yubioath/icons" 43 + cp resources/icons/*.{icns,ico,png,xpm} $out/share/yubioath/icons 44 + substituteInPlace $out/share/applications/yubioath-desktop.desktop \ 45 + --replace 'Exec=yubioath-desktop' "Exec=$out/bin/yubioath-desktop" \ 46 + ''; 31 47 32 - ''; 48 + meta = with stdenv.lib; { 49 + description = "Yubikey Desktop Authenticator"; 33 50 34 - meta = { 35 - description = "Yubikey Desktop Authenticator"; 51 + homepage = https://www.yubico.com/support/knowledge-base/categories/articles/yubico-authenticator-download/; 36 52 37 - homepage = https://www.yubico.com/support/knowledge-base/categories/articles/yubico-authenticator-download/; 38 - 39 - license = stdenv.lib.licenses.gpl3; 40 - }; 53 + license = stdenv.lib.licenses.gpl3; 54 + maintainers = with maintainers; [ mic92 ]; 55 + }; 41 56 }
+29
pkgs/development/libraries/pyotherside/default.nix
··· 1 + { stdenv, fetchFromGitHub 2 + , python3, qmake, qtbase, qtquickcontrols, qtsvg, ncurses }: 3 + 4 + stdenv.mkDerivation rec { 5 + pname = "pyotherside"; 6 + version = "1.5.3"; 7 + 8 + src = fetchFromGitHub { 9 + owner = "thp"; 10 + repo = "pyotherside"; 11 + rev = version; 12 + sha256 = "1xaw1aarj8gpgpm4z3lk8klbssadrsf3xdyzqx10zcwy16amka7k"; 13 + }; 14 + 15 + nativeBuildInputs = [ qmake ]; 16 + buildInputs = [ 17 + python3 qtbase qtquickcontrols qtsvg ncurses 18 + ]; 19 + 20 + patches = [ ./qml-path.patch ]; 21 + installTargets = [ "sub-src-install_subtargets" ]; 22 + 23 + meta = with stdenv.lib; { 24 + description = "Asynchronous Python 3 Bindings for Qt 5"; 25 + homepage = https://thp.io/2011/pyotherside/; 26 + license = licenses.isc; 27 + maintainers = [ maintainers.mic92 ]; 28 + }; 29 + }
+12
pkgs/development/libraries/pyotherside/qml-path.patch
··· 1 + diff -Naur --strip-trailing-cr source.org/src/src.pro source/src/src.pro 2 + --- source.org/src/src.pro 1970-01-01 01:00:01.000000000 +0100 3 + +++ source/src/src.pro 2019-01-17 19:14:46.256821852 +0000 4 + @@ -10,7 +10,7 @@ 5 + CONFIG += qt plugin 6 + QT += qml quick svg 7 + 8 + -target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH 9 + +target.path = $$NIX_OUTPUT_QML/$$PLUGIN_IMPORT_PATH 10 + INSTALLS += target 11 + 12 + qmldir.files += $$_PRO_FILE_PWD_/qmldir $$_PRO_FILE_PWD_/pyotherside.qmltypes
+6 -7
pkgs/tools/misc/yubikey-manager/default.nix
··· 1 - { pythonPackages, fetchurl, lib, 1 + { python3Packages, fetchurl, lib, 2 2 yubikey-personalization, libu2f-host, libusb1 }: 3 3 4 - pythonPackages.buildPythonPackage rec { 5 - name = "yubikey-manager-1.0.1"; 4 + python3Packages.buildPythonPackage rec { 5 + name = "yubikey-manager-2.0.0"; 6 6 7 7 srcs = fetchurl { 8 8 url = "https://developers.yubico.com/yubikey-manager/Releases/${name}.tar.gz"; 9 - sha256 = "0i7w1f89hqlw7g800fjhbb6yvq9wjmj5d7w7p6v8bkyvk645v48z"; 9 + sha256 = "1x36pyg9g3by2pa11j6d73d79sdlb7qy98lwwn05f43fjm74qnz9"; 10 10 }; 11 11 12 12 propagatedBuildInputs = 13 - with pythonPackages; 14 - lib.optional (!pythonPackages.pythonAtLeast "3.4") enum34 ++ [ 13 + with python3Packages; [ 15 14 click 16 15 cryptography 17 16 pyscard ··· 44 43 45 44 license = licenses.bsd2; 46 45 platforms = platforms.unix; 47 - maintainers = with maintainers; [ benley ]; 46 + maintainers = with maintainers; [ benley mic92 ]; 48 47 }; 49 48 }
+3 -1
pkgs/top-level/all-packages.nix
··· 12096 12096 qtxmlpatterns = qt59.qtxmlpatterns; 12097 12097 }; 12098 12098 12099 + pyotherside = libsForQt5.callPackage ../development/libraries/pyotherside {}; 12100 + 12099 12101 re2 = callPackage ../development/libraries/re2 { }; 12100 12102 12101 12103 qbs = libsForQt5.callPackage ../development/tools/build-managers/qbs { }; ··· 13115 13117 13116 13118 yojimbo = callPackage ../development/libraries/yojimbo { }; 13117 13119 13118 - yubioath-desktop = callPackage ../applications/misc/yubioath-desktop { }; 13120 + yubioath-desktop = libsForQt5.callPackage ../applications/misc/yubioath-desktop { }; 13119 13121 13120 13122 yubico-piv-tool = callPackage ../tools/misc/yubico-piv-tool { }; 13121 13123