aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-18 13:36:31 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-18 13:41:58 +0100
commitf8526d486accde7af88e2e40a6e9b697ca204882 (patch)
tree7e92a6f8bdc8b7d732a49c134dd0e22e25a501bf
parent06af1a3cc9920780c7edeba34677fc66b18ff5eb (diff)
downloadfiv-f8526d486accde7af88e2e40a6e9b697ca204882.tar.gz
fiv-f8526d486accde7af88e2e40a6e9b697ca204882.tar.xz
fiv-f8526d486accde7af88e2e40a6e9b697ca204882.zip
Do not lie as much in the desktop file
-rw-r--r--fastiv.desktop3
-rw-r--r--meson.build13
2 files changed, 13 insertions, 3 deletions
diff --git a/fastiv.desktop b/fastiv.desktop
index 894c0cf..dea3e36 100644
--- a/fastiv.desktop
+++ b/fastiv.desktop
@@ -7,5 +7,4 @@ Exec=fastiv %F
Terminal=false
StartupNotify=true
Categories=Graphics;2DGraphics;Viewer;
-# TODO(p): Generate this list from source files.
-MimeType=image/png;image/bmp;image/gif;image/jpeg;image/x-dcraw;image/svg+xml;image/x-xcursor;
+MimeType=image/png;image/bmp;image/gif;image/jpeg;
diff --git a/meson.build b/meson.build
index 5a89255..7081517 100644
--- a/meson.build
+++ b/meson.build
@@ -30,7 +30,7 @@ configure_file(
configuration : conf,
)
-executable('fastiv', 'fastiv.c', 'fastiv-view.c', 'fastiv-io.c',
+exe = executable('fastiv', 'fastiv.c', 'fastiv-view.c', 'fastiv-io.c',
'fastiv-browser.c', 'xdg.c',
install : true,
dependencies : [dependencies])
@@ -45,3 +45,14 @@ install_data('fastiv.desktop',
install_dir : get_option('datadir') + '/applications')
install_data('fastiv.svg',
install_dir : get_option('datadir') + '/icons/hicolor/scalable/apps')
+
+# TODO(p): Replace this with custom_target().
+if not meson.is_cross_build()
+ meson.add_install_script(
+ 'sh', '-c', '''sed -i "/^MimeType=/{c \\
+MimeType=$($1 --list-supported-media-types | tr "\\012" ";")
+}" "$MESON_INSTALL_DESTDIR_PREFIX/$2"''',
+ 'sh',
+ exe.full_path(),
+ get_option('datadir') + '/applications/fastiv.desktop')
+endif