Add a contrib-commands option

This includes the commands available in contrib/. It's enabled by
default.

I moved the manpage and desktop file to their regular locations to avoid
complicating the meson file too much. They won't be installed when you
disable the contrib commands.
This commit is contained in:
somini 2020-12-03 00:42:53 +00:00 committed by Harry Jeffery
parent 9557a4b112
commit ebef68aece
4 changed files with 30 additions and 8 deletions

View file

@ -155,11 +155,13 @@ foreach ws : ['wayland', 'x11']
endif
endforeach
install_data(
files('files/imv-folder'),
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x',
)
if get_option('contrib-commands')
install_data(
files('contrib/imv-folder'),
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x',
)
endif
if not target_single_ws
install_data(
@ -169,7 +171,15 @@ if not target_single_ws
)
endif
foreach desktop: ['imv', 'imv-folder']
desktop_list = [
'imv',
]
if get_option('contrib-commands')
desktop_list += [
'imv-folder',
]
endif
foreach desktop: desktop_list
install_data(
files('files/@0@.desktop'.format(desktop)),
install_dir: '@0@/applications'.format(get_option('datadir')),
@ -202,12 +212,18 @@ endif
prog_a2x = find_program('a2x', required: get_option('man'))
if prog_a2x.found()
foreach man : [
man_list = [
[1, 'imv'],
[1, 'imv-folder'],
[1, 'imv-msg'],
[5, 'imv'],
]
if get_option('contrib-commands')
man_list += [
[1, 'imv-folder'],
]
endif
foreach man : man_list
_section = man[0]
_topic = man[1]
custom_target(

View file

@ -13,6 +13,12 @@ option('test',
description : 'enable tests'
)
option('contrib-commands',
type: 'boolean',
value: true,
description: 'Install extra commands available in `contrib/`'
)
option('man',
type : 'feature',
description : 'enable man pages'