瀏覽代碼

UI: Add Linux AppStream metadata

Peter Eszlari 6 年之前
父節點
當前提交
6b9da9b912

+ 1 - 3
UI/CMakeLists.txt

@@ -378,9 +378,7 @@ install_obs_data(obs data obs-studio)
 install_obs_data_file(obs ../AUTHORS obs-studio/authors)
 
 if (UNIX AND UNIX_STRUCTURE AND NOT APPLE)
-	install(FILES dist/obs.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
-	install(FILES forms/images/obs.png
-		DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/icons/hicolor/256x256/apps)
+	add_subdirectory(xdg-data)
 endif()
 
 add_subdirectory(frontend-plugins)

+ 24 - 0
UI/xdg-data/CMakeLists.txt

@@ -0,0 +1,24 @@
+if(NOT DEFINED APPDATA_RELEASE_DATE)
+	if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
+		execute_process(COMMAND git log --tags -1 --pretty=%cd --date=short
+			OUTPUT_VARIABLE APPDATA_RELEASE_DATE
+			WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+			OUTPUT_STRIP_TRAILING_WHITESPACE)
+	else()
+		file(TIMESTAMP "${CMAKE_SOURCE_DIR}/CMakeLists.txt" APPDATA_RELEASE_DATE "%Y-%m-%d")
+	endif()
+endif()
+
+configure_file(
+	com.obsproject.Studio.appdata.xml.in
+	com.obsproject.Studio.appdata.xml)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/com.obsproject.Studio.appdata.xml
+	DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+
+install(FILES com.obsproject.Studio.desktop
+	DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+
+install(FILES ../forms/images/obs.png
+	DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps
+	RENAME com.obsproject.Studio.png)

+ 23 - 0
UI/xdg-data/com.obsproject.Studio.appdata.xml.in

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="desktop">
+  <id>com.obsproject.Studio</id>
+  <launchable type="desktop-id">com.obsproject.Studio.desktop</launchable>
+  <metadata_license>CC0-1.0</metadata_license>
+  <project_license>GPL-2.0</project_license>
+  <name>OBS Studio</name>
+  <developer_name>OBS Project</developer_name>
+  <summary>Live streaming and video recording software</summary>
+  <description>
+    <p>Free and open source software for video capturing, recording, and live streaming.</p>
+  </description>
+  <url type="homepage">https://obsproject.com</url>
+  <screenshots>
+    <screenshot type="default">
+      <image>https://obsproject.com/assets/images/OBSDemoApp.jpg</image>
+    </screenshot>
+  </screenshots>
+  <content_rating type="oars-1.1"/>
+  <releases>
+    <release version="@OBS_VERSION@" date="@APPDATA_RELEASE_DATE@"/>
+  </releases>
+</component>

+ 1 - 1
UI/dist/obs.desktop → UI/xdg-data/com.obsproject.Studio.desktop

@@ -7,7 +7,7 @@ Comment=Free and Open Source Streaming/Recording Software
 Comment[fr]=Logiciel libre d'enregistrement et de diffusion sur Internet
 Comment[ru]=Бесплатная программа с открытым кодом для записи/трансляции видео
 Exec=obs
-Icon=obs
+Icon=com.obsproject.Studio
 Terminal=false
 Type=Application
 Categories=AudioVideo;Recorder;