LudovicRousseau / PCSC

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

[Build] Meson ignoring prefix for binary location #179

Closed freswa closed 6 months ago

freswa commented 6 months ago

I tried to switch the Arch Linux build to meson, but run into an error.

pcscd ends up in the wrong directory (/bin/pcscdinstead of /usr/bin/pcscd). At the moment the prefix is ignored in this line. Either we remove the leading slash to use the default behavior or we use something like

prefix = get_option('prefix')
join_paths(prefix, get_option('sbindir'))`
LudovicRousseau commented 6 months ago

Try something like:

meson setup builddir --prefix /usr --sbindir usr/bin

It is important to use usr/bin without the initial /

You can check what meson understood using meson configure.

Do you know other projects that use join_paths(prefix, get_option('sbindir')) as you suggest?

freswa commented 6 months ago

Technically, --prefix /usr --sbindir usr/bin works but that collides with our defaults and it looks like a duplicate to me. If I set the prefix, which would be used to install pcsc into arbitrary locations like /usr/local or /opt/pcsc-1.2.2, --sbindir usr/bin or --sbindir usr/sbin don't have the intended effect anymore. And having a look at the upstream defaults it seems to me that sbin or bin is the choice with far more compatibility across distros.

Maybe I can help you out with this issue. What is the reason to expect --sbindir usr/bin in the first place?

Do you know other projects that use join_paths(prefix, get_option('sbindir')) as you suggest?

See e.g. the fwupd project.

LudovicRousseau commented 6 months ago

Fixed in https://github.com/LudovicRousseau/PCSC/commit/960e367edc01518b90684ffff99010ee07ae1bd4 Thanks