2021-02-05 17:12:51 +00:00
|
|
|
{lib, stdenv, fetchurl, patchelf, libusb-compat-0_1}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
assert stdenv ? cc && stdenv.cc.libc != null;
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "scmccid";
|
|
|
|
version = "5.0.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = if stdenv.hostPlatform.system == "i686-linux" then (fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "http://www.scmmicro.com/support/download/scmccid_${version}_linux.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1r5wkarhzl09ncgj55baizf573czw0nplh1pgddzx9xck66kh5bm";
|
|
|
|
})
|
|
|
|
else if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "http://www.scmmicro.com/support/download/scmccid_${version}_linux_x64.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0k9lzlk01sl4ycfqgrqqy3bildz0mcr1r0kkicgjz96l4s0jgz0i";
|
|
|
|
})
|
|
|
|
else throw "Architecture not supported";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ patchelf ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2020-05-03 17:38:23 +00:00
|
|
|
RPATH=${libusb-compat-0_1.out}/lib:${stdenv.cc.libc.out}/lib
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
for a in proprietary/*/Contents/Linux/*.so*; do
|
|
|
|
if ! test -L $a; then
|
|
|
|
patchelf --set-rpath $RPATH $a
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $out/pcsc/drivers
|
|
|
|
cp -R proprietary/* $out/pcsc/drivers
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.scmmicro.com/support/pc-security-support/downloads.html";
|
|
|
|
description = "PCSC drivers for linux, for the SCM SCR3310 v2.0 card and others";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.unfree;
|
|
|
|
maintainers = with lib.maintainers; [viric];
|
|
|
|
platforms = with lib.platforms; linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|