PCSC icon indicating copy to clipboard operation
PCSC copied to clipboard

Changes to make it compilable in recent Cygwin environment

Open h0ly0ne opened this issue 1 year ago • 4 comments

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

h0ly0ne avatar Apr 22 '24 22:04 h0ly0ne

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

LudovicRousseau avatar Apr 23 '24 08:04 LudovicRousseau

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.

h0ly0ne avatar Apr 23 '24 12:04 h0ly0ne

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 avatar Apr 24 '24 12:04 LudovicRousseau

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 avatar May 10 '24 17:05 LudovicRousseau

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?

LudovicRousseau avatar May 22 '24 10:05 LudovicRousseau