From 289cbcddaa2fe47974b495a258b6d7f6fa1a44b4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lab Date: Thu, 4 Dec 2025 09:38:32 +0100 Subject: [PATCH 1/4] Update meson build to generate pkg-config files when installing Currently, installing CSP through meson does not allow other modules to use the installed version as it does not generate the required pkg-config files. --- meson.build | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index c5b60a1c1..e46d1b36e 100644 --- a/meson.build +++ b/meson.build @@ -67,18 +67,12 @@ csp_c_args = ['-Wshadow', subdir('src') subdir('include/csp') -if not meson.is_subproject() - install_subdir('include', install_dir : '.') - install_headers(csp_config_h, install_dir : 'include/csp') -endif - - csp_lib = library('csp', sources: [csp_sources, csp_config_h], include_directories : csp_inc, dependencies : csp_deps, c_args : csp_c_args, - install : false, + install : true, pic:true, ) @@ -90,6 +84,10 @@ csp_dep = declare_dependency( dependencies : csp_deps, ) +install_subdir('include', install_dir : '.', exclude_files: ['csp/meson.build']) +pkg = import('pkgconfig') +pkg.generate(csp_lib) + subdir('examples') if get_option('enable_python3_bindings') From fb9d552d7b2f205589e1d52a747ad1eb86ab20b1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lab Date: Thu, 4 Dec 2025 10:30:11 +0100 Subject: [PATCH 2/4] Update to use meson installation tags "runtime" will install the shared library only, "devel" will install the static library, headers and pkg-config files --- include/csp/meson.build | 2 +- meson.build | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/csp/meson.build b/include/csp/meson.build index ecf86b5a5..9511c2864 100644 --- a/include/csp/meson.build +++ b/include/csp/meson.build @@ -1 +1 @@ -csp_config_h = configure_file(output: 'autoconfig.h', configuration: conf, install_dir: 'include/csp/') +csp_config_h = configure_file(output: 'autoconfig.h', configuration: conf, install_dir: 'include/csp/', install_tag: 'devel') diff --git a/meson.build b/meson.build index e46d1b36e..2df8ea11b 100644 --- a/meson.build +++ b/meson.build @@ -83,8 +83,7 @@ csp_dep = declare_dependency( link_with : csp_lib, dependencies : csp_deps, ) - -install_subdir('include', install_dir : '.', exclude_files: ['csp/meson.build']) +install_subdir('include', install_dir : '.', exclude_files: ['csp/meson.build'], install_tag: 'devel') pkg = import('pkgconfig') pkg.generate(csp_lib) From 52c9da1c1caad6d4829bfea6398e8d9bca24fb72 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lab Date: Fri, 19 Dec 2025 14:00:21 +0100 Subject: [PATCH 3/4] Compile cleanly on both ARM and x86 --- src/interfaces/csp_if_zmqhub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces/csp_if_zmqhub.c b/src/interfaces/csp_if_zmqhub.c index 56ed65eba..0a8bcdc7d 100644 --- a/src/interfaces/csp_if_zmqhub.c +++ b/src/interfaces/csp_if_zmqhub.c @@ -291,7 +291,7 @@ int csp_zmqhub_init_filter2(const char * ifname, const char * host, uint16_t add const ssize_t sec_key_len = sec_key ? strnlen(sec_key, CURVE_KEYLEN-1) : 0; if (sec_key_len && sec_key_len != CURVE_KEYLEN-1) { /* Is it bad to expose the detected length of the ZMQ key here? */ - fprintf(stderr, "ZMQ secret key must be exactly 40 characters long (got %ld)\n", sec_key_len); + fprintf(stderr, "ZMQ secret key must be exactly 40 characters long (got %ld)\n", (signed long)sec_key_len); return CSP_ERR_INVAL; } From f3089f4811e750f0b3d0af91fbe4af1e04f3a158 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lab Date: Fri, 19 Dec 2025 14:01:04 +0100 Subject: [PATCH 4/4] Use soname meson feature --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 2df8ea11b..1b811aef2 100644 --- a/meson.build +++ b/meson.build @@ -74,6 +74,7 @@ csp_lib = library('csp', c_args : csp_c_args, install : true, pic:true, + soversion: meson.project_version() ) # The following dependency variable is for parent projects to link