at 17.09-beta 40 lines 1.3 kB view raw
1{stdenv, fetchurl, patchelf, libusb}: 2 3assert stdenv ? cc && stdenv.cc.libc != null; 4 5stdenv.mkDerivation rec { 6 name = "scmccid-5.0.11"; 7 8 src = if stdenv.system == "i686-linux" then (fetchurl { 9 url = "http://www.scmmicro.com/support/download/scmccid_5.0.11_linux.tar.gz"; 10 sha256 = "1r5wkarhzl09ncgj55baizf573czw0nplh1pgddzx9xck66kh5bm"; 11 }) 12 else if stdenv.system == "x86_64-linux" then (fetchurl { 13 url = "http://www.scmmicro.com/support/download/scmccid_5.0.11_linux_x64.tar.gz"; 14 sha256 = "0k9lzlk01sl4ycfqgrqqy3bildz0mcr1r0kkicgjz96l4s0jgz0i"; 15 }) 16 else throw "Architecture not supported"; 17 18 buildInputs = [ patchelf ]; 19 20 installPhase = '' 21 RPATH=${libusb.out}/lib:${stdenv.cc.libc.out}/lib 22 23 for a in proprietary/*/Contents/Linux/*.so*; do 24 if ! test -L $a; then 25 patchelf --set-rpath $RPATH $a 26 fi 27 done 28 29 mkdir -p $out/pcsc/drivers 30 cp -R proprietary/* $out/pcsc/drivers 31 ''; 32 33 meta = { 34 homepage = http://www.scmmicro.com/support/pc-security-support/downloads.html; 35 description = "PCSC drivers for linux, for the SCM SCR3310 v2.0 card and others"; 36 license = stdenv.lib.licenses.unfree; 37 maintainers = with stdenv.lib.maintainers; [viric]; 38 platforms = with stdenv.lib.platforms; linux; 39 }; 40}