summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--data/misc/io.github.Hexchat.Plugin.metainfo.xml.in11
-rw-r--r--data/misc/meson.build59
-rw-r--r--meson_options.txt3
3 files changed, 72 insertions, 1 deletions
diff --git a/data/misc/io.github.Hexchat.Plugin.metainfo.xml.in b/data/misc/io.github.Hexchat.Plugin.metainfo.xml.in
new file mode 100644
index 00000000..d6fec5de
--- /dev/null
+++ b/data/misc/io.github.Hexchat.Plugin.metainfo.xml.in
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="addon">
+  <id>io.github.Hexchat.Plugin.Perl</id>
+  <extends>io.github.Hexchat.desktop</extends>
+  <name>@NAME@ Plugin</name>
+  <summary>@SUMMARY@</summary>
+  <url type="homepage">https://hexchat.github.io/</url>
+  <project_license>GPL-2.0+</project_license>
+  <metadata_license>CC0-1.0</metadata_license>
+  <update_contact>tingping_AT_fedoraproject.org</update_contact>
+</component>
\ No newline at end of file
diff --git a/data/misc/meson.build b/data/misc/meson.build
index bce952a7..26b037ce 100644
--- a/data/misc/meson.build
+++ b/data/misc/meson.build
@@ -1,4 +1,5 @@
 appdir = join_paths(get_option('datadir'), 'applications')
+metainfodir = join_paths(get_option('datadir'), 'metainfo')
 desktop_utils = find_program('desktop-file-validate', required: false)
 
 if get_option('with-gtk')
@@ -7,7 +8,7 @@ if get_option('with-gtk')
     output: 'io.github.Hexchat.appdata.xml',
     po_dir: '../../po',
     install: true,
-    install_dir: join_paths(get_option('datadir'), 'metainfo')
+    install_dir: metainfodir
   )
 
   appstream_util = find_program('appstream-util', required: false)
@@ -66,3 +67,59 @@ if get_option('with-theme-manager')
     install_dir: join_paths(get_option('datadir'), 'mime/packages')
   )
 endif
+
+if get_option('with-plugin')
+  plugin_metainfo = []
+
+  # FIXME: These should all get translated somewhere
+  if get_option('with-checksum')
+    plugin_metainfo += [
+      ['Checksum', 'Calculates a checksum for all sent and recieved DCC files']
+    ]
+  endif
+
+  if get_option('with-fishlim')
+    plugin_metainfo += [
+      ['Fishlim', 'Allows setting a key for encrypted conversations']
+    ]
+  endif
+
+  if get_option('with-lua') != 'false'
+    plugin_metainfo += [
+      ['Lua', 'Provides a scripting interface in Lua']
+    ]
+  endif
+
+  if get_option('with-perl')
+    plugin_metainfo += [
+      ['Perl', 'Provides a scripting interface in Perl']
+    ]
+  endif
+
+  if get_option('with-python') != 'false'
+    plugin_metainfo += [
+      ['Python', 'Provides a scripting interface in Python']
+    ]
+  endif
+
+  if get_option('with-sysinfo')
+    plugin_metainfo += [
+      ['Sysinfo', 'Adds command to display system information']
+    ]
+  endif
+
+  foreach metainfo : plugin_metainfo
+    name = metainfo[0]
+    desc = metainfo[1]
+    conf = configuration_data()
+    conf.set('NAME', name)
+    conf.set('SUMMARY', desc)
+
+    configure_file(
+      input: 'io.github.Hexchat.Plugin.metainfo.xml.in',
+      output: 'io.github.Hexchat.Plugin.@0@.metainfo.xml'.format(name),
+      configuration: conf,
+      install_dir: get_option('install-plugin-metainfo') ? metainfodir : '',
+    )
+  endforeach
+endif
\ No newline at end of file
diff --git a/meson_options.txt b/meson_options.txt
index d132dfc1..9b5d620b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -57,3 +57,6 @@ option('with-upd', type: 'boolean',
 option('with-winamp', type: 'boolean',
   description: 'Winamp plugin, Windows only'
 )
+option('install-plugin-metainfo', type: 'boolean', value: false,
+  description: 'Installs metainfo files for enabled plugins, useful when distros create split packages'
+)