Skip to content

Commit

Permalink
Add human-readable name & summary to Flatpak manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
wjt committed Nov 10, 2023
1 parent 4420432 commit fcd9609
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion hooks/image/70-flatpak-manifest
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_data_for_ref(
date = commit_date_string(repo, commit)
version = installed_ref.get_appdata_version()

return key, {
data = {
'name': name,
'arch': arch,
'branch': branch,
Expand All @@ -61,6 +61,23 @@ def get_data_for_ref(
'version': version,
}

# TODO: It would be nice to consider EIB_FLATPAK_LOCALES and extract the
# name and summary in those locales too. Unfortunately while there is
# internal API to do this easily, it is not exposed by libflatpak.
#
# TODO: these function calls get the name in the current locale. We assume
# this is the C locale but it probably isn't.
appdata_name = installed_ref.get_appdata_name()
appdata_summary = installed_ref.get_appdata_summary()
if appdata_name or appdata_summary:
data['appdata'] = {'C': {}}
if appdata_name:
data['appdata']['C']['name'] = appdata_name
if appdata_summary:
data['appdata']['C']['summary'] = appdata_summary

return key, data


def main():
# Build the json data structure
Expand Down

0 comments on commit fcd9609

Please sign in to comment.