Prevent AppStream validation error `asv-cid-desktopapp-is-not-rdns`

See https://github.com/Martchus/syncthingtray/issues/158
This commit is contained in:
Martchus 2022-10-11 20:05:02 +02:00
parent fdd6af1b2c
commit da431580d4
2 changed files with 14 additions and 1 deletions

View File

@ -174,6 +174,19 @@ if (NOT META_PROJECT_LICENSE)
endif ()
endif ()
# determine RDNS automatically from other meta-data
if (NOT META_PROJECT_RDNS)
if (NOT META_PROJECT_RDNS_BASE)
if (META_APP_URL MATCHES ".*github\\.com.*")
set(META_PROJECT_RDNS_BASE "io.github") # assume GitHub pages
else ()
set(META_PROJECT_RDNS_BASE "org")
endif ()
endif ()
string(TOLOWER "${META_APP_AUTHOR}" META_APP_AUTHOR_LOWER)
set(META_PROJECT_RDNS "${META_PROJECT_RDNS_BASE}.${META_APP_AUTHOR_LOWER}.${META_PROJECT_NAME}${TARGET_SUFFIX}")
endif ()
# provide variables for other projects built as part of the same subdirs project to access files from this project
get_directory_property(HAS_PARENT PARENT_DIRECTORY)
if (HAS_PARENT)

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop-application">
<id>@META_ID@</id>
<id>@META_PROJECT_RDNS@</id>
<metadata_license>MIT</metadata_license>
<project_license>@META_PROJECT_LICENSE@</project_license>
<name>@META_APP_NAME@</name>