Include a .desktop file check using desktop-file-validate.
Revise .desktop files - most had an incorrect Categories entry.
# For gtk builder checks on .ui files
ui_sources = []
+# For checks on .desktop files
+desktop_sources = []
+
# Process subdirs before the sources
subdir('po')
subdir('plugins')
else
summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
+
+# Desktop files test
+option = get_option('desktop')
+if not option.disabled()
+ desktop_exe = find_program('desktop-file-validate', required : false)
+ if desktop_exe.found()
+ desktop_sh = find_program('desktop-file-validate.sh', dirs : scriptsdir, required : true)
+ test_desktop_dir = join_paths(meson.current_build_dir(), 'test-desktop-files.p')
+ foreach desktop_file : desktop_sources
+ desktop_path = '@0@'.format(desktop_file)
+ test('Desktop_check_ ' + desktop_path, desktop_sh, args: [test_desktop_dir, desktop_file], timeout: 100)
+ endforeach
+
+ summary({'Desktop files' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
+ else
+ summary({'Desktop files' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
+ endif
+else
+ summary({'Desktop files' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
+endif
option('archive', type : 'feature', value : 'auto', description : 'archive files e.g. zip, gz')
option('cms', type : 'feature', value : 'auto', description : 'color management system')
+option('desktop', type : 'feature', value : 'auto', description : 'desktop file check')
option('devel', type : 'feature', value : 'disabled', description : 'developer mode')
option('doxygen', type : 'feature', value : 'auto', description : 'lua api help file')
option('djvu', type : 'feature', value : 'auto', description : 'djvu')
script_sources += files('geeqie-camera-import',
'geeqie-camera-import-hook-script')
+
+desktop_sources += files('org.geeqie.camera-import.desktop.in')
Exec=geeqie-camera-import
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# It can be made verbose
install_dir : desktopdir)
script_sources += files('geeqie-export-jpeg')
+
+desktop_sources += files('org.geeqie.export-jpeg.desktop.in')
#TryExec=jpgicc
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# It can be made verbose
install_dir : desktopdir)
script_sources += files('geeqie-image-crop')
+
+desktop_sources += files('org.geeqie.image-crop.desktop.in')
Exec=geeqie-image-crop %f
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# It can be made verbose
po_dir : podir,
install : true,
install_dir : appdir)
+
+desktop_sources += files('org.geeqie.template.desktop.in')
install : true,
install_dir : desktopdir)
+
+desktop_sources += files('org.geeqie.open-with.desktop.in')
Exec=geeqie --remote --action:OpenWith %f
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# It can be made verbose
Version=1.0
Type=Application
-# The Desktop file MUST contain one or both of the following:
+# The Desktop file MUST contain the following:
Categories=Graphics;
-Categories=X-Geeqie;
# The name which appears in the menu:
Name=Template
#Name[de]=Vorlage
# Replace "command" with the actual command or script:
-Exec=command <param>
+Exec=command param
# Where <param> may be:
# omitted If no parameter is given the command will be executed in the
install_dir : desktopdir)
script_sources += files('geeqie-random-image')
+
+desktop_sources += files('org.geeqie.random-image.desktop.in')
Exec=geeqie-random-image
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# It can be made verbose
po_dir : podir,
install : true,
install_dir : desktopdir)
+
+desktop_sources += files('org.geeqie.refresh-thumbnail.desktop.in')
Exec=geeqie-refresh-thumbnail
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# It can be made verbose
install_dir : desktopdir)
script_sources += files('geeqie-resize-image')
+
+desktop_sources += files('org.geeqie.resize-image.desktop.in')
Exec=geeqie-resize-image %f
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# It can be made verbose
install_dir : desktopdir)
script_sources += files('geeqie-rotate')
+
+desktop_sources += files('org.geeqie.rotate.desktop.in')
Exec=geeqie-rotate -g %f
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# Show in menu "Edit/Orientation"
install_dir : desktopdir)
script_sources += files('geeqie-symlink')
+
+desktop_sources += files('org.geeqie.symlink.desktop.in')
Exec=geeqie-symlink %f
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# Show in menu "File"
script_sources += files('geeqie-tethered-photography',
'geeqie-tethered-photography-hook-script')
+
+desktop_sources += files('org.geeqie.tethered-photography.desktop.in')
Exec=geeqie-tethered-photography
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
# It can be made verbose
po_dir : podir,
install : true,
install_dir : desktopdir)
+
+desktop_sources += files('org.geeqie.video-player.desktop.in')
Exec=xdg-open %f
# Desktop files that are usable only in Geeqie should be marked like this:
-Categories=X-Geeqie;
+Categories=Graphics;
OnlyShowIn=X-Geeqie;
TryExec=xdg-open
--- /dev/null
+#! /bin/sh
+#**********************************************************************
+# Copyright (C) 2024 - The Geeqie Team
+#
+# Author: Colin Clark
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#**********************************************************************
+
+## @file
+## @brief Use desktop-file-validate on .desktop files.
+##
+## $1 temp directory \n
+## $2 desktop file name including .in extension \n
+##
+## desktop-file-validate will not process a file with
+## the extension ".in". Use a symlink as a workaround.
+
+if [ ! -d "$1" ]
+then
+ mkdir --parents "$1"
+fi
+
+desktop_file=$(basename "$2" ".in")
+
+ln --symbolic "$2" "$1/$desktop_file"
+
+result=$(desktop-file-validate "$1/$desktop_file")
+
+rm "$1/$desktop_file"
+
+if [ -z "$result" ]
+then
+ exit 0
+else
+ printf "%s\n" "$result"
+
+ exit 1
+fi
+
# GNU General Public License for more details.
script_sources += files('authors.sh',
+'desktop-file-validate.sh',
'devel-install.sh',
'doxygen-help.sh',
'doxygen.sh',