[flatpak] Created \'packaging\' directory and added integration with CMake

This commit is contained in:
Brenden Davidson 2025-06-24 15:47:44 -05:00
parent 7f35971e4a
commit 4e80a96dda
No known key found for this signature in database
GPG Key ID: EBED6775E0A324BD
11 changed files with 266 additions and 143 deletions

View File

@ -4,6 +4,7 @@ on:
push: push:
branches: branches:
- master - master
- flatpak # TODO: Remove after testing
jobs: jobs:
build: build:
@ -115,11 +116,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Configure Package Scripts
run: cmake -S . -B build -GNinja -DCONFIGURE_FLATPAK=ON
- name: Build Flatpak - name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6 uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with: with:
bundle: ${{ env.APP_ID }}.${{ matrix.arch }}.flatpak 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 }} arch: ${{ matrix.arch }}
release: release:

View File

@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.25...4.0 FATAL_ERROR)
project(isle LANGUAGES CXX C VERSION 0.1) 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) if (EMSCRIPTEN)
add_compile_options(-pthread) 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) 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)

19
packaging/CMakeLists.txt Normal file
View File

@ -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)

View File

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -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()

View File

@ -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

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>pizza.isle.Isle</id>
<name>Isle Decomp</name>
<summary>LEGO Island decompilation project</summary>
<metadata_license>MIT</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<recommends>
<display_length compare="ge">640</display_length>
</recommends>
<supports>
<control>pointing</control>
<control>keyboard</control>
<control>gamepad</control>
</supports>
<description>
<h1>
LEGO Island, portable
</h1>
<p>
This initiative is a portable version of LEGO Island (Version 1.1, English) based on the <a href="https://github.com/isledecomp/isle">decompilation project</a>. Our primary goal is to transform the codebase to achieve platform independence, thereby enhancing compatibility across various systems while preserving the original game&apos;s experience as faithfully as possible.
</p>
<p>
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&apos;s sake. While those are worthwhile objectives, they are not within the scope of this project.
</p>
</description>
<categories>
<category>Game</category>
<category>KidsGame</category>
<category>AdventureGame</category>
<category>Qt</category>
</categories>
<keywords>
<keyword translate="no">LEGO</keyword>
<keyword translate="no">lego</keyword>
<keyword>LEGO Island</keyword>
</keywords>
<url>
<homepage>https://github.com/isledecomp/isle-portable</homepage>
<bugtracker>https://github.com/isledecomp/isle-portable/issues</bugtracker>
</url>
<launchable type="desktop-id">pizza.isle.Isle.desktop</launchable>
</component>

View File

@ -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/"
]
}
]
}

View File

@ -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/"
]
}
]
}

View File

@ -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

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Freedesktop AppStream metadata file (https://www.freedesktop.org/software/appstream/docs) -->
<component type="desktop-application">
<id>@APP_ID@</id>
<name>@APP_NAME@</name>
<summary>@APP_SUMMARY@</summary>
<launchable type="desktop-id">@APP_ID@.desktop</launchable>
<branding>
<color type="primary">#e3000b</color>
</branding>
<developer id="io.github.isledecomp">
<name>Isle Decomp Team</name>
</developer>
<url type="homepage">https://github.com/isledecomp/isle-portable</url>
<url type="bugtracker">https://github.com/isledecomp/isle-portable/issues</url>
<metadata_license>MIT</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<requires>
<display_length side="longest" compare="ge">640</display_length>
<internet>offline-only</internet>
</requires>
<recommends>
<memory>128</memory>
</recommends>
<supports>
<control>pointing</control>
<control>keyboard</control>
<control>gamepad</control>
</supports>
<description>
<p> 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.
</p>
<p>
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.
</p>
</description>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">mild</content_attribute>
<content_attribute id="language-humor">mild</content_attribute>
</content_rating>
<categories>
<category>Game</category>
<category>KidsGame</category>
<category>AdventureGame</category>
<category>Qt</category>
</categories>
<keywords>
<keyword translate="no">LEGO</keyword>
<keyword translate="no">lego</keyword>
<keyword>LEGO Island</keyword>
<!-- Translations sourced from https://www.pcgamingwiki.com/wiki/Lego_Island#Localizations -->
<keyword xml:lang="fr">Aventures sur L'île LEGO</keyword>
<keyword xml:lang="de">Abenteuer auf der LEGO Insel</keyword>
<keyword xml:lang="it">Isola LEGO</keyword>
<keyword xml:lang="es">La Isla LEGO</keyword>
<keyword xml:lang="jp">レゴアイランドの大冒険</keyword>
<keyword xml:lang="pt-BR">A Ilha LEGO</keyword>
</keywords>
<releases>
<release version="@PROJECT_VERSION@-@GIT_HASH@" type="development" date="@BUILD_DATE@"/>
</releases>
</component>