From 428edff9c19d5bfa83a6ba9ddaeb752e4039a7ba Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Fri, 3 Apr 2026 18:45:52 +0200 Subject: [PATCH] Meson: add appropriate install_tag to each target See https://mesonbuild.com/Installing.html#installation-tags tl;dr it allows choosing what to install and also provides some extra metadata for tools operate on Meson projects via its introspection feature. --- meson.build | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index c30c57ab41..a40e4f1aec 100644 --- a/meson.build +++ b/meson.build @@ -1697,6 +1697,7 @@ if rst2man.found() '@INPUT@', '@OUTPUT@'], depfile: 'mpv.1.dep', install: true, + install_tag: 'man', install_dir: join_paths(mandir, 'man1') ) endif @@ -1713,6 +1714,7 @@ if rst2html.found() '@INPUT@', '@OUTPUT@'], depfile: 'mpv.html.dep', install: true, + install_tag: 'doc', install_dir: join_paths(datadir, 'doc', 'mpv') ) endif @@ -1731,6 +1733,7 @@ if rst2pdf.found() '@INPUT@', '-o', '@OUTPUT@'], depfile: 'mpv.pdf.dep', install: true, + install_tag: 'doc', install_dir: join_paths(datadir, 'doc', 'mpv') ) endif @@ -1827,28 +1830,30 @@ if get_option('cplayer') conf_files = ['etc/mpv.conf', 'etc/encoding-profiles.conf', 'etc/input.conf', 'etc/mplayer-input.conf', 'etc/restore-old-bindings.conf', 'etc/restore-osc-bindings.conf'] - install_data(conf_files, install_dir: join_paths(datadir, 'doc', 'mpv')) + install_data(conf_files, install_tag: 'doc', install_dir: join_paths(datadir, 'doc', 'mpv')) bash_install_dir = join_paths(datadir, 'bash-completion', 'completions') - install_data('etc/mpv.bash-completion', install_dir: bash_install_dir, rename: 'mpv') + install_data('etc/mpv.bash-completion', install_tag: 'bash', install_dir: bash_install_dir, rename: 'mpv') zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions') - install_data('etc/_mpv.zsh', install_dir: zsh_install_dir, rename: '_mpv') + install_data('etc/_mpv.zsh', install_tag: 'zsh', install_dir: zsh_install_dir, rename: '_mpv') fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d') - install_data('etc/mpv.fish', install_dir: fish_install_dir, rename: 'mpv.fish') + install_data('etc/mpv.fish', install_tag: 'fish', install_dir: fish_install_dir, rename: 'mpv.fish') - install_data('etc/mpv.metainfo.xml', install_dir: join_paths(datadir, 'metainfo')) + install_data('etc/mpv.metainfo.xml', install_tag: 'xdg', install_dir: join_paths(datadir, 'metainfo')) foreach size: ['16x16', '32x32', '64x64', '128x128'] icon_dir = join_paths(datadir, 'icons', 'hicolor', size, 'apps') - install_data('etc/mpv-icon-8bit-' + size + '.png', install_dir: icon_dir, rename: 'mpv.png') + install_data('etc/mpv-icon-8bit-' + size + '.png', install_tag: 'xdg', + install_dir: icon_dir, rename: 'mpv.png') endforeach hicolor_dir = join_paths(datadir, 'icons', 'hicolor') - install_data('etc/mpv-gradient.svg', install_dir: join_paths(hicolor_dir, 'scalable', 'apps'), - rename: 'mpv.svg') - install_data('etc/mpv-symbolic.svg', install_dir: join_paths(hicolor_dir, 'symbolic', 'apps')) + install_data('etc/mpv-gradient.svg', install_tag: 'xdg', + install_dir: join_paths(hicolor_dir, 'scalable', 'apps'), rename: 'mpv.svg') + install_data('etc/mpv-symbolic.svg', install_tag: 'xdg', + install_dir: join_paths(hicolor_dir, 'symbolic', 'apps')) mpv = executable('mpv', main_fn_source, objects: libmpv.extract_all_objects(recursive: true), dependencies: dependencies, win_subsystem: get_option('win32-subsystem'), install: true) @@ -1887,10 +1892,12 @@ if get_option('cplayer') output: 'mpv.desktop', command: [mpv_desktop, mpv_desktop_path, '@INPUT@', '@OUTPUT@'], install: true, + install_tag: 'xdg', install_dir: join_paths(datadir, 'applications'), ) else - install_data('etc/mpv.desktop', install_dir: join_paths(datadir, 'applications')) + install_data('etc/mpv.desktop', install_tag: 'xdg', + install_dir: join_paths(datadir, 'applications')) endif endif endif