evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / sc / scmccid / package.nix
blob73fb6a6dcf6e440761fd640ee1c15422ba8d9c90
1 {lib, stdenv, fetchurl, patchelf, libusb-compat-0_1}:
3 assert stdenv ? cc && stdenv.cc.libc != null;
5 stdenv.mkDerivation rec {
6   pname = "scmccid";
7   version = "5.0.11";
9   src = if stdenv.hostPlatform.system == "i686-linux" then (fetchurl {
10       url = "http://www.scmmicro.com/support/download/scmccid_${version}_linux.tar.gz";
11       sha256 = "1r5wkarhzl09ncgj55baizf573czw0nplh1pgddzx9xck66kh5bm";
12     })
13     else if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl {
14         url = "http://www.scmmicro.com/support/download/scmccid_${version}_linux_x64.tar.gz";
15         sha256 = "0k9lzlk01sl4ycfqgrqqy3bildz0mcr1r0kkicgjz96l4s0jgz0i";
16     })
17     else throw "Architecture not supported";
19   nativeBuildInputs = [ patchelf ];
21   installPhase = ''
22     RPATH=${libusb-compat-0_1.out}/lib:${stdenv.cc.libc.out}/lib
24     for a in proprietary/*/Contents/Linux/*.so*; do
25         if ! test -L $a; then
26             patchelf --set-rpath $RPATH $a
27         fi
28     done
30     mkdir -p $out/pcsc/drivers
31     cp -R proprietary/* $out/pcsc/drivers
32   '';
34   meta = {
35     homepage = "http://www.scmmicro.com/support/pc-security-support/downloads.html";
36     description = "PCSC drivers for linux, for the SCM SCR3310 v2.0 card and others";
37     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
38     license = lib.licenses.unfree;
39     maintainers = [ ];
40     platforms = with lib.platforms; linux;
41   };