From 88ff54ac3a89efb19796099eadc668cee7edce05 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Fri, 1 Nov 2024 21:45:29 +0100 Subject: [PATCH] Add AppStream Metainfo generation --- res/io.mgba.mGBA.metainfo.xml.in | 48 ++++++++++++++++++++++++++++++++ src/platform/qt/CMakeLists.txt | 29 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 res/io.mgba.mGBA.metainfo.xml.in diff --git a/res/io.mgba.mGBA.metainfo.xml.in b/res/io.mgba.mGBA.metainfo.xml.in new file mode 100644 index 00000000000..b4fdd55ded0 --- /dev/null +++ b/res/io.mgba.mGBA.metainfo.xml.in @@ -0,0 +1,48 @@ + + + io.mgba.mGBA + mGBA + Nintendo Game Boy Advance Emulator + endrift + io.mgba.mGBA.desktop + CC0-1.0 + MPL-2.0 + +

mGBA is an emulator for running Game Boy Advance games. It aims to be faster and more accurate than many existing Game Boy Advance emulators, as well as adding features that other emulators lack. It also supports Game Boy and Game Boy Color games.

+

mGBA ist ein Emulator für Game Boy Advance-Spiele. Das Ziel von mGBA ist, schneller und genauer als viele existierende Game Boy Advance-Emulatoren zu sein. Außerdem verfügt mGBA über Funktionen, die anderen Emulatoren fehlen. Zusätzlich werden auch Game Boy- und Game Boy Color-Spiele unterstützt.

+

mGBA es un emulador para juegos de Game Boy Advance. Su objetivo es ser más rápido y más preciso que muchos emuladores de Game Boy Advance existentes, además de añadir funciones que otros emuladores no tienen. También es compatible con juegos de Game Boy y Game Boy Color.

+

mGBA 是一个运行 Game Boy Advance 游戏的模拟器。mGBA 的目标是比众多现有的 Game Boy Advance 模拟器更快、更准确,并增加其他模拟器所缺少的功能。mGBA 还支持 Game Boy 和 Game Boy Color 游戏。

+
+ @APPSTREAM_RELEASES@ + https://mgba.io + https://github.com/mgba-emu/mgba/issues + https://mgba.io/faq.html + https://patreon.com/mgba + https://hosted.weblate.org/engage/mgba + https://github.com/mgba-emu + https://github.com/mgba-emu/mgba/blob/master/CONTRIBUTING.md + + Game + Emulator + + + pointing + keyboard + gamepad + + + + mgba + mgba-qt + application/x-gameboy-advance-rom + application/x-agb-rom + application/x-gba-rom + + + emulator + Nintendo + advance + gba + Game Boy Advance + +
diff --git a/src/platform/qt/CMakeLists.txt b/src/platform/qt/CMakeLists.txt index 3cfe83ad0e6..a63ea23812d 100644 --- a/src/platform/qt/CMakeLists.txt +++ b/src/platform/qt/CMakeLists.txt @@ -471,6 +471,35 @@ set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}" PARENT_SCOPE) if(UNIX AND NOT APPLE) install(FILES ${PROJECT_SOURCE_DIR}/res/mgba-qt.desktop DESTINATION share/applications RENAME io.mgba.${PROJECT_NAME}.desktop COMPONENT ${BINARY_NAME}-qt) + + set(APPSTREAM_RELEASES "") + find_program(GIT git) + if(GIT AND NOT SKIP_GIT) + execute_process(COMMAND ${GIT} tag -l --sort=-version:refname "--format=%(refname:strip=2) %(creatordate:short)" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE RELEASE_TAGS OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REPLACE "\n" ";" TAGS_LIST ${RELEASE_TAGS}) + foreach(TAG ${TAGS_LIST}) + string(REPLACE " " ";" TAG_LIST ${TAG}) + list(GET TAG_LIST 0 TAG_REF) + list(GET TAG_LIST 1 TAG_DATE) + + # Check dash usually signifies an alpha or a beta tag + string(FIND ${TAG_REF} "-" TAG_UNSTABLE) + + if (NOT ${TAG_UNSTABLE} EQUAL -1) + continue() + endif() + list(APPEND RELEASE_LIST "") + endforeach() + + list(LENGTH RELEASE_LIST RELEASE_COUNT) + if (NOT RELEASE_COUNT EQUAL 0) + list(JOIN RELEASE_LIST "\n" RELEASE_STR) + set(APPSTREAM_RELEASES "\n${RELEASE_STR}\n") + endif() + endif() + message(${CMAKE_SOURCE_DIR}/res/io.mgba.mGBA.metainfo.xml.in ) + configure_file(${CMAKE_SOURCE_DIR}/res/io.mgba.mGBA.metainfo.xml.in ${CMAKE_CURRENT_BINARY_DIR}/io.mgba.mGBA.metainfo.xml) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/io.mgba.mGBA.metainfo.xml DESTINATION share/metainfo COMPONENT ${BINARY_NAME}-qt) endif() if(UNIX AND NOT (APPLE AND DISTBUILD)) install(FILES ${PROJECT_SOURCE_DIR}/doc/mgba-qt.6 DESTINATION ${MANDIR}/man6 COMPONENT ${BINARY_NAME}-qt)