nixpkgs/pkgs/tools/security/ccid/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
1.7 KiB
Nix
Raw Normal View History

2023-12-06 19:18:53 +00:00
{ lib
, stdenv
, fetchurl
, flex
2023-12-06 19:18:53 +00:00
, pcsclite
, pkg-config
, libusb1
, perl
, zlib
2023-12-06 19:18:53 +00:00
, gitUpdater
}:
2014-09-15 07:55:31 +00:00
stdenv.mkDerivation rec {
pname = "ccid";
2024-01-06 12:23:39 +00:00
version = "1.5.5";
src = fetchurl {
url = "https://ccid.apdu.fr/files/${pname}-${version}.tar.bz2";
2024-01-06 12:23:39 +00:00
hash = "sha256-GUcI91/jadRd18Feiz6Kfbi0nPxVV1dMoqLnbvEsoMo=";
};
postPatch = ''
2015-08-06 02:25:49 +00:00
patchShebangs .
substituteInPlace src/Makefile.in --replace /bin/echo echo
'';
2015-08-06 02:25:49 +00:00
configureFlags = [
"--enable-twinserial"
"--enable-serialconfdir=${placeholder "out"}/etc/reader.conf.d"
"--enable-ccidtwindir=${placeholder "out"}/pcsc/drivers/serial"
"--enable-usbdropdir=${placeholder "out"}/pcsc/drivers"
];
# error: call to undeclared function 'InterruptRead';
# ISO C99 and later do not support implicit function declarations
env = lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};
nativeBuildInputs = [
flex
pkg-config
perl
];
buildInputs = [
pcsclite
libusb1
zlib
];
postInstall = ''
install -Dm 0444 -t $out/lib/udev/rules.d src/92_pcscd_ccid.rules
substituteInPlace $out/lib/udev/rules.d/92_pcscd_ccid.rules \
--replace "/usr/sbin/pcscd" "${pcsclite}/bin/pcscd"
'';
# The resulting shared object ends up outside of the default paths which are
# usually getting stripped.
stripDebugList = ["pcsc"];
2023-12-06 19:18:53 +00:00
passthru.updateScript = gitUpdater {
url = "https://salsa.debian.org/rousseau/CCID.git";
};
meta = with lib; {
description = "PC/SC driver for USB CCID smart card readers";
homepage = "https://ccid.apdu.fr/";
license = licenses.lgpl21Plus;
maintainers = [ maintainers.anthonyroussel ];
platforms = platforms.unix;
};
}