build: Add metainfo files for addons

This commit is contained in:
Patrick Griffis 2018-03-17 01:21:50 -04:00
parent dc483b2342
commit 8a875afad0
3 changed files with 72 additions and 1 deletions

View File

@ -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>

View File

@ -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

View File

@ -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'
)