From 33eb77bad1fca64818f060b136abf212ac6290dd Mon Sep 17 00:00:00 2001 From: sephalon Date: Mon, 9 Apr 2018 06:01:55 +0200 Subject: [PATCH] pcsc-scm-scl011: init at 2.09 (#37732) --- maintainers/maintainer-list.nix | 5 ++ .../security/pcsc-scm-scl011/default.nix | 49 +++++++++++++++++++ pkgs/tools/security/pcsc-scm-scl011/eid.patch | 28 +++++++++++ pkgs/top-level/all-packages.nix | 2 + 4 files changed, 84 insertions(+) create mode 100644 pkgs/tools/security/pcsc-scm-scl011/default.nix create mode 100644 pkgs/tools/security/pcsc-scm-scl011/eid.patch diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 92711db659e..66a47333aa0 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3273,6 +3273,11 @@ github = "sengaya"; name = "Thilo Uttendorfer"; }; + sephalon = { + email = "me@sephalon.net"; + github = "sephalon"; + name = "Stefan Wiehler"; + }; sepi = { email = "raffael@mancini.lu"; github = "sepi"; diff --git a/pkgs/tools/security/pcsc-scm-scl011/default.nix b/pkgs/tools/security/pcsc-scm-scl011/default.nix new file mode 100644 index 00000000000..88b5c147f30 --- /dev/null +++ b/pkgs/tools/security/pcsc-scm-scl011/default.nix @@ -0,0 +1,49 @@ +{ stdenv, fetchurl, unzip, libusb }: + +let + arch = if stdenv.system == "i686-linux" then "32" + else if stdenv.system == "x86_64-linux" then "64" + else throw "Unsupported system: ${stdenv.system}"; +in +stdenv.mkDerivation rec { + name = "pcsc-scm-scl-${version}"; + version = "2.09"; + + src = fetchurl { + url = "http://files.identiv.com/products/smart-card-readers/contactless/scl010-011/Linux_Driver_Ver${version}.zip"; + sha256 = "0ik26sxgqgsqplksl87z61vwmx51k7plaqmrkdid7xidgfhfxr42"; + }; + + buildInputs = [ unzip ]; + + unpackPhase = '' + echo ${stdenv.system} + unzip $src + tar xf "Linux Driver Ver${version}/sclgeneric_${version}_linux_${arch}bit.tar.gz" + cd sclgeneric_${version}_linux_${arch}bit; export sourceRoot=`pwd` + ''; + + # Add support for SCL011 nPA (subsidized model for German eID) + patches = [ ./eid.patch ]; + + installPhase = '' + mkdir -p $out/pcsc/drivers + cp -r proprietary/*.bundle $out/pcsc/drivers + ''; + + libPath = stdenv.lib.makeLibraryPath [ libusb ]; + + fixupPhase = '' + patchelf --set-rpath $libPath \ + $out/pcsc/drivers/SCLGENERIC.bundle/Contents/Linux/libSCLGENERIC.so.${version}; + ''; + + meta = with stdenv.lib; { + description = "SCM Microsystems SCL011 chipcard reader user space driver"; + homepage = http://www.scm-pc-card.de/index.php?lang=en&page=product&function=show_product&product_id=630; + downloadPage = https://support.identiv.com/scl010-scl011/; + license = licenses.unfreeRedistributable; + maintainers = with maintainers; [ sephalon ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/tools/security/pcsc-scm-scl011/eid.patch b/pkgs/tools/security/pcsc-scm-scl011/eid.patch new file mode 100644 index 00000000000..6e7ffd60f72 --- /dev/null +++ b/pkgs/tools/security/pcsc-scm-scl011/eid.patch @@ -0,0 +1,28 @@ +diff --git a/proprietary/SCLGENERIC.bundle/Contents/Info.plist b/proprietary/SCLGENERIC.bundle/Contents/Info.plist +index 412d6b9..5d1c6cc 100755 +--- a/proprietary/SCLGENERIC.bundle/Contents/Info.plist ++++ b/proprietary/SCLGENERIC.bundle/Contents/Info.plist +@@ -34,6 +34,7 @@ + 0x04E6 + 0x04E6 + 0x04E6 ++ 0x04E6 + + + ifdProductID +@@ -42,6 +43,7 @@ + 0x5291 + 0x5290 + 0x5293 ++ 0x5292 + + + ifdFriendlyName +@@ -50,6 +52,7 @@ + SCL010 Contactless Reader + SCR331CL-NTTCom + SCL011G Contactless Reader ++ SCM Microsystems, Inc. SCL011 RFID reader + + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index df78238f17a..ff115fdf057 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4240,6 +4240,8 @@ with pkgs; pcsc-cyberjack = callPackage ../tools/security/pcsc-cyberjack { }; + pcsc-scm-scl011 = callPackage ../tools/security/pcsc-scm-scl011 { }; + pdd = python3Packages.callPackage ../tools/misc/pdd { }; pdf2djvu = callPackage ../tools/typesetting/pdf2djvu { };