fix: Enable install for libx52dcomm

The change to build using Meson broke the install target, causing x52ctl
and x52d to fail with a missing libx52dcomm library. This was fixed by
setting `install: true` in the library call.

In addition, several features were used that were leftover from my
earlier attempts to migrate to Meson, but targeted older Meson versions.
Some of these features were deprecated in newer Meson versions, and
therefore, cause warnings to show up during meson setup.

GH-Issue: #63
GH-Issue-URL: https://github.com/nirenjan/libx52/issues/63
pull/64/head
nirenjan 2026-03-22 15:43:30 -07:00
parent 732bc21b65
commit dfbe3e6d21
3 changed files with 27 additions and 24 deletions

View File

@ -11,6 +11,7 @@ install_headers('x52dcomm.h', subdir: meson.project_name())
lib_libx52dcomm = library('x52dcomm', libx52dcomm_sources,
dependencies: [dep_intl],
version: libx52dcomm_version,
install: true,
include_directories: includes)
x52d_sources = [

View File

@ -0,0 +1,17 @@
#!/bin/sh
# Install Doxygen HTML and man trees from the build directory.
# Arguments are paths relative to the install prefix (MESON_INSTALL_DESTDIR_PREFIX).
set -e
doc_html="$1"
mandir="$2"
if [ -d "$MESON_BUILD_ROOT/docs/html" ]; then
mkdir -p "$MESON_INSTALL_DESTDIR_PREFIX/$doc_html"
cp -R "$MESON_BUILD_ROOT/docs/html"/. "$MESON_INSTALL_DESTDIR_PREFIX/$doc_html/"
fi
if [ -d "$MESON_BUILD_ROOT/docs/man" ]; then
mkdir -p "$MESON_INSTALL_DESTDIR_PREFIX/$mandir"
cp -R "$MESON_BUILD_ROOT/docs/man"/. "$MESON_INSTALL_DESTDIR_PREFIX/$mandir/"
fi

View File

@ -1,6 +1,7 @@
project('libx52', 'C',
license: 'GPL-2.0-only WITH Classpath-exception-2.0',
version: '0.3.3')
version: '0.3.3',
meson_version: '>=0.61')
dep_libusb = dependency('libusb-1.0', required: true)
dep_hidapi = dependency('hidapi-hidraw', required: false)
@ -129,36 +130,20 @@ if doxygen_program.found()
configuration: {
'PACKAGE_NAME': meson.project_name(),
'PACKAGE_VERSION': meson.project_version(),
'abs_top_builddir': meson.build_root(),
'abs_top_srcdir': meson.source_root(),
'abs_top_builddir': meson.project_build_root(),
'abs_top_srcdir': meson.project_source_root(),
}
)
docs_tgt = custom_target('docs',
custom_target('docs',
depend_files: [doxyfile, 'DoxygenLayout.xml'],
command: [doxygen_program],
output: 'docs'
)
install_subdir(meson.current_build_dir() / 'docs' / 'html',
install_dir: get_option('prefix') / get_option('datadir') / 'doc' / meson.project_name(),
strip_directory: true
)
wanted_man_pages = ['x52cli.1', 'x52bugreport.1']
foreach p: wanted_man_pages
section = 'man' + p.split('.')[-1] # Extracts the section
custom_target(p,
input: docs_tgt,
output: p,
command: ['cp', meson.current_build_dir() / 'docs' / 'man' / section / p, '@OUTPUT@'],
install: true,
install_dir: get_option('prefix') / get_option('mandir') / section
)
endforeach
install_subdir(meson.current_build_dir() / 'docs' / 'man',
install_dir: get_option('prefix') / get_option('mandir'),
strip_directory: true
meson.add_install_script(
'install-doxygen-docs.sh',
get_option('datadir') / 'doc' / meson.project_name(),
get_option('mandir'),
)
endif