LudovicRousseau / PCSC

pcsc-lite: PC/SC implementation
https://pcsclite.apdu.fr/
Other
268 stars 109 forks source link

Changes to make it compilable in recent Cygwin environment #175

Closed h0ly0ne closed 5 months ago

h0ly0ne commented 6 months ago

Fixed path errors to get the header chain working correctly. Additionally added required seperation for Cygwin environment to wintypes header

LudovicRousseau commented 6 months ago

Why do you want to use pcsc-lite on cygwin instead of the PC/CS library provided by Windows? What is you use case?

h0ly0ne commented 6 months ago

I am just experimenting with the possibility to replace the windows based PCSC drivers/system that is failing on a daily basis (and has ACL/permission issues on windows) - and the winscard.dll seems to behave the same way (when used with cygwin) as it depends on the components from windows.

LudovicRousseau commented 6 months ago

I am working on using meson to build pcsc-lite. The current code is in https://github.com/LudovicRousseau/PCSC-debug/tree/meson

To rebuild on msys2 I need only one small patch:

diff --git a/meson.build b/meson.build
index 29caee12..de999951 100644
--- a/meson.build
+++ b/meson.build
@@ -126,6 +126,8 @@ elif target_machine.system() == 'netbsd'
   conf_data.set_quoted('PCSC_ARCH', 'NetBSD')
   confgen_data.set('ipcdir', '/var/run/pcscd')
   conf_data.set_quoted('PCSCLITE_HP_DROPDIR', '/usr/pkg/lib/pcsc-lite/drivers')
+elif target_machine.system() == 'cygwin'
+  conf_data.set_quoted('PCSC_ARCH', 'Windows')
 endif
 features +=  conf_data.get_unquoted('PCSC_ARCH')
 pcscd_dep += [polkit_dep, systemd_dep]

And I call meson with:

meson setup builddir -Dlibudev=false -Dpolkit=false -Dlibsystemd=false

Of course the binary does not work:

$ /sbin/pcscd.exe -fd
00000000 [42949672976] ../src/debuglog.c:392:DebugLogSetLevel() debug level=debug
00003041 [42949672976] ../src/pcscdaemon.c:629:main() cannot create /run/pcscd: No such file or directory
LudovicRousseau commented 6 months ago

meson is now included in pcsc-lite 2.2.1 https://blog.apdu.fr/posts/2024/05/pcsc-lite-now-uses-meson-build-tool/

LudovicRousseau commented 5 months ago

pcsc-lite builds fine on cygwin with the patch I proposed.

I do not see any benefit to have pcsc-lite on Windows. So I do not plan to add support for this platform. But feel free to use it.

Do you really use pcsc-lite on Windows? What is you use case?