p11-glue / p11-kit

Provides a way to load and enumerate PKCS#11 modules.
https://p11-glue.github.io/p11-glue/p11-kit.html
Other
149 stars 91 forks source link

Fixes for GNU/Hurd #614

Closed ametzler closed 8 months ago

ametzler commented 8 months ago

Hello,

we have been patching p11-kit on Debian for GNU/Hurd and kfreebsd compatibility for a long time. Find attached the latest iteration of the (small) patchset. kfreebsd-compatibilty is untested nowadays since we have dropped the port on Debian. - Please tell me if I should drop the respective code ("kfreebsd*-gnu |")

cu Andreas

coveralls commented 8 months ago

Coverage Status

coverage: 69.447% (-0.002%) from 69.449% when pulling fc4298f4a1b896f2248988bf6040a39c71657194 on ametzler:tmp-2023-hurd into 3f6233d70ed81fdbc81b9bff345ea90ec2496b3b on p11-glue:master.

ueno commented 8 months ago

Thank you; I see no problem in merging this. One nit: the second commit has an ill-formatted log message "use_libbsd-overlay on GNU/hurd and kfreebsd."; maybe the first "_" should be replaced with a space?

Btw, is Meson available and supposed to work on GNU/Hurd?

ametzler commented 8 months ago

ueno wrote

Thank you; I see no problem in merging this. One nit: the second commit has an ill-formatted log message "use_libbsd-overlay on GNU/hurd and kfreebsd."; maybe the first "_" should be replaced with a space?

I have force-pushed this change.

Btw, is Meson available and supposed to work on GNU/Hurd?

Yes, it should work. I played a little bit but this seems to need somebody familiar with meson. I did not get beyond

if ['gnu', 'gnu/kfreebsd'].contains(host_system)
  libbsd_overlay = dependency('libbsd-overlay')
endif

and adding this to dependencies: of some targets. Which is not enough. This test

  foreach h : headers
    if cc.has_header(h)
      conf.set('HAVE_' + h.underscorify().to_upper(), 1)
    endif
  endforeach

would also need to use libbsd-overlay's CFLAGS to find its ucred.h

ueno commented 8 months ago

Afaik has_header also takes dependencies so you can write something like:

  foreach h : headers
    if cc.has_header(h, dependencies: libbsd_overlay)
      conf.set('HAVE_' + h.underscorify().to_upper(), 1)
    endif
  endforeach
ametzler commented 8 months ago

Afaik has_header also takes dependencies so you can write something like:

  foreach h : headers
    if cc.has_header(h, dependencies: libbsd_overlay)
      conf.set('HAVE_' + h.underscorify().to_upper(), 1)
    endif
  endforeach

Thanks, I have used this and pushed an updated version that also changes the meson build.