diff --git a/.github/workflows/rolling-release.yml b/.github/workflows/rolling-release.yml index 12dd53070..c982e1f99 100644 --- a/.github/workflows/rolling-release.yml +++ b/.github/workflows/rolling-release.yml @@ -295,14 +295,14 @@ jobs: run: flatpak-builder-lint appstream scripts/flatpak/org.duckstation.DuckStation.metainfo.xml - name: Validate manifest - run: flatpak-builder-lint manifest scripts/flatpak/org.duckstation.DuckStation.json + run: flatpak-builder-lint manifest scripts/flatpak/org.duckstation.DuckStation.yaml - name: Build Flatpak uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8 with: bundle: duckstation-x64.flatpak upload-artifact: false - manifest-path: scripts/flatpak/org.duckstation.DuckStation.json + manifest-path: scripts/flatpak/org.duckstation.DuckStation.yaml arch: x86_64 build-bundle: true verbose: true @@ -310,7 +310,7 @@ jobs: branch: stable cache: true restore-cache: true - cache-key: flatpak-x64-${{ hashFiles('scripts/flatpak/**/*.json') }} + cache-key: flatpak-x64-${{ hashFiles('scripts/flatpak/**/*.yaml') }} - name: Push to Flathub stable if: github.ref == 'refs/heads/dev' diff --git a/scripts/flatpak/modules/20-sdl2.json b/scripts/flatpak/modules/20-sdl2.json deleted file mode 100644 index 17b4dd7b8..000000000 --- a/scripts/flatpak/modules/20-sdl2.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "sdl2", - "buildsystem": "cmake-ninja", - "builddir": true, - "config-opts": [ - "-DBUILD_SHARED_LIBS=ON", - "-DSDL_SHARED=ON", - "-DSDL_STATIC=OFF", - "-DSDL_TESTS=OFF" - ], - "build-options": { - "strip": true - }, - "sources": [ - { - "type": "archive", - "url": "https://github.com/libsdl-org/SDL/releases/download/release-2.30.6/SDL2-2.30.6.tar.gz", - "sha256": "c6ef64ca18a19d13df6eb22df9aff19fb0db65610a74cc81dae33a82235cacd4" - } - ], - "cleanup": [ - "/bin", - "/include", - "/lib/*.a", - "/lib/*.la", - "/lib/cmake", - "/lib/pkgconfig", - "/share/aclocal" - ] -} diff --git a/scripts/flatpak/modules/20-sdl2.yaml b/scripts/flatpak/modules/20-sdl2.yaml new file mode 100644 index 000000000..ed95c7892 --- /dev/null +++ b/scripts/flatpak/modules/20-sdl2.yaml @@ -0,0 +1,23 @@ +name: sdl2 +buildsystem: cmake-ninja +builddir: true +config-opts: + - "-DCMAKE_BUILD_TYPE=Release" + - "-DBUILD_SHARED_LIBS=ON" + - "-DSDL_SHARED=ON" + - "-DSDL_STATIC=OFF" + - "-DSDL_TESTS=OFF" +build-options: + strip: true +sources: + - type: archive + url: "https://github.com/libsdl-org/SDL/releases/download/release-2.30.6/SDL2-2.30.6.tar.gz" + sha256: "c6ef64ca18a19d13df6eb22df9aff19fb0db65610a74cc81dae33a82235cacd4" +cleanup: + - /bin + - /include + - /lib/*.a + - /lib/*.la + - /lib/cmake + - /lib/pkgconfig + - /share/aclocal diff --git a/scripts/flatpak/modules/21-libbacktrace.json b/scripts/flatpak/modules/21-libbacktrace.json deleted file mode 100644 index 6cfdde6d9..000000000 --- a/scripts/flatpak/modules/21-libbacktrace.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "libbacktrace", - "buildsystem": "autotools", - "no-autogen": true, - "build-options": { - "strip": false, - "no-debuginfo": true - }, - "sources": [ - { - "type": "git", - "url": "https://github.com/ianlancetaylor/libbacktrace.git", - "commit": "ad106d5fdd5d960bd33fae1c48a351af567fd075" - } - ], - "cleanup": [ - "/include", - "/lib/*.a", - "/lib/*.la" - ] -} diff --git a/scripts/flatpak/modules/21-libbacktrace.yaml b/scripts/flatpak/modules/21-libbacktrace.yaml new file mode 100644 index 000000000..3003bbfed --- /dev/null +++ b/scripts/flatpak/modules/21-libbacktrace.yaml @@ -0,0 +1,14 @@ +name: libbacktrace +buildsystem: autotools +no-autogen: true +build-options: + strip: false + no-debuginfo: true +sources: + - type: git + url: "https://github.com/ianlancetaylor/libbacktrace.git" + commit: "ad106d5fdd5d960bd33fae1c48a351af567fd075" +cleanup: + - /include + - /lib/*.a + - /lib/*.la diff --git a/scripts/flatpak/modules/22-shaderc.json b/scripts/flatpak/modules/22-shaderc.json deleted file mode 100644 index a64cd2e22..000000000 --- a/scripts/flatpak/modules/22-shaderc.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "shaderc", - "buildsystem": "cmake-ninja", - "builddir": true, - "config-opts": [ - "-DCMAKE_BUILD_TYPE=Release", - "-DSHADERC_SKIP_TESTS=ON", - "-DSHADERC_SKIP_EXAMPLES=ON", - "-DSHADERC_SKIP_COPYRIGHT_CHECK=ON" - ], - "build-options": { - "strip": true - }, - "sources": [ - { - "type": "git", - "url": "https://github.com/stenzek/shaderc.git", - "commit": "feb2460bf3a504d67011246edeb810c45ea58826" - } - ], - "cleanup": [ - "/bin", - "/include", - "/lib/*.a", - "/lib/*.la", - "/lib/cmake", - "/lib/pkgconfig" - ] -} diff --git a/scripts/flatpak/modules/22-shaderc.yaml b/scripts/flatpak/modules/22-shaderc.yaml new file mode 100644 index 000000000..b31be4233 --- /dev/null +++ b/scripts/flatpak/modules/22-shaderc.yaml @@ -0,0 +1,21 @@ +name: shaderc +buildsystem: cmake-ninja +builddir: true +config-opts: + - "-DCMAKE_BUILD_TYPE=Release" + - "-DSHADERC_SKIP_TESTS=ON" + - "-DSHADERC_SKIP_EXAMPLES=ON" + - "-DSHADERC_SKIP_COPYRIGHT_CHECK=ON" +build-options: + strip: true +sources: + - type: git + url: "https://github.com/stenzek/shaderc.git" + commit: "feb2460bf3a504d67011246edeb810c45ea58826" +cleanup: + - /bin + - /include + - /lib/*.a + - /lib/*.la + - /lib/cmake + - /lib/pkgconfig diff --git a/scripts/flatpak/modules/23-spirv-cross.json b/scripts/flatpak/modules/23-spirv-cross.json deleted file mode 100644 index 2aa8c9024..000000000 --- a/scripts/flatpak/modules/23-spirv-cross.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "spirv-cross", - "buildsystem": "cmake-ninja", - "builddir": true, - "config-opts": [ - "-DCMAKE_BUILD_TYPE=Release", - "-DSPIRV_CROSS_SHARED=ON", - "-DSPIRV_CROSS_STATIC=OFF", - "-DSPIRV_CROSS_CLI=OFF", - "-DSPIRV_CROSS_ENABLE_TESTS=OFF", - "-DSPIRV_CROSS_ENABLE_GLSL=ON", - "-DSPIRV_CROSS_ENABLE_HLSL=OFF", - "-DSPIRV_CROSS_ENABLE_MSL=OFF", - "-DSPIRV_CROSS_ENABLE_CPP=OFF", - "-DSPIRV_CROSS_ENABLE_REFLECT=OFF", - "-DSPIRV_CROSS_ENABLE_C_API=ON", - "-DSPIRV_CROSS_ENABLE_UTIL=ON" - ], - "build-options": { - "strip": true - }, - "sources": [ - { - "type": "git", - "url": "https://github.com/KhronosGroup/SPIRV-Cross.git", - "tag": "vulkan-sdk-1.3.290.0", - "commit": "5d127b917f080c6f052553c47170ec0ba702e54f" - } - ], - "cleanup": [ - "/bin", - "/include", - "/lib/*.a", - "/lib/*.la", - "/lib/cmake", - "/lib/pkgconfig", - "/share" - ] -} diff --git a/scripts/flatpak/modules/23-spirv-cross.yaml b/scripts/flatpak/modules/23-spirv-cross.yaml new file mode 100644 index 000000000..d5bb025dd --- /dev/null +++ b/scripts/flatpak/modules/23-spirv-cross.yaml @@ -0,0 +1,31 @@ +name: spirv-cross +buildsystem: cmake-ninja +builddir: true +config-opts: + - "-DCMAKE_BUILD_TYPE=Release" + - "-DSPIRV_CROSS_SHARED=ON" + - "-DSPIRV_CROSS_STATIC=OFF" + - "-DSPIRV_CROSS_CLI=OFF" + - "-DSPIRV_CROSS_ENABLE_TESTS=OFF" + - "-DSPIRV_CROSS_ENABLE_GLSL=ON" + - "-DSPIRV_CROSS_ENABLE_HLSL=OFF" + - "-DSPIRV_CROSS_ENABLE_MSL=OFF" + - "-DSPIRV_CROSS_ENABLE_CPP=OFF" + - "-DSPIRV_CROSS_ENABLE_REFLECT=OFF" + - "-DSPIRV_CROSS_ENABLE_C_API=ON" + - "-DSPIRV_CROSS_ENABLE_UTIL=ON" +build-options: + strip: true +sources: + - type: git + url: "https://github.com/KhronosGroup/SPIRV-Cross.git" + tag: "vulkan-sdk-1.3.290.0" + commit: "5d127b917f080c6f052553c47170ec0ba702e54f" +cleanup: + - /bin + - /include + - /lib/*.a + - /lib/*.la + - /lib/cmake + - /lib/pkgconfig + - /share diff --git a/scripts/flatpak/modules/24-cpuinfo.json b/scripts/flatpak/modules/24-cpuinfo.json deleted file mode 100644 index f2feebdbb..000000000 --- a/scripts/flatpak/modules/24-cpuinfo.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "cpuinfo", - "buildsystem": "cmake-ninja", - "builddir": true, - "config-opts": [ - "-DCMAKE_BUILD_TYPE=Release", - "-DCPUINFO_LIBRARY_TYPE=shared", - "-DCPUINFO_RUNTIME_TYPE=shared", - "-DCPUINFO_LOG_LEVEL=error", - "-DCPUINFO_LOG_TO_STDIO=ON", - "-DCPUINFO_BUILD_TOOLS=OFF", - "-DCPUINFO_BUILD_UNIT_TESTS=OFF", - "-DCPUINFO_BUILD_MOCK_TESTS=OFF", - "-DCPUINFO_BUILD_BENCHMARKS=OFF", - "-DUSE_SYSTEM_LIBS=ON" - ], - "build-options": { - "strip": true - }, - "sources": [ - { - "type": "git", - "url": "https://github.com/stenzek/cpuinfo.git", - "commit": "7524ad504fdcfcf75a18a133da6abd75c5d48053" - } - ], - "cleanup": [ - "/bin", - "/include", - "/lib/*.a", - "/lib/*.la", - "/lib/cmake", - "/lib/pkgconfig", - "/share" - ] -} diff --git a/scripts/flatpak/modules/24-cpuinfo.yaml b/scripts/flatpak/modules/24-cpuinfo.yaml new file mode 100644 index 000000000..08fa8a142 --- /dev/null +++ b/scripts/flatpak/modules/24-cpuinfo.yaml @@ -0,0 +1,28 @@ +name: cpuinfo +buildsystem: cmake-ninja +builddir: true +config-opts: + - "-DCMAKE_BUILD_TYPE=Release" + - "-DCPUINFO_LIBRARY_TYPE=shared" + - "-DCPUINFO_RUNTIME_TYPE=shared" + - "-DCPUINFO_LOG_LEVEL=error" + - "-DCPUINFO_LOG_TO_STDIO=ON" + - "-DCPUINFO_BUILD_TOOLS=OFF" + - "-DCPUINFO_BUILD_UNIT_TESTS=OFF" + - "-DCPUINFO_BUILD_MOCK_TESTS=OFF" + - "-DCPUINFO_BUILD_BENCHMARKS=OFF" + - "-DUSE_SYSTEM_LIBS=ON" +build-options: + strip: true +sources: + - type: git + url: "https://github.com/stenzek/cpuinfo.git" + commit: "7524ad504fdcfcf75a18a133da6abd75c5d48053" +cleanup: + - /bin + - /include + - /lib/*.a + - /lib/*.la + - /lib/cmake + - /lib/pkgconfig + - /share diff --git a/scripts/flatpak/modules/25-discord-rpc.json b/scripts/flatpak/modules/25-discord-rpc.json deleted file mode 100644 index 17df062af..000000000 --- a/scripts/flatpak/modules/25-discord-rpc.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "discord-rpc", - "buildsystem": "cmake-ninja", - "builddir": true, - "config-opts": [ - "-DCMAKE_BUILD_TYPE=Release", - "-DBUILD_SHARED_LIBS=ON" - ], - "build-options": { - "strip": true - }, - "sources": [ - { - "type": "git", - "url": "https://github.com/stenzek/discord-rpc.git", - "commit": "144f3a3f1209994d8d9e8a87964a989cb9911c1e" - } - ], - "cleanup": [ - "/bin", - "/include", - "/lib/*.a", - "/lib/*.la", - "/lib/cmake", - "/lib/pkgconfig", - "/share" - ] -} diff --git a/scripts/flatpak/modules/25-discord-rpc.yaml b/scripts/flatpak/modules/25-discord-rpc.yaml new file mode 100644 index 000000000..85ba54043 --- /dev/null +++ b/scripts/flatpak/modules/25-discord-rpc.yaml @@ -0,0 +1,20 @@ +name: discord-rpc +buildsystem: cmake-ninja +builddir: true +config-opts: + - "-DCMAKE_BUILD_TYPE=Release" + - "-DBUILD_SHARED_LIBS=ON" +build-options: + strip: true +sources: + - type: git + url: "https://github.com/stenzek/discord-rpc.git" + commit: "144f3a3f1209994d8d9e8a87964a989cb9911c1e" +cleanup: + - /bin + - /include + - /lib/*.a + - /lib/*.la + - /lib/cmake + - /lib/pkgconfig + - /share diff --git a/scripts/flatpak/modules/26-soundtouch.json b/scripts/flatpak/modules/26-soundtouch.json deleted file mode 100644 index 279e85cff..000000000 --- a/scripts/flatpak/modules/26-soundtouch.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "soundtouch", - "buildsystem": "cmake-ninja", - "builddir": true, - "config-opts": [ - "-DCMAKE_BUILD_TYPE=Release", - "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" - ], - "build-options": { - "strip": true - }, - "sources": [ - { - "type": "git", - "url": "https://github.com/stenzek/soundtouch.git", - "commit": "463ade388f3a51da078dc9ed062bf28e4ba29da7" - } - ], - "cleanup": [ - "/bin", - "/include", - "/lib/*.a", - "/lib/*.la", - "/lib/cmake", - "/lib/pkgconfig", - "/share" - ] -} diff --git a/scripts/flatpak/modules/26-soundtouch.yaml b/scripts/flatpak/modules/26-soundtouch.yaml new file mode 100644 index 000000000..e7503d203 --- /dev/null +++ b/scripts/flatpak/modules/26-soundtouch.yaml @@ -0,0 +1,27 @@ +name: soundtouch +buildsystem: cmake-ninja +builddir: true +config-opts: + - "-DCMAKE_BUILD_TYPE=Release" + + # Use clang with LTO for speed. + - "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" + - "-DCMAKE_C_COMPILER=/usr/lib/sdk/llvm17/bin/clang" + - "-DCMAKE_CXX_COMPILER=/usr/lib/sdk/llvm17/bin/clang++" + - "-DCMAKE_EXE_LINKER_FLAGS_INIT=-fuse-ld=lld" + - "-DCMAKE_MODULE_LINKER_FLAGS_INIT=-fuse-ld=lld" + - "-DCMAKE_SHARED_LINKER_FLAGS_INIT=-fuse-ld=lld" +build-options: + strip: true +sources: + - type: git + url: "https://github.com/stenzek/soundtouch.git" + commit: "463ade388f3a51da078dc9ed062bf28e4ba29da7" +cleanup: + - /bin + - /include + - /lib/*.a + - /lib/*.la + - /lib/cmake + - /lib/pkgconfig + - /share diff --git a/scripts/flatpak/org.duckstation.DuckStation.json b/scripts/flatpak/org.duckstation.DuckStation.json deleted file mode 100644 index 3a69df210..000000000 --- a/scripts/flatpak/org.duckstation.DuckStation.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app-id": "org.duckstation.DuckStation", - "runtime": "org.kde.Platform", - "runtime-version": "6.7", - "sdk": "org.kde.Sdk", - "sdk-extensions": [ - "org.freedesktop.Sdk.Extension.llvm17" - ], - "command": "duckstation-qt", - "finish-args": [ - "--device=all", - "--allow=bluetooth", - "--share=network", - "--share=ipc", - "--socket=x11", - "--socket=pulseaudio", - "--talk-name=org.freedesktop.ScreenSaver", - "--env=QT_QPA_PLATFORM=xcb" - ], - "modules": [ - "modules/20-sdl2.json", - "modules/21-libbacktrace.json", - "modules/22-shaderc.json", - "modules/23-spirv-cross.json", - "modules/24-cpuinfo.json", - "modules/25-discord-rpc.json", - "modules/26-soundtouch.json", - { - "name": "duckstation", - "buildsystem": "cmake-ninja", - "builddir": true, - "no-make-install": true, - "build-options": { - "strip": false, - "no-debuginfo": true, - "cflags": "", - "cflags-override": true, - "cxxflags": "", - "cxxflags-override": true, - "config-opts": [ - "-DCMAKE_BUILD_TYPE=Release", - "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON", - "-DBUILD_NOGUI_FRONTEND=OFF", - "-DBUILD_QT_FRONTEND=ON", - "-DBUILD_TESTS=OFF", - "-DCMAKE_C_COMPILER=/usr/lib/sdk/llvm17/bin/clang", - "-DCMAKE_CXX_COMPILER=/usr/lib/sdk/llvm17/bin/clang++", - "-DCMAKE_EXE_LINKER_FLAGS_INIT=-fuse-ld=lld", - "-DCMAKE_MODULE_LINKER_FLAGS_INIT=-fuse-ld=lld", - "-DCMAKE_SHARED_LINKER_FLAGS_INIT=-fuse-ld=lld" - ] - }, - "sources": [ - { - "type": "dir", - "path": "../.." - } - ], - "post-install": [ - "cp -a bin \"${FLATPAK_DEST}\"", - "install -Dm644 \"${FLATPAK_BUILDER_BUILDDIR}/scripts/org.duckstation.DuckStation.png\" \"${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/org.duckstation.DuckStation.png\"", - "install -Dm644 \"${FLATPAK_BUILDER_BUILDDIR}/scripts/org.duckstation.DuckStation.desktop\" \"${FLATPAK_DEST}/share/applications/org.duckstation.DuckStation.desktop\"", - "install -Dm644 \"${FLATPAK_BUILDER_BUILDDIR}/scripts/flatpak/org.duckstation.DuckStation.metainfo.xml\" \"${FLATPAK_DEST}/share/metainfo/org.duckstation.DuckStation.metainfo.xml\"" - ] - } - ] -} diff --git a/scripts/flatpak/org.duckstation.DuckStation.yaml b/scripts/flatpak/org.duckstation.DuckStation.yaml new file mode 100644 index 000000000..65ba9a970 --- /dev/null +++ b/scripts/flatpak/org.duckstation.DuckStation.yaml @@ -0,0 +1,82 @@ +app-id: "org.duckstation.DuckStation" +runtime: "org.kde.Platform" +runtime-version: "6.7" +sdk: "org.kde.Sdk" +sdk-extensions: + - "org.freedesktop.Sdk.Extension.llvm17" + +command: "duckstation-qt" + +finish-args: + - "--device=all" + - "--allow=bluetooth" + - "--share=network" + - "--share=ipc" + - "--socket=pulseaudio" + - "--talk-name=org.freedesktop.ScreenSaver" + + # Wayland is disabled due to various QtWayland issues, causing broken UI. + - "--socket=x11" + - "--env=QT_QPA_PLATFORM=xcb" + +modules: + # Dependencies. + - "modules/20-sdl2.yaml" + - "modules/21-libbacktrace.yaml" + - "modules/22-shaderc.yaml" + - "modules/23-spirv-cross.yaml" + - "modules/24-cpuinfo.yaml" + - "modules/25-discord-rpc.yaml" + - "modules/26-soundtouch.yaml" + + # Main module. + - name: duckstation + buildsystem: cmake-ninja + builddir: true + no-make-install: true + build-options: + # Preserve debug information, it is needed for backtraces. + strip: false + no-debuginfo: true + + # Prevent flatpak defaults of fortify etc from creeping in. + cflags: "" + cflags-override: true + cxxflags: "" + cxxflags-override: true + + config-opts: + # Flatpak build does not appear to default to Release. + - "-DCMAKE_BUILD_TYPE=Release" + + # We're not running tests as part of the flatpak build. + - '-DBUILD_TESTS=OFF' + + # Make sure we're using ThinLTO. + - "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" + - "-DCMAKE_C_COMPILER=/usr/lib/sdk/llvm17/bin/clang" + - "-DCMAKE_CXX_COMPILER=/usr/lib/sdk/llvm17/bin/clang++" + - "-DCMAKE_EXE_LINKER_FLAGS_INIT=-fuse-ld=lld" + - "-DCMAKE_MODULE_LINKER_FLAGS_INIT=-fuse-ld=lld" + - "-DCMAKE_SHARED_LINKER_FLAGS_INIT=-fuse-ld=lld" + sources: + - type: dir + path: ../.. + + post-install: + # Copy the binary distribution. + - "cp -a bin \"${FLATPAK_DEST}\"" + + # Manually copy desktop file/metadata, it's not done as part of the regular build. + - >- + install -Dm644 + "${FLATPAK_BUILDER_BUILDDIR}/scripts/org.duckstation.DuckStation.png" + "${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/org.duckstation.DuckStation.png" + - >- + install -Dm644 + "${FLATPAK_BUILDER_BUILDDIR}/scripts/org.duckstation.DuckStation.desktop" + "${FLATPAK_DEST}/share/applications/org.duckstation.DuckStation.desktop" + - >- + install -Dm644 + "${FLATPAK_BUILDER_BUILDDIR}/scripts/flatpak/org.duckstation.DuckStation.metainfo.xml" + "${FLATPAK_DEST}/share/metainfo/org.duckstation.DuckStation.metainfo.xml" diff --git a/scripts/org.duckstation.DuckStation.metainfo.xml.in b/scripts/org.duckstation.DuckStation.metainfo.xml.in index 435dbbb04..113daa92b 100644 --- a/scripts/org.duckstation.DuckStation.metainfo.xml.in +++ b/scripts/org.duckstation.DuckStation.metainfo.xml.in @@ -31,6 +31,6 @@ - https://raw.githubusercontent.com/stenzek/duckstation/@GIT_HASH@/scripts/flatpak/org.duckstation.DuckStation.json + https://raw.githubusercontent.com/stenzek/duckstation/@GIT_HASH@/scripts/flatpak/org.duckstation.DuckStation.yaml