From ebef68aeceb6563aa7b1ce24aafa921087a68d0d Mon Sep 17 00:00:00 2001 From: somini Date: Thu, 3 Dec 2020 00:42:53 +0000 Subject: 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. --- contrib/imv-folder.1.txt | 36 ------------------------------------ contrib/imv-folder.desktop | 14 -------------- doc/imv-folder.1.txt | 36 ++++++++++++++++++++++++++++++++++++ files/imv-folder.desktop | 14 ++++++++++++++ meson.build | 32 ++++++++++++++++++++++++-------- meson_options.txt | 6 ++++++ 6 files changed, 80 insertions(+), 58 deletions(-) delete mode 100644 contrib/imv-folder.1.txt delete mode 100644 contrib/imv-folder.desktop create mode 100644 doc/imv-folder.1.txt create mode 100644 files/imv-folder.desktop diff --git a/contrib/imv-folder.1.txt b/contrib/imv-folder.1.txt deleted file mode 100644 index a9d627b..0000000 --- a/contrib/imv-folder.1.txt +++ /dev/null @@ -1,36 +0,0 @@ -///// -vim:set ts=4 sw=4 tw=82 noet: -///// -:quotes.~: - -imv (1) -======= - -Name ----- -imv-folder - Open 'imv' for all images in a folder - -Description ------------ - -'imv-folder' is a wrapper for 'imv' that auto-selects the folder where the image is located, so that the *next* and *previous* commands function in the same way as other image viewers. - -Note that this wrapper supports only a single image. For opening multiple images, use plain `imv`. - -Synopsis --------- -'imv-folder' path - -Authors -------- - -imv is written and maintained by Harry Jeffery -with contributions from other developers. - -Full source code and other information can be found at -. - -See Also --------- - -**imv**(1) diff --git a/contrib/imv-folder.desktop b/contrib/imv-folder.desktop deleted file mode 100644 index 4bec770..0000000 --- a/contrib/imv-folder.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Name=imv-folder -Name[en_US]=imv -GenericName=Image viewer -GenericName[en_US]=Image viewer -Comment=Fast freeimage-based Image Viewer | Open all images on a folder -Exec=imv-folder %f -NoDisplay=true -Terminal=false -Type=Application -Categories=Graphics;2DGraphics;Viewer; -MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-pcx;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-tga;image/x-xbitmap; -Icon=multimedia-photo-viewer -Keywords=photo;picture; diff --git a/doc/imv-folder.1.txt b/doc/imv-folder.1.txt new file mode 100644 index 0000000..a9d627b --- /dev/null +++ b/doc/imv-folder.1.txt @@ -0,0 +1,36 @@ +///// +vim:set ts=4 sw=4 tw=82 noet: +///// +:quotes.~: + +imv (1) +======= + +Name +---- +imv-folder - Open 'imv' for all images in a folder + +Description +----------- + +'imv-folder' is a wrapper for 'imv' that auto-selects the folder where the image is located, so that the *next* and *previous* commands function in the same way as other image viewers. + +Note that this wrapper supports only a single image. For opening multiple images, use plain `imv`. + +Synopsis +-------- +'imv-folder' path + +Authors +------- + +imv is written and maintained by Harry Jeffery +with contributions from other developers. + +Full source code and other information can be found at +. + +See Also +-------- + +**imv**(1) diff --git a/files/imv-folder.desktop b/files/imv-folder.desktop new file mode 100644 index 0000000..4bec770 --- /dev/null +++ b/files/imv-folder.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Name=imv-folder +Name[en_US]=imv +GenericName=Image viewer +GenericName[en_US]=Image viewer +Comment=Fast freeimage-based Image Viewer | Open all images on a folder +Exec=imv-folder %f +NoDisplay=true +Terminal=false +Type=Application +Categories=Graphics;2DGraphics;Viewer; +MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-pcx;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-tga;image/x-xbitmap; +Icon=multimedia-photo-viewer +Keywords=photo;picture; 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' -- cgit v1.2.3