diff --git a/pkgs/tools/security/ccid/default.nix b/pkgs/tools/security/ccid/default.nix index e3adf5190e72..c13ec56c4b6a 100644 --- a/pkgs/tools/security/ccid/default.nix +++ b/pkgs/tools/security/ccid/default.nix @@ -1,20 +1,22 @@ { lib , stdenv , fetchurl +, flex , pcsclite , pkg-config , libusb1 , perl +, zlib , gitUpdater }: stdenv.mkDerivation rec { pname = "ccid"; - version = "1.5.2"; + version = "1.5.4"; src = fetchurl { url = "https://ccid.apdu.fr/files/${pname}-${version}.tar.bz2"; - sha256 = "sha256-E5NEh+b4tI9pmhbTZ8x6GvejyodN5yGsbpYzvrhuchk="; + hash = "sha256-boMq3Bcuzc/e4rVvMxRGhIgsvpctr/GTjnqcc6ZPiL8="; }; postPatch = '' @@ -22,12 +24,36 @@ stdenv.mkDerivation rec { substituteInPlace src/Makefile.in --replace /bin/echo echo ''; - preConfigure = '' - configureFlagsArray+=("--enable-usbdropdir=$out/pcsc/drivers") - ''; + configureFlags = [ + "--enable-twinserial" + "--enable-serialconfdir=${placeholder "out"}/etc/reader.conf.d" + "--enable-ccidtwindir=${placeholder "out"}/pcsc/drivers/serial" + "--enable-usbdropdir=${placeholder "out"}/pcsc/drivers" + ]; - nativeBuildInputs = [ pkg-config perl ]; - buildInputs = [ pcsclite libusb1 ]; + # 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.