meson: Tag all installed files

Meson uses tags to sort installed files in categories, and makes it
possible to install a subset of the files using the '--tags' argument to
'meson install'. This is typically used by distributions to split the
runtime, development and documentation files into separate packages.

By default, meson tries to guess the correct tag for installed files,
but can't always do so properly. Mark the install targets that meson
can't guess with the correct install_tag.

As the feature has been introduced in meson 0.60, bump the minimum meson
version. The latest LTS release of all major distributions that
libcamera currently targets ship a recent enough meson version.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2023-12-06 02:22:54 +02:00
parent b06ebdedba
commit 9ba0c3fef8
14 changed files with 29 additions and 14 deletions

View file

@ -49,7 +49,8 @@ if doxygen.found() and dot.found()
output : 'api-html', output : 'api-html',
command : [doxygen, doxyfile], command : [doxygen, doxyfile],
install : true, install : true,
install_dir : doc_install_dir) install_dir : doc_install_dir,
install_tag : 'doc')
endif endif
# #
@ -91,7 +92,8 @@ if sphinx.found()
output : 'html', output : 'html',
build_by_default : true, build_by_default : true,
install : true, install : true,
install_dir : doc_install_dir) install_dir : doc_install_dir,
install_tag : 'doc')
custom_target('documentation-linkcheck', custom_target('documentation-linkcheck',
command : [sphinx, '-W', '-b', 'linkcheck', meson.current_source_dir(), '@OUTPUT@'], command : [sphinx, '-W', '-b', 'linkcheck', meson.current_source_dir(), '@OUTPUT@'],

View file

@ -47,7 +47,7 @@ A C++ toolchain: [required]
Either {g++, clang} Either {g++, clang}
Meson Build system: [required] Meson Build system: [required]
meson (>= 0.57) ninja-build pkg-config meson (>= 0.60) ninja-build pkg-config
for the libcamera core: [required] for the libcamera core: [required]
libyaml-dev python3-yaml python3-ply python3-jinja2 libyaml-dev python3-yaml python3-ply python3-jinja2

View file

@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
project('libcamera', 'c', 'cpp', project('libcamera', 'c', 'cpp',
meson_version : '>= 0.57', meson_version : '>= 0.60',
version : '0.1.0', version : '0.1.0',
default_options : [ default_options : [
'werror=true', 'werror=true',

View file

@ -58,4 +58,5 @@ cam = executable('cam', cam_sources,
libyaml, libyaml,
], ],
cpp_args : cam_cpp_args, cpp_args : cam_cpp_args,
install : true) install : true,
install_tag : 'bin')

View file

@ -26,4 +26,5 @@ lc_compliance = executable('lc-compliance', lc_compliance_sources,
libevent, libevent,
libgtest, libgtest,
], ],
install : true) install : true,
install_tag : 'bin-devel')

View file

@ -63,6 +63,7 @@ resources = qt5.preprocess(moc_headers : qcam_moc_headers,
qcam = executable('qcam', qcam_sources, resources, qcam = executable('qcam', qcam_sources, resources,
install : true, install : true,
install_tag : 'bin',
link_with : apps_lib, link_with : apps_lib,
dependencies : [ dependencies : [
libatomic, libatomic,

View file

@ -5,4 +5,5 @@ conf_files = files([
]) ])
install_data(conf_files, install_data(conf_files,
install_dir : ipa_data_dir / 'ipu3') install_dir : ipa_data_dir / 'ipu3',
install_tag : 'runtime')

View file

@ -72,5 +72,6 @@ if ipa_sign_module
# install time, which invalidates the signatures. # install time, which invalidates the signatures.
meson.add_install_script('ipa-sign-install.sh', meson.add_install_script('ipa-sign-install.sh',
ipa_priv_key.full_path(), ipa_priv_key.full_path(),
enabled_ipa_modules) enabled_ipa_modules,
install_tag : 'runtime')
endif endif

View file

@ -8,4 +8,5 @@ conf_files = files([
]) ])
install_data(conf_files, install_data(conf_files,
install_dir : ipa_data_dir / 'rkisp1') install_dir : ipa_data_dir / 'rkisp1',
install_tag : 'runtime')

View file

@ -23,4 +23,5 @@ conf_files = files([
]) ])
install_data(conf_files, install_data(conf_files,
install_dir : ipa_data_dir / 'rpi' / 'vc4') install_dir : ipa_data_dir / 'rpi' / 'vc4',
install_tag : 'runtime')

View file

@ -5,4 +5,5 @@ conf_files = files([
]) ])
install_data(conf_files, install_data(conf_files,
install_dir : ipa_data_dir / 'vimc') install_dir : ipa_data_dir / 'vimc',
install_tag : 'runtime')

View file

@ -5,4 +5,5 @@ conf_files = files([
]) ])
install_data(conf_files, install_data(conf_files,
install_dir : pipeline_data_dir / 'rpi' / 'vc4') install_dir : pipeline_data_dir / 'rpi' / 'vc4',
install_tag : 'runtime')

View file

@ -90,6 +90,7 @@ pycamera = shared_module('_libcamera',
pycamera_sources, pycamera_sources,
install : true, install : true,
install_dir : destdir, install_dir : destdir,
install_tag : 'python-runtime',
name_prefix : '', name_prefix : '',
dependencies : pycamera_deps, dependencies : pycamera_deps,
cpp_args : pycamera_args) cpp_args : pycamera_args)
@ -105,7 +106,9 @@ run_command('ln', '-fsrT', meson.current_source_dir() / 'utils',
meson.current_build_dir() / 'utils', meson.current_build_dir() / 'utils',
check : true) check : true)
install_data(['__init__.py'], install_dir : destdir) install_data(['__init__.py'],
install_dir : destdir,
install_tag : 'python-runtime')
# \todo Generate stubs when building. See https://peps.python.org/pep-0484/#stub-files # \todo Generate stubs when building. See https://peps.python.org/pep-0484/#stub-files
# Note: Depends on pybind11-stubgen. To generate pylibcamera stubs: # Note: Depends on pybind11-stubgen. To generate pylibcamera stubs:

View file

@ -44,4 +44,5 @@ cdata.set('LIBCAMERA_V4L2_SO', get_option('prefix') / libcamera_libexecdir / 'v4
configure_file(input : 'libcamerify.in', configure_file(input : 'libcamerify.in',
output : 'libcamerify', output : 'libcamerify',
configuration : cdata, configuration : cdata,
install_dir : get_option('bindir')) install_dir : get_option('bindir'),
install_tag : 'bin')