From 89016834cf728ed6c5afbc88de399e8f2bf7240e Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Tue, 12 Nov 2024 16:07:27 -0500 Subject: [PATCH 1/3] Flatpak: Don't do an in-tree build --- Flatpak/fill_release_node.sh | 4 ++-- Flatpak/org.DolphinEmu.dolphin-emu.yml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Flatpak/fill_release_node.sh b/Flatpak/fill_release_node.sh index 43597fa920..60c547bc18 100755 --- a/Flatpak/fill_release_node.sh +++ b/Flatpak/fill_release_node.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash DATE=$(git log -1 --pretty=%cd --date=iso8601 --date=format:'%Y-%m-%d') -sed -i -e "s/@DATE_PLACEHOLDER/${DATE}/" org.DolphinEmu.dolphin-emu.metainfo.xml +sed -i -e "s/@DATE_PLACEHOLDER/${DATE}/" ../org.DolphinEmu.dolphin-emu.metainfo.xml VERSION=$(git describe --tags | sed -E 's/^([0-9]+-[0-9]+).*/\1/') -sed -i -e "s/@VERSION_PLACEHOLDER/${VERSION}/" org.DolphinEmu.dolphin-emu.metainfo.xml +sed -i -e "s/@VERSION_PLACEHOLDER/${VERSION}/" ../org.DolphinEmu.dolphin-emu.metainfo.xml diff --git a/Flatpak/org.DolphinEmu.dolphin-emu.yml b/Flatpak/org.DolphinEmu.dolphin-emu.yml index a1266b5df5..0c2ddca8c1 100644 --- a/Flatpak/org.DolphinEmu.dolphin-emu.yml +++ b/Flatpak/org.DolphinEmu.dolphin-emu.yml @@ -52,6 +52,7 @@ modules: - name: dolphin-emu buildsystem: cmake-ninja + builddir: true config-opts: - -DCMAKE_BUILD_TYPE=Release - -DENABLE_ALSA=OFF @@ -61,9 +62,9 @@ modules: cleanup: - /share/man post-install: - - install -D -t ${FLATPAK_DEST}/bin/ dolphin-emu-wrapper + - install -D -t ${FLATPAK_DEST}/bin/ ../dolphin-emu-wrapper - "${FLATPAK_BUILDER_BUILDDIR}/Flatpak/fill_release_node.sh" - - install -Dm644 -t ${FLATPAK_DEST}/share/metainfo/ org.DolphinEmu.dolphin-emu.metainfo.xml + - install -Dm644 -t ${FLATPAK_DEST}/share/metainfo/ ../org.DolphinEmu.dolphin-emu.metainfo.xml - desktop-file-edit --set-key=Exec --set-value='/app/bin/dolphin-emu-wrapper' /app/share/applications/dolphin-emu.desktop sources: From 4fc259710f68dc1efe3648dd359ff97ab473e41d Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Tue, 12 Nov 2024 16:11:32 -0500 Subject: [PATCH 2/3] Flatpak: Use ScmRevGen to generate metainfo XML --- CMake/ScmRevGen.cmake | 6 ++++++ CMakeLists.txt | 9 ++++++++- Flatpak/fill_release_node.sh | 8 -------- Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in | 2 +- Flatpak/org.DolphinEmu.dolphin-emu.yml | 6 +----- 5 files changed, 16 insertions(+), 15 deletions(-) delete mode 100755 Flatpak/fill_release_node.sh diff --git a/CMake/ScmRevGen.cmake b/CMake/ScmRevGen.cmake index d314d044e3..0da0b7b1fd 100644 --- a/CMake/ScmRevGen.cmake +++ b/CMake/ScmRevGen.cmake @@ -30,6 +30,8 @@ if(GIT_FOUND) ERROR_QUIET) endif() +string(TIMESTAMP DOLPHIN_WC_BUILD_DATE "%Y-%m-%d" UTC) + # version number set(DOLPHIN_VERSION_MAJOR "2412") set(DOLPHIN_VERSION_MINOR "0") @@ -67,3 +69,7 @@ configure_source_file("Source/Core/Common/scmrev.h") if(APPLE) configure_source_file("Source/Core/VersionInfo.plist") endif() + +if(LINUX) + configure_source_file("Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml") +endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 819ea04409..dda65408d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -789,6 +789,13 @@ if(APPLE) endif() endif() +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Flatpak) + if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml) + file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml) + endif() +endif() + find_package(Git) if(NOT GIT_FOUND) set(GIT_EXECUTABLE "") @@ -796,7 +803,7 @@ endif() add_custom_target( dolphin_scmrev ${CMAKE_COMMAND} -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} -DDISTRIBUTOR=${DISTRIBUTOR} -DDOLPHIN_DEFAULT_UPDATE_TRACK=${DOLPHIN_DEFAULT_UPDATE_TRACK} -DGIT_FOUND=${GIT_FOUND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DDOLPHIN_WC_REVISION=${DOLPHIN_WC_REVISION} -DDOLPHIN_WC_DESCRIBE=${DOLPHIN_WC_DESCRIBE} -DDOLPHIN_WC_BRANCH=${DOLPHIN_WC_BRANCH} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/ScmRevGen.cmake - BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/Common/scmrev.h" "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/DolphinQt/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/MacUpdater/Info.plist" + BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/Common/scmrev.h" "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/DolphinQt/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/Source/Core/MacUpdater/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml" VERBATIM ) diff --git a/Flatpak/fill_release_node.sh b/Flatpak/fill_release_node.sh deleted file mode 100755 index 60c547bc18..0000000000 --- a/Flatpak/fill_release_node.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -DATE=$(git log -1 --pretty=%cd --date=iso8601 --date=format:'%Y-%m-%d') -sed -i -e "s/@DATE_PLACEHOLDER/${DATE}/" ../org.DolphinEmu.dolphin-emu.metainfo.xml -VERSION=$(git describe --tags | sed -E 's/^([0-9]+-[0-9]+).*/\1/') -sed -i -e "s/@VERSION_PLACEHOLDER/${VERSION}/" ../org.DolphinEmu.dolphin-emu.metainfo.xml - - diff --git a/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in b/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in index e4e8c891a3..cd00055a12 100644 --- a/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in +++ b/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in @@ -36,7 +36,7 @@ dolphin-emu.desktop - + https://dolphin-emu.org https://bugs.dolphin-emu.org/projects/emulator/issues diff --git a/Flatpak/org.DolphinEmu.dolphin-emu.yml b/Flatpak/org.DolphinEmu.dolphin-emu.yml index 0c2ddca8c1..d014a62028 100644 --- a/Flatpak/org.DolphinEmu.dolphin-emu.yml +++ b/Flatpak/org.DolphinEmu.dolphin-emu.yml @@ -63,16 +63,12 @@ modules: - /share/man post-install: - install -D -t ${FLATPAK_DEST}/bin/ ../dolphin-emu-wrapper - - "${FLATPAK_BUILDER_BUILDDIR}/Flatpak/fill_release_node.sh" - - install -Dm644 -t ${FLATPAK_DEST}/share/metainfo/ ../org.DolphinEmu.dolphin-emu.metainfo.xml + - install -Dm644 -t ${FLATPAK_DEST}/share/metainfo/ Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml - desktop-file-edit --set-key=Exec --set-value='/app/bin/dolphin-emu-wrapper' /app/share/applications/dolphin-emu.desktop sources: - type: dir path: .. - - type: file - path: org.DolphinEmu.dolphin-emu.metainfo.xml.in - dest-filename: org.DolphinEmu.dolphin-emu.metainfo.xml - type: script commands: - | From 5578160880feeeaf78988ffa242f433e2fe7f289 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Tue, 7 Jan 2025 15:35:21 -0500 Subject: [PATCH 3/3] Flatpak: Include link to the manifest within the metainfo for Flathub --- Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in b/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in index cd00055a12..28e0cb370b 100644 --- a/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in +++ b/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in @@ -46,4 +46,7 @@ https://dolphin-emu.org/docs/faq/#ive-got-idea-make-dolphin-better-how-should-i-tell https://github.com/dolphin-emu/dolphin https://github.com/dolphin-emu/dolphin/blob/master/Contributing.md + + https://github.com/dolphin-emu/dolphin/blob/${DOLPHIN_WC_REVISION}/Flatpak/org.DolphinEmu.dolphin-emu.yml +