Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AppStream Metainfo generation #3340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions res/io.mgba.mGBA.metainfo.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version='1.0' encoding='utf-8'?>
<component type="desktop">
<id>io.mgba.mGBA</id>
<name>mGBA</name>
<summary>Nintendo Game Boy Advance Emulator</summary>
<developer_name>endrift</developer_name>
<launchable type="desktop-id">io.mgba.mGBA.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MPL-2.0</project_license>
<description>
<p>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.</p>
<p xml:lang="de">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.</p>
<p xml:lang="es">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.</p>
<p xml:lang="zh_CN">mGBA 是一个运行 Game Boy Advance 游戏的模拟器。mGBA 的目标是比众多现有的 Game Boy Advance 模拟器更快、更准确,并增加其他模拟器所缺少的功能。mGBA 还支持 Game Boy 和 Game Boy Color 游戏。</p>
</description>
@APPSTREAM_RELEASES@
<url type="homepage">https://mgba.io</url>
<url type="bugtracker">https://github.com/mgba-emu/mgba/issues</url>
<url type="faq">https://mgba.io/faq.html</url>
<url type="donation">https://patreon.com/mgba</url>
<url type="translate">https://hosted.weblate.org/engage/mgba</url>
<url type="vcs-browser">https://github.com/mgba-emu</url>
<url type="contribute">https://github.com/mgba-emu/mgba/blob/master/CONTRIBUTING.md</url>
<categories>
<category>Game</category>
<category>Emulator</category>
</categories>
<supports>
<control>pointing</control>
<control>keyboard</control>
<control>gamepad</control>
</supports>
<content_rating type="oars-1.1"/>
<provides>
<binary>mgba</binary>
<binary>mgba-qt</binary>
<mediatype>application/x-gameboy-advance-rom</mediatype>
<mediatype>application/x-agb-rom</mediatype>
<mediatype>application/x-gba-rom</mediatype>
</provides>
<keywords>
<keyword>emulator</keyword>
<keyword>Nintendo</keyword>
<keyword>advance</keyword>
<keyword>gba</keyword>
<keyword>Game Boy Advance</keyword>
</keywords>
</component>
29 changes: 29 additions & 0 deletions src/platform/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<release version=\"${TAG_REF}\" date=\"${TAG_DATE}\" />")
endforeach()

list(LENGTH RELEASE_LIST RELEASE_COUNT)
if (NOT RELEASE_COUNT EQUAL 0)
list(JOIN RELEASE_LIST "\n" RELEASE_STR)
set(APPSTREAM_RELEASES "<releases>\n${RELEASE_STR}\n</releases>")
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)
Expand Down