3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/security/pcsc-scm-scl011/default.nix
Patrick Hilhorst f7e390e6d4 treewide: fix redirected urls (run 3)
Related:
 - 9fc5e7e473
 - 593e11fd94
 - 508ae42a0f

Since the last time I ran this script, the Repology API changed, so I had to
adapt the script used in the previous PR. The new API should be more robust, so
overall this is a positive (no more grepping the error messages for our relevant
data but just a nice json structure).

Here's the new script I used:

```sh
curl https://repology.org/api/v1/repository/nix_unstable/problems \
   | jq -r '.[] | select(.type == "homepage_permanent_https_redirect") | .data | "s@\(.url)@\(.target)@"' \
   | sort | uniq | tee script.sed
find -name '*.nix' | xargs -P4 -- sed -f script.sed -i
```

I will also add this script to `maintainers/scripts`.
2020-10-02 09:01:35 -07:00

49 lines
1.8 KiB
Nix

{ stdenv, fetchurl, unzip, libusb-compat-0_1 }:
let
arch = if stdenv.hostPlatform.system == "i686-linux" then "32"
else if stdenv.hostPlatform.system == "x86_64-linux" then "64"
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
in
stdenv.mkDerivation rec {
pname = "pcsc-scm-scl";
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 = ''
unzip $src
tar xf "Linux Driver Ver${version}/sclgeneric_${version}_linux_${arch}bit.tar.gz"
export sourceRoot=$(readlink -e sclgeneric_${version}_linux_${arch}bit)
'';
# 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-compat-0_1 ];
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 = "https://www.scm-pc-card.de/index.php?lang=enhttp://www.scm-pc-card.de/index.php?lang=en&page=product&function=show_product&product_id=630page=producthttp://www.scm-pc-card.de/index.php?lang=en&page=product&function=show_product&product_id=630function=show_producthttp://www.scm-pc-card.de/index.php?lang=en&page=product&function=show_product&product_id=630product_id=630";
downloadPage = "https://support.identiv.com/scl010-scl011/";
license = licenses.unfreeRedistributable;
maintainers = with maintainers; [ sephalon ];
platforms = platforms.linux;
};
}