Skip to content

Commit

Permalink
feat: add flatpak packaging
Browse files Browse the repository at this point in the history
- add flatpak manifest
- add build dirs to gitignore
- add flatpak build workflow job
- add update support for flatpak package

Co-authored-by: Quang Ngô <[email protected]>
Co-authored-by: Florian Piesche <[email protected]>
  • Loading branch information
3 people committed Jan 2, 2025
1 parent 596f4cd commit a3c0f0b
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
arch: amd64

- name: Configure CMake
run: cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_QT_GUI=ON -DENABLE_UPDATER=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
run: cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_QT_GUI=ON -DENABLE_UPDATER=OFF -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $env:NUMBER_OF_PROCESSORS
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
variant: sccache

- name: Configure CMake
run: cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_QT_GUI=ON -DENABLE_UPDATER=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
run: cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_QT_GUI=ON -DENABLE_UPDATER=OFF -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.ncpu)
Expand Down Expand Up @@ -360,7 +360,7 @@ jobs:
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}

- name: Configure CMake
run: cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_QT_GUI=ON -DENABLE_UPDATER=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
run: cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_QT_GUI=ON -DENABLE_UPDATER=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc)
Expand All @@ -376,9 +376,30 @@ jobs:
name: shadps4-linux-qt-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}
path: Shadps4-qt.AppImage

linux-flatpak:
runs-on: ubuntu-24.04
needs: get-info
container:
image: bilelmoussaoui/flatpak-github-actions:kde-6.7
options: --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
with:
manifest-path: net.shadps4.shadPS4.yaml
cache-key: flatpak-builder-${{ github.sha }}
bundle: shadps4.flatpak
upload-artifact: false
- uses: actions/upload-artifact@v4
with:
path: shadps4.flatpak
name: shadps4-linux-flatpak-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}

pre-release:
if: github.ref == 'refs/heads/main' && github.repository == 'shadps4-emu/shadPS4' && github.event_name == 'push'
needs: [get-info, windows-sdl, windows-qt, macos-sdl, macos-qt, linux-sdl, linux-qt]
needs: [get-info, windows-sdl, windows-qt, macos-sdl, macos-qt, linux-sdl, linux-qt, linux-flatpak]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,9 @@ FodyWeavers.xsd
# JetBrains
.idea
cmake-build-*

# flatpak build
builddir
.flatpak-builder
repo
*.flatpak
64 changes: 64 additions & 0 deletions net.shadps4.shadPS4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later

id: net.shadps4.shadPS4
runtime: org.kde.Platform
runtime-version: '6.8'
sdk: org.kde.Sdk
command: shadps4
separate-locales: false
finish-args:
- --share=network
- --socket=pulseaudio
- --socket=wayland
- --socket=fallback-x11
- --allow=bluetooth
- --filesystem=home
- --device=dri
- --device=input
- --filesystem=/media
- --filesystem=/run/media
- --talk-name=org.kde.StatusNotifierWatcher
sdk-extensions:
- org.freedesktop.Sdk.Extension.llvm18
add-extensions:
org.freedesktop.Platform.ffmpeg-full:
directory: lib/ffmpeg
add-ld-path: .
version: '24.08'
autodownload: true
autodelete: false
cleanup-commands:
- mkdir -p ${FLATPAK_DEST}/lib/ffmpeg
modules:
- name: rapidjson
buildsystem: cmake
config-opts:
- -DRAPIDJSON_BUILD_CXX11=OFF
- -DRAPIDJSON_BUILD_TESTS=OFF
sources:
- type: git
url: https://github.com/Tencent/rapidjson.git
commit: 858451e5b7d1c56cf8f6d58f88cf958351837e53
cleanup:
- '*'
- name: shadPS4
buildsystem: cmake
builddir: true
build-options:
append-path: /usr/lib/sdk/llvm18/bin
prepend-ld-library-path: /usr/lib/sdk/llvm18/lib
config-opts:
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
- -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO=ON
- -DENABLE_QT_GUI=ON
- -DENABLE_UPDATER=OFF
- -DCMAKE_C_COMPILER=clang
- -DCMAKE_CXX_COMPILER=clang++
- -DCMAKE_C_COMPILER_LAUNCHER=ccache
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_C_FLAGS_RELWITHDEBINFO=-march=native -O3 -DNDEBUG
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-march=native -O3 -DNDEBUG
sources:
- type: dir
path: .

0 comments on commit a3c0f0b

Please sign in to comment.