yubikey-manager: 3.1 -> 4.0

Also, support Darwin properly
This commit is contained in:
Dan Peebles 2017-09-09 23:07:14 -04:00
parent 6a17c5a46c
commit 15502421c7
3 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, buildPythonPackage, swig, pcsclite }:
{ stdenv, fetchurl, buildPythonPackage, swig, pcsclite, PCSC }:
buildPythonPackage rec {
version = "1.9.6";
@ -18,7 +18,7 @@ buildPythonPackage rec {
NIX_CFLAGS_COMPILE = "-isystem ${pcsclite}/include/PCSC/";
propagatedBuildInputs = [ pcsclite ];
buildInputs = [ swig ];
buildInputs = [ swig ] ++ stdenv.lib.optional stdenv.isDarwin PCSC;
meta = {
homepage = https://pyscard.sourceforge.io/;

View File

@ -2,11 +2,11 @@
yubikey-personalization, libu2f-host, libusb1 }:
pythonPackages.buildPythonPackage rec {
name = "yubikey-manager-0.3.1";
name = "yubikey-manager-0.4.0";
srcs = fetchurl {
url = "https://developers.yubico.com/yubikey-manager/Releases/${name}.tar.gz";
sha256 = "0vrhaqb8yc1qjq25k9dv8gmqxhbf6aa047i6dvz1lcraq6zwnq6g";
sha256 = "0dc0mqg8r6kjh0s2rmrggfxbx9imslajjrj80rffcvg64a2vgsgb";
};
propagatedBuildInputs =
@ -16,6 +16,7 @@ pythonPackages.buildPythonPackage rec {
cryptography
pyscard
pyusb
pyopenssl
six
] ++ [
libu2f-host
@ -32,6 +33,9 @@ pythonPackages.buildPythonPackage rec {
_YKMAN_COMPLETE=source $out/bin/ykman > $out/etc/bash_completion.d/ykman.sh ||true
'';
# See https://github.com/NixOS/nixpkgs/issues/29169
doCheck = false;
meta = with lib; {
homepage = https://developers.yubico.com/yubikey-manager;
description = "Command line tool for configuring any YubiKey over all USB transports.";

View File

@ -259,7 +259,7 @@ in {
pythonPackages = self;
};
pyscard = callPackage ../development/python-modules/pyscard { };
pyscard = callPackage ../development/python-modules/pyscard { inherit (pkgs.darwin.apple_sdk.frameworks) PCSC; };
pyside = callPackage ../development/python-modules/pyside { };
@ -24234,11 +24234,15 @@ EOF
};
# Fix the USB backend library lookup
postPatch = ''
libusb=${pkgs.libusb1.out}/lib/libusb-1.0.so
test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py
'';
postPatch =
let
# This should really be in the stdenv somewhere
soext = if stdenv.isLinux then "so" else if stdenv.isDarwin then "dylib" else throw "Unsupported platform";
in ''
libusb=${pkgs.libusb1.out}/lib/libusb-1.0.${soext}
test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py
'';
propagatedBuildInputs = [ pkgs.libusb ];