diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e69d6d6..6014ea29 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - flatpak # TODO: Remove after testing jobs: build: @@ -115,11 +116,14 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Configure Package Scripts + run: cmake -S . -B build -GNinja -DCONFIGURE_FLATPAK=ON + - name: Build Flatpak uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: bundle: ${{ env.APP_ID }}.${{ matrix.arch }}.flatpak - manifest-path: flatpak/${{ env.APP_ID }}.json + manifest-path: build/packaging/linux/flatpak/${{ env.APP_ID }}.json arch: ${{ matrix.arch }} release: diff --git a/CMakeLists.txt b/CMakeLists.txt index 461e8378..5ba56aee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.25...4.0 FATAL_ERROR) project(isle LANGUAGES CXX C VERSION 0.1) +option(CONFIGURE_FLATPAK "Configure required Flatpak data and exit" OFF) +if (NOT DEFINED ENV{FLATPAK_DEST}) + add_subdirectory(packaging EXCLUDE_FROM_ALL) +endif() +if (CONFIGURE_FLATPAK) + # Exit early since the remaining configuration will otherwise fail + return() +endif() + if (EMSCRIPTEN) add_compile_options(-pthread) add_link_options(-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=2gb -sUSE_PTHREADS=1 -sPROXY_TO_PTHREAD=1 -sPTHREAD_POOL_SIZE_STRICT=0 -sFORCE_FILESYSTEM=1 -sWASMFS=1 -sEXIT_RUNTIME=1) diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt new file mode 100644 index 00000000..e8773434 --- /dev/null +++ b/packaging/CMakeLists.txt @@ -0,0 +1,19 @@ +set(APP_ID "pizza.isle.Isle") +set(APP_NAME "Isle Decomp") +set(APP_SUMMARY "Portable version of the LEGO Island Decompilation Project") +set(QT_VERSION 6.8) + +string(TIMESTAMP BUILD_DATE UTC) + +# Following block sourced from https://jonathanhamberg.com/post/cmake-embedding-git-hash/ +# Get the latest abbreviated commit hash of the working branch +execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE GIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# TODO: Generate minfied SVG icon and PNG variants + +add_subdirectory(linux EXCLUDE_FROM_ALL) \ No newline at end of file diff --git a/packaging/icons/isle_icon.svg b/packaging/icons/isle.svg similarity index 100% rename from packaging/icons/isle_icon.svg rename to packaging/icons/isle.svg diff --git a/packaging/linux/CMakeLists.txt b/packaging/linux/CMakeLists.txt new file mode 100644 index 00000000..014d7fe3 --- /dev/null +++ b/packaging/linux/CMakeLists.txt @@ -0,0 +1,8 @@ +# Injects the required variables into the Desktop and MetaInfo files +configure_file(isle_decomp.desktop.in "${APP_ID}.desktop" @ONLY) +configure_file(isle_decomp.metainfo.xml.in "${APP_ID}.metainfo.xml" @ONLY) + +# Injects the required variables into the Flatpak manifest +if (CONFIGURE_FLATPAK) + configure_file(flatpak/manifest.json.in "${APP_ID}.json" ESCAPE_QUOTES @ONLY) +endif() \ No newline at end of file diff --git a/packaging/linux/desktop_assets/pizza.isle.Isle.desktop b/packaging/linux/desktop_assets/pizza.isle.Isle.desktop deleted file mode 100644 index 2ade6ad7..00000000 --- a/packaging/linux/desktop_assets/pizza.isle.Isle.desktop +++ /dev/null @@ -1,23 +0,0 @@ -[Desktop Entry] -Version=1.5 - -Name=Isle Decomp -Comment=LEGO Island decompilation project -Icon=pizza.isle.Isle -Type=Application -Categories=Game;KidsGame;AdventureGame;Qt -Keywords=LEGO;lego;LEGO Island -SingleMainWindow=true - -TryExec=isle -Exec=isle - -Actions=play;configure - -[Desktop Action play] -Name=Play Game -Exec=isle - -[Desktop Action configure] -Name=Configure Settings -Exec=config diff --git a/packaging/linux/desktop_assets/pizza.isle.Isle.metainfo.xml b/packaging/linux/desktop_assets/pizza.isle.Isle.metainfo.xml deleted file mode 100644 index 0dd1a859..00000000 --- a/packaging/linux/desktop_assets/pizza.isle.Isle.metainfo.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - pizza.isle.Isle - - Isle Decomp - LEGO Island decompilation project - - MIT - GPL-3.0-or-later - - - 640 - - - pointing - keyboard - gamepad - - - -

- LEGO Island, portable -

-

- This initiative is a portable version of LEGO Island (Version 1.1, English) based on the decompilation project. Our primary goal is to transform the codebase to achieve platform independence, thereby enhancing compatibility across various systems while preserving the original game's experience as faithfully as possible. -

-

- Please note: this project is dedicated to achieving platform independence without altering the core gameplay, adding new features, enhancing visual quality, or rewriting code for improvement's sake. While those are worthwhile objectives, they are not within the scope of this project. -

-
- - - Game - KidsGame - AdventureGame - Qt - - - - LEGO - lego - LEGO Island - - - - https://github.com/isledecomp/isle-portable - https://github.com/isledecomp/isle-portable/issues - - - pizza.isle.Isle.desktop -
\ No newline at end of file diff --git a/packaging/linux/flatpak/manifest.json.in b/packaging/linux/flatpak/manifest.json.in new file mode 100644 index 00000000..a3d56f2d --- /dev/null +++ b/packaging/linux/flatpak/manifest.json.in @@ -0,0 +1,107 @@ +{ + "id": "@APP_ID@", + + "runtime": "org.kde.Platform", + "sdk": "org.kde.Sdk", + "runtime-version": "@QT_VERSION@", + + "command": "isle", + + "finish-args": [ + "--share=ipc", + "--socket=wayland", + "--socket=fallback-x11", + "--socket=pulseaudio", + "--device=dri", + "--device=input", + "--filesystem=/run/media/:ro", + "--filesystem=/media/:ro", + "--filesystem=/mnt/:ro" + ], + + "modules": [ + { + "name": "isle", + "buildsystem": "cmake-ninja", + "config-opts": [ + "-DCMAKE_BUILD_TYPE=RelWithDebInfo", + "-DISLE_DEBUG=OFF" + ], + "sources": [ + { + "type": "dir", + "path": "@PROJECT_SOURCE_DIR@/3rdparty", + "dest": "3rdparty/" + }, + { + "type": "dir", + "path": "@PROJECT_SOURCE_DIR@/cmake", + "dest": "cmake/" + }, + { + "type": "dir", + "path": "@PROJECT_SOURCE_DIR@/CMake", + "dest": "CMake/" + }, + { + "type": "dir", + "path": "@PROJECT_SOURCE_DIR@/CONFIG", + "dest": "CONFIG/" + }, + { + "type": "dir", + "path": "@PROJECT_SOURCE_DIR@/ISLE", + "dest": "ISLE/" + }, + { + "type": "dir", + "path": "@PROJECT_SOURCE_DIR@/LEGO1", + "dest": "LEGO1/" + }, + { + "type": "dir", + "path": "@PROJECT_SOURCE_DIR@/miniwin", + "dest": "miniwin/" + }, + { + "type": "dir", + "path": "@PROJECT_SOURCE_DIR@/util", + "dest": "util/" + }, + { + "type": "file", + "path": "@PROJECT_SOURCE_DIR@/CMakeLists.txt" + } + ], + "build-options": { + "build-args": [ + "--share=network" + ] + } + }, + { + "name": "desktop-assets", + "buildsystem": "simple", + "sources": [ + { + "type": "file", + "dest-filename": "@APP_ID@.svg", + "path": "@CMAKE_CURRENT_SOURCE_DIR@/../icons/isle.svg" + }, + { + "type": "file", + "path": "./@APP_ID@.desktop" + }, + { + "type": "file", + "path": "./@APP_ID@.metainfo.xml" + } + ], + "build-commands": [ + "install -Dm0644 @APP_ID@.svg -t ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/", + "install -Dm0644 @APP_ID@.desktop -t ${FLATPAK_DEST}/share/applications/", + "install -Dm0644 @APP_ID@.metainfo.xml -t ${FLATPAK_DEST}/share/metainfo/" + ] + } + ] +} diff --git a/packaging/linux/flatpak/pizza.isle.Isle.json b/packaging/linux/flatpak/pizza.isle.Isle.json deleted file mode 100644 index d3162a2b..00000000 --- a/packaging/linux/flatpak/pizza.isle.Isle.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "id": "pizza.isle.Isle", - - "runtime": "org.kde.Platform", - "sdk": "org.kde.Sdk", - "runtime-version": "6.8", - - "command": "isle", - - "finish-args": [ - "--share=ipc", - "--socket=wayland", - "--socket=fallback-x11", - "--socket=pulseaudio", - "--device=dri", - "--device=input", - "--filesystem=/run/media/:ro", - "--filesystem=/media/:ro", - "--filesystem=/mnt/:ro" - ], - - "modules": [ - { - "name": "isle", - "buildsystem": "cmake-ninja", - "config-opts": [ - "-DCMAKE_BUILD_TYPE=RelWithDebInfo", - "-DISLE_DEBUG=OFF" - ], - "sources": [ - { - "type": "git", - "url": "https://github.com/isledecomp/isle-portable.git", - "branch": "master" - } - ], - "build-options": { - "build-args": [ - "--share=network" - ] - } - }, - { - "name": "desktop-assets", - "buildsystem": "simple", - "sources": [ - { - "type": "file", - "dest-filename": "pizza.isle.Isle.svg", - "path": "desktop/isle_icon.svg" - }, - { - "type": "file", - "path": "desktop/pizza.isle.Isle.desktop" - }, - { - "type": "file", - "path": "desktop/pizza.isle.Isle.metainfo.xml" - } - ], - "build-commands": [ - "install -Dm0644 pizza.isle.Isle.svg -t ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/", - "install -Dm0644 pizza.isle.Isle.desktop -t ${FLATPAK_DEST}/share/applications/", - "install -Dm0644 pizza.isle.Isle.metainfo.xml -t ${FLATPAK_DEST}/share/metainfo/" - ] - } - ] -} diff --git a/packaging/linux/isle_decomp.desktop.in b/packaging/linux/isle_decomp.desktop.in new file mode 100644 index 00000000..4a3250ca --- /dev/null +++ b/packaging/linux/isle_decomp.desktop.in @@ -0,0 +1,32 @@ +[Desktop Entry] +Version=1.5 + +Name=@APP_NAME@ +Comment=@APP_SUMMARY@ + +Icon=@APP_ID@ +Type=Application +Categories=Game;KidsGame;AdventureGame;Qt + +Keywords=LEGO;lego;LEGO Island +Keywords[es]=LEGO;lego;La Isla LEGO +Keywords[fr]=LEGO;lego;Aventures sur L'île LEGO +Keywords[it]=LEGO;lego;Isola LEGO +Keywords[de]=LEGO;lego;Abenteuer auf der LEGO Insel +Keywords[jp]=LEGO;lego;レゴアイランドの大冒険 +Keywords[pt_BR]=LEGO;lego;A Ilha LEGO + +SingleMainWindow=true + +TryExec=isle +Exec=isle + +Actions=play;configure + +[Desktop Action play] +Name=Play Game +Exec=isle + +[Desktop Action configure] +Name=Configure Settings +Exec=config diff --git a/packaging/linux/isle_decomp.metainfo.xml.in b/packaging/linux/isle_decomp.metainfo.xml.in new file mode 100644 index 00000000..4a5bd6a7 --- /dev/null +++ b/packaging/linux/isle_decomp.metainfo.xml.in @@ -0,0 +1,86 @@ + + + + + @APP_ID@ + + @APP_NAME@ + @APP_SUMMARY@ + + @APP_ID@.desktop + + + #e3000b + + + + Isle Decomp Team + + + https://github.com/isledecomp/isle-portable + https://github.com/isledecomp/isle-portable/issues + + MIT + GPL-3.0-or-later + + + 640 + offline-only + + + + 128 + + + + pointing + keyboard + gamepad + + + +

This initiative is a portable version of LEGO Island (Version 1.1, English) + based on the decompilation project. Our primary goal is to transform the codebase to achieve + platform independence, thereby enhancing compatibility across various systems while preserving + the original game's experience as faithfully as possible. +

+ +

+ Please note: this project is dedicated to achieving platform independence without altering the + core gameplay, adding new features, enhancing visual quality, or rewriting code for + improvement's sake. While those are worthwhile objectives, they are not within the scope + of this project. +

+ +
+ + + mild + mild + + + + Game + KidsGame + AdventureGame + Qt + + + + LEGO + lego + + LEGO Island + + Aventures sur L'île LEGO + Abenteuer auf der LEGO Insel + Isola LEGO + La Isla LEGO + レゴアイランドの大冒険 + A Ilha LEGO + + + + + +
\ No newline at end of file