Merge pull request #272529 from anthonyroussel/updates/pcsclite
pcsclite: 1.9.5 -> 2.0.1
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, fetchFromGitLab
|
||||
, autoreconfHook
|
||||
, autoconf-archive
|
||||
, flex
|
||||
, pkg-config
|
||||
, perl
|
||||
, python3
|
||||
@@ -10,28 +11,26 @@
|
||||
, polkit
|
||||
, systemdLibs
|
||||
, IOKit
|
||||
, testers
|
||||
, nix-update-script
|
||||
, pname ? "pcsclite"
|
||||
, polkitSupport ? false
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
inherit pname;
|
||||
version = "1.9.5";
|
||||
version = "2.0.1";
|
||||
|
||||
outputs = [ "bin" "out" "dev" "doc" "man" ];
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://pcsclite.apdu.fr/files/pcsc-lite-${version}.tar.bz2";
|
||||
hash = "sha256-nuP5szNTdWIXeJNVmtT3uNXCPr6Cju9TBWwC2xQEnQg=";
|
||||
src = fetchFromGitLab {
|
||||
domain = "salsa.debian.org";
|
||||
owner = "rousseau";
|
||||
repo = "PCSC";
|
||||
rev = "refs/tags/${finalAttrs.version}";
|
||||
hash = "sha256-7NGlU4byGxtGBticewg8K4FUiDSQZAiB7Q/y+LaqKPo=";
|
||||
};
|
||||
|
||||
patches = [ ./no-dropdir-literals.patch ];
|
||||
|
||||
postPatch = ''
|
||||
sed -i configure.ac \
|
||||
-e "s@polkit_policy_dir=.*@polkit_policy_dir=$bin/share/polkit-1/actions@"
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--enable-confdir=/etc"
|
||||
# The OS should care on preparing the drivers into this location
|
||||
@@ -43,11 +42,9 @@ stdenv.mkDerivation rec {
|
||||
"--with-systemdsystemunitdir=${placeholder "bin"}/lib/systemd/system"
|
||||
];
|
||||
|
||||
postConfigure = ''
|
||||
sed -i -re '/^#define *PCSCLITE_HP_DROPDIR */ {
|
||||
s/(DROPDIR *)(.*)/\1(getenv("PCSCLITE_HP_DROPDIR") ? : \2)/
|
||||
}' config.h
|
||||
'';
|
||||
makeFlags = [
|
||||
"POLICY_DIR=$(out)/share/polkit-1/actions"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
# pcsc-spy is a debugging utility and it drags python into the closure
|
||||
@@ -56,17 +53,34 @@ stdenv.mkDerivation rec {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook autoconf-archive pkg-config perl ];
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
autoconf-archive
|
||||
flex
|
||||
pkg-config
|
||||
perl
|
||||
];
|
||||
|
||||
buildInputs = [ python3 ]
|
||||
++ lib.optionals stdenv.isLinux [ systemdLibs ]
|
||||
++ lib.optionals stdenv.isDarwin [ IOKit ]
|
||||
++ lib.optionals polkitSupport [ dbus polkit ];
|
||||
|
||||
passthru = {
|
||||
tests.version = testers.testVersion {
|
||||
package = finalAttrs.finalPackage;
|
||||
command = "pcscd --version";
|
||||
};
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Middleware to access a smart card using SCard API (PC/SC)";
|
||||
homepage = "https://pcsclite.apdu.fr/";
|
||||
changelog = "https://salsa.debian.org/rousseau/PCSC/-/blob/${finalAttrs.version}/ChangeLog";
|
||||
license = licenses.bsd3;
|
||||
mainProgram = "pcscd";
|
||||
maintainers = [ maintainers.anthonyroussel ];
|
||||
platforms = with platforms; unix;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
diff --git a/src/hotplug_libudev.c b/src/hotplug_libudev.c
|
||||
index 51bd95f..84f959b 100644
|
||||
--- a/src/hotplug_libudev.c
|
||||
+++ b/src/hotplug_libudev.c
|
||||
@@ -120,7 +120,8 @@ static LONG HPReadBundleValues(void)
|
||||
|
||||
if (NULL == hpDir)
|
||||
{
|
||||
- Log1(PCSC_LOG_ERROR, "Cannot open PC/SC drivers directory: " PCSCLITE_HP_DROPDIR);
|
||||
+ Log2(PCSC_LOG_ERROR, "Cannot open PC/SC drivers directory: %s",
|
||||
+ PCSCLITE_HP_DROPDIR);
|
||||
Log1(PCSC_LOG_ERROR, "Disabling USB support for pcscd.");
|
||||
return -1;
|
||||
}
|
||||
@@ -741,7 +742,7 @@ ULONG HPRegisterForHotplugEvents(void)
|
||||
|
||||
if (driverSize <= 0)
|
||||
{
|
||||
- Log1(PCSC_LOG_INFO, "No bundle files in pcsc drivers directory: "
|
||||
+ Log2(PCSC_LOG_INFO, "No bundle files in pcsc drivers directory: %s",
|
||||
PCSCLITE_HP_DROPDIR);
|
||||
Log1(PCSC_LOG_INFO, "Disabling USB support for pcscd");
|
||||
return 0;
|
||||
diff --git a/src/hotplug_libusb.c b/src/hotplug_libusb.c
|
||||
index 0ada9f5..d49a407 100644
|
||||
--- a/src/hotplug_libusb.c
|
||||
+++ b/src/hotplug_libusb.c
|
||||
@@ -142,7 +142,8 @@ static LONG HPReadBundleValues(void)
|
||||
|
||||
if (hpDir == NULL)
|
||||
{
|
||||
- Log1(PCSC_LOG_ERROR, "Cannot open PC/SC drivers directory: " PCSCLITE_HP_DROPDIR);
|
||||
+ Log2(PCSC_LOG_ERROR, "Cannot open PC/SC drivers directory: %s",
|
||||
+ PCSCLITE_HP_DROPDIR);
|
||||
Log1(PCSC_LOG_ERROR, "Disabling USB support for pcscd.");
|
||||
return -1;
|
||||
}
|
||||
@@ -282,7 +283,8 @@ static LONG HPReadBundleValues(void)
|
||||
|
||||
if (driverSize == 0)
|
||||
{
|
||||
- Log1(PCSC_LOG_INFO, "No bundle files in pcsc drivers directory: " PCSCLITE_HP_DROPDIR);
|
||||
+ Log2(PCSC_LOG_INFO, "No bundle files in pcsc drivers directory: %s",
|
||||
+ PCSCLITE_HP_DROPDIR);
|
||||
Log1(PCSC_LOG_INFO, "Disabling USB support for pcscd");
|
||||
}
|
||||
#ifdef DEBUG_HOTPLUG
|
||||
Reference in New Issue
Block a user