Skip to content

Commit

Permalink
Add Flatpak support for Linux
Browse files Browse the repository at this point in the history
Allows to use Flatpak as the way to play the game on Linux.
  • Loading branch information
tintou committed Mar 19, 2024
1 parent af7996c commit 1107798
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .ci_scripts/build_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ case "$DEPLOY" in
DEPLOY_FILE=julius-$VERSION-linux-x86_64.zip
cp "${build_dir}/julius.zip" "deploy/$DEPLOY_FILE"
;;
"flatpak")
flatpak build-export export repo
DEPLOY_FILE=julius-$VERSION-linux.flatpak
flatpak build-bundle export julius.flatpak com.github.bvschaik.julius --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
cp julius.flatpak "deploy/$DEPLOY_FILE"
;;
"appimage")
PACKAGE=linux-appimage
DEPLOY_FILE=julius-$VERSION-linux.AppImage
Expand Down
6 changes: 6 additions & 0 deletions .ci_scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ mkdir -p deps
if [ "$BUILD_TARGET" == "appimage" ] || [ "$BUILD_TARGET" == "codeql-cpp" ]
then
sudo apt-get update && sudo apt-get -y install libgl1-mesa-dev libsdl2-dev libsdl2-mixer-dev
elif [ "$BUILD_TARGET" == "flatpak" ]
then
sudo apt-get update && sudo apt-get -y install flatpak-builder
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
sudo flatpak-builder repo com.github.bvschaik.julius.json --install-deps-from=flathub --install-deps-only --delete-build-dirs
sudo rm -R .flatpak-builder
elif [ ! -z "$SDL_VERSION" ] && [ ! -z "$SDL_MIXER_VERSION" ]
then
if [ "$BUILD_TARGET" == "mac" ]
Expand Down
4 changes: 4 additions & 0 deletions .ci_scripts/run_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ case "$BUILD_TARGET" in
echo "Creating disk image"
hdiutil create -volname Julius -srcfolder julius.app -ov -format UDZO julius.dmg
;;
"flatpak")
flatpak-builder repo com.github.bvschaik.julius.json --install-deps-from=flathub --keep-build-dirs
cp .flatpak-builder/build/julius/res/version.txt res/version.txt
;;
"appimage")
cd build && make -j4 && make test
make DESTDIR=AppDir install
Expand Down
2 changes: 2 additions & 0 deletions .ci_scripts/run_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ case "$BUILD_TARGET" in
"mac")
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DSYSTEM_LIBS=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ..
;;
"flatpak")
;;
"appimage")
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DSYSTEM_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr ..
;;
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: Linux Flatpak
os: ubuntu-20.04
BUILD_TARGET: flatpak
DEPLOY: flatpak
- name: Linux AppImage
os: ubuntu-20.04
BUILD_TARGET: appimage
Expand Down
28 changes: 28 additions & 0 deletions com.github.bvschaik.julius.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"id" : "com.github.bvschaik.julius",
"runtime" : "org.freedesktop.Platform",
"runtime-version" : "23.08",
"sdk" : "org.freedesktop.Sdk",
"command" : "julius",
"finish-args" : [
"--filesystem=home",
"--share=ipc",
"--device=dri",
"--socket=wayland",
"--socket=fallback-x11",
"--socket=pulseaudio"
],
"modules" : [
{
"name" : "julius",
"buildsystem" : "cmake-ninja",
"sources" : [
{
"type" : "git",
"url" : "https://github.com/bvschaik/julius.git",
"branch" : "master"
}
]
}
]
}

0 comments on commit 1107798

Please sign in to comment.