Browse Source

UI: Set flathub::manifest

Currently, the manifest URL on Flathub Beta website points to the
deprecated manifest hosted on Flathub. The flathub::manifest key
is undocumented attribute that will update the website to use the
proper location.

This key will not affect appstream other than providing enough
information to the Flathub website.
Bartłomiej Piotrowski 2 years ago
parent
commit
853ae5ea6e
2 changed files with 15 additions and 0 deletions
  1. 12 0
      UI/xdg-data/CMakeLists.txt
  2. 3 0
      UI/xdg-data/com.obsproject.Studio.appdata.xml.in

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

@@ -11,6 +11,18 @@ if(NOT DEFINED APPDATA_RELEASE_DATE)
   endif()
 endif()
 
+if(NOT DEFINED GIT_HASH)
+  if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
+    execute_process(
+      COMMAND git rev-parse HEAD
+      OUTPUT_VARIABLE GIT_HASH
+      WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  else()
+    set(GIT_HASH "master")
+  endif()
+endif()
+
 configure_file(com.obsproject.Studio.appdata.xml.in
                com.obsproject.Studio.appdata.xml)
 

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

@@ -43,4 +43,7 @@
   <releases>
     <release version="@OBS_VERSION@" date="@APPDATA_RELEASE_DATE@"/>
   </releases>
+  <custom>
+    <value key="flathub::manifest">https://github.com/obsproject/obs-studio/blob/@GIT_HASH@/CI/flatpak/com.obsproject.Studio.json</value>
+  </custom>
 </component>