aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsomini <dev@somini.xyz>2020-12-03 00:42:53 +0000
committerHarry Jeffery <harry@exec64.co.uk>2021-07-08 23:30:24 +0100
commitebef68aeceb6563aa7b1ce24aafa921087a68d0d (patch)
tree64cf8cd55b20b6daaa1a64499e836091026689c9
parent9557a4b1129d1578cafc3edffc4e72fa007a8e2f (diff)
downloadimv-ebef68aeceb6563aa7b1ce24aafa921087a68d0d.tar.gz
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.
-rw-r--r--doc/imv-folder.1.txt (renamed from contrib/imv-folder.1.txt)0
-rw-r--r--files/imv-folder.desktop (renamed from contrib/imv-folder.desktop)0
-rw-r--r--meson.build32
-rw-r--r--meson_options.txt6
4 files changed, 30 insertions, 8 deletions
diff --git a/contrib/imv-folder.1.txt b/doc/imv-folder.1.txt
index a9d627b..a9d627b 100644
--- a/contrib/imv-folder.1.txt
+++ b/doc/imv-folder.1.txt
diff --git a/contrib/imv-folder.desktop b/files/imv-folder.desktop
index 4bec770..4bec770 100644
--- a/contrib/imv-folder.desktop
+++ b/files/imv-folder.desktop
diff --git a/meson.build b/meson.build
index 41a4616..15ec491 100644
--- a/meson.build
+++ b/meson.build
@@ -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(
diff --git a/meson_options.txt b/meson_options.txt
index e69badf..389b7fd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -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'