1 { lib, stdenv, fetchurl, unzip, libusb-compat-0_1 }:
4 arch = if stdenv.hostPlatform.system == "i686-linux" then "32"
5 else if stdenv.hostPlatform.system == "x86_64-linux" then "64"
6 else throw "Unsupported system: ${stdenv.hostPlatform.system}";
8 stdenv.mkDerivation rec {
9 pname = "pcsc-scm-scl";
13 url = "http://files.identiv.com/products/smart-card-readers/contactless/scl010-011/Linux_Driver_Ver${version}.zip";
14 sha256 = "0ik26sxgqgsqplksl87z61vwmx51k7plaqmrkdid7xidgfhfxr42";
17 nativeBuildInputs = [ unzip ];
21 tar xf "Linux Driver Ver${version}/sclgeneric_${version}_linux_${arch}bit.tar.gz"
22 export sourceRoot=$(readlink -e sclgeneric_${version}_linux_${arch}bit)
25 # Add support for SCL011 nPA (subsidized model for German eID)
26 patches = [ ./eid.patch ];
29 mkdir -p $out/pcsc/drivers
30 cp -r proprietary/*.bundle $out/pcsc/drivers
33 libPath = lib.makeLibraryPath [ libusb-compat-0_1 ];
36 patchelf --set-rpath $libPath \
37 $out/pcsc/drivers/SCLGENERIC.bundle/Contents/Linux/libSCLGENERIC.so.${version};
41 description = "SCM Microsystems SCL011 chipcard reader user space driver";
42 homepage = "https://www.scm-pc-card.de/index.php?lang=en&page=product&function=show_product&product_id=630";
43 downloadPage = "https://support.identiv.com/scl010-scl011/";
44 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
45 license = licenses.unfreeRedistributable;
46 maintainers = with maintainers; [ sephalon ];
47 platforms = platforms.linux;