New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Meson build system #2754
base: master
Are you sure you want to change the base?
Add Meson build system #2754
Conversation
frankmorgner
commented
Apr 17, 2023
- Documentation is added or updated
- New files have a LGPL 2.1 license statement
- PKCS#11 module is tested
- Windows minidriver is tested
- macOS tokend is tested
meson.build
Outdated
cdata.set('ENABLE_OPENSSL', openssl_dep.found()) | ||
cdata.set('HAVE_OPENSSL_CRYPTO_H', openssl_dep.found()) | ||
cdata.set('ENABLE_OPENPACE', openpace_dep.found()) | ||
cdata.set('ENABLE_SM', get_option('sm').enabled()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of sm
is a boolean so this should probably be cdata.set('ENABLE_SM', get_option('sm'))
. The enabled
is used when the type of the option is feature
.
@@ -0,0 +1,111 @@ | |||
project('opensc', 'c', | |||
version: '0.23.165' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that for the final version, the version will be best to be moved away to some separate file/script to make sure we do not have to update it on several places for a release. I have only experience with libcacard, where this is done with git-version-gen from autotools, but I believe there will be other/better ways.
https://gitlab.freedesktop.org/spice/libcacard/-/blob/master/meson.build#L2
https://gitlab.freedesktop.org/spice/libcacard/-/blob/master/build-aux/git-version-gen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's acceptable to update to a minimum required meson >=0.57 then you can do this with:
version: '0.23.165' | |
version: files('VERSION.txt') |
and meson will read that file as a version file. For scripts, the libcacard approach seems fine.
From local testing, this build file currently supports even meson 0.49.0, so bumping the minimum aggressively may not be desired...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not be afraid to bump meson requirement to 0.57. I do not expect we will need to build it on some old systems, for example RHEL8 already has 0.58.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At any rate, permitting version 0.61.0 is sufficient to guarantee that people stuck on operating systems that only ship python 3.6 but desperately want bleeding edge OpenSC, can still manually acquire meson (by git cloning that too, or by using pip install
) regardless of which version of meson is packaged by that distro repository.
The python requirement is a much harder one to ask people to manually compile the build system, but fortunately there are no more operating systems where python 3.5 is relevant. Even 3.6 is end of life and no longer receiving security updates by the Python Software Foundation (that's a baseline requirement for meson to drop support for an old version of python).
install: true, | ||
) | ||
|
||
pkcs11_mod = shared_module('onepin-opensc-pkcs11', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkcs11_mod = shared_module('onepin-opensc-pkcs11', | |
pkcs11_onepin_mod = shared_module('onepin-opensc-pkcs11', |
meson_options
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File is misnamed, should end in .txt
|
||
executable('pkcs11-tool', 'pkcs11-tool.c', 'util.c', | ||
include_directories: core_inc, | ||
link_with: [opensc_lib, pkcs11_lib, pkcs11_mod], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prints a deprecation warning because pkcs11_mod is a dlopen() style shared_module()
.