From 67d4f116b2f343930127af08d8cffdd3638ad173 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 18:54:14 +0100 Subject: [PATCH 1/9] chore: add proper release documentation + add flatpak metainfo file also add tests for the generated .desktop and .metainfo.xml files, that lint them --- README.md | 15 +++-- ...m.github.mgerhold.OOPetris.metainfo.xml.in | 31 +++++++++++ docs/develop.md | 5 +- docs/releases.md | 45 +++++++++++++++ tools/install/meson.build | 55 ++++++++++++++++++- 5 files changed, 140 insertions(+), 11 deletions(-) create mode 100644 assets/com.github.mgerhold.OOPetris.metainfo.xml.in create mode 100644 docs/releases.md diff --git a/README.md b/README.md index 2ce78e93..3b7fa9be 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,21 @@ Or you can download and use prebuilt binaries from the CI-builds. You can find s To download artifacts, click on the newest action and download the artifacts. -[Android](https://github.com/mgerhold/oopetris/actions/workflows/android.yml) +[Android](https://github.com/OpenBrickProtocolFoundation/oopetris/actions/workflows/android.yml) -[Linux (Flatpak)](https://github.com/mgerhold/oopetris/actions/workflows/flatpak.yml) +[Linux (Flatpak)](https://github.com/OpenBrickProtocolFoundation/oopetris/actions/workflows/flatpak.yml) -[Nintendo Switch /3DS](https://github.com/mgerhold/oopetris/actions/workflows/nintendo.yml) +[Nintendo Switch / 3DS](https://github.com/OpenBrickProtocolFoundation/oopetris/actions/workflows/nintendo.yml) -There is no correct Windows and MacOS build atm, you have to built it yourself or use the (maybe not published yet) release builds on github. +[WIndows](https://github.com/OpenBrickProtocolFoundation/oopetris/actions/workflows/installer.yml) +There is no correct MacOS build atm, you have to built it yourself or use the (maybe not published yet) releases on GitHub. + +## Releases + +There is an official website for OOPetris, where you also can find different links to auto updatable releases. + +For concrete instructions see [here](docs/releases.md) ## Logo diff --git a/assets/com.github.mgerhold.OOPetris.metainfo.xml.in b/assets/com.github.mgerhold.OOPetris.metainfo.xml.in new file mode 100644 index 00000000..60089084 --- /dev/null +++ b/assets/com.github.mgerhold.OOPetris.metainfo.xml.in @@ -0,0 +1,31 @@ + + + @APP_ID@ + OOPetris + A Tetris clone in OOP + MIT + MIT + + pointing + keyboard + touch + gamepad + + +

+ A Tetris clone in OOP +

+
+ @APP_ID@.desktop + + + + + https://github.com/OpenBrickProtocolFoundation/oopetris/releases/tag/0.5.6 + + + https://oopetris.totto.lt/ + https://github.com/OpenBrickProtocolFoundation/oopetris/issues + https://github.com/OpenBrickProtocolFoundation/oopetris/pulls + https://github.com/OpenBrickProtocolFoundation/oopetris +
diff --git a/docs/develop.md b/docs/develop.md index ed263bb9..796cab95 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -8,13 +8,12 @@ For concrete instructions, see the list below: ## Linux -[linux](linux.md) +[Linux](linux.md) ## Serenity OS [serenity](serenity.md) - ## Windows [windows](windows.md) @@ -27,12 +26,10 @@ For concrete instructions, see the list below: [switch](switch.md) - ## Nintendo 3DS [switch](3ds.md) - ## Android [android](android.md) diff --git a/docs/releases.md b/docs/releases.md new file mode 100644 index 00000000..b45fa9ab --- /dev/null +++ b/docs/releases.md @@ -0,0 +1,45 @@ + + +# OOPetris Releases + + +We support multiple platforms and different types of executables / packages. +So here is a list of supported "package managers" / installation platforms. + +## Android / FDroid + +> [!NOTE] +> This is still WIP + +## Linux / Flatpak + +We provide stable and beta releases via 2 remotes: + +To use the stable version, use this repo: + +```bash +flatpak remote-add --if-not-exists oopetris-stable https://oopetris.totto.lt/repo/assets/oopetris.stable.flatpakrepo + +``` + +And to use beta version: + +```bash +flatpak remote-add --if-not-exists oopetris-beta https://oopetris.totto.lt/repo/assets/oopetris.beta.flatpakrepo + +``` + +Than install it by using this command: + +```bash +flatpak install -v com.github.mgerhold.OOPetris +``` + +To update use the normal flatpak update command, keep in mind, that the bet may be unstable and break things, use with caution! + +## Other + +> [!NOTE] +> This is still WIP + +All other platforms have more difficult to support auto update capabilities, so you can find more on our [website](https://oopetris.totto.lt/releases). diff --git a/tools/install/meson.build b/tools/install/meson.build index db010c62..1a4e25d2 100644 --- a/tools/install/meson.build +++ b/tools/install/meson.build @@ -6,7 +6,12 @@ if build_application meson.project_source_root() / 'assets', install_dir: 'share/oopetris', install_tag: 'assets', - exclude_files: ['oopetris.desktop.in', 'OOPetris.svg', 'recordings.magic'], + exclude_files: [ + 'oopetris.desktop.in', + 'com.github.mgerhold.OOPetris.metainfo.xml.in', + 'OOPetris.svg', + 'recordings.magic', + ], exclude_directories: ['icon'], ) @@ -15,6 +20,8 @@ if build_application app_name = 'com.github.mgerhold.OOPetris' endif + require_checks = get_option('tests') + conf = configuration_data() conf.set('APP_NAME', app_name) @@ -54,8 +61,8 @@ if build_application endif endif - configure_file( - input: meson.project_source_root() / 'assets/oopetris.desktop.in', + desktop_file = configure_file( + input: meson.project_source_root() / 'assets' / 'oopetris.desktop.in', output: app_name + '.desktop', configuration: conf, install: true, @@ -63,6 +70,48 @@ if build_application install_tag: 'other', ) + desktop_file_validate_exe = find_program('desktop-file-validate', required: require_checks) + + if desktop_file_validate_exe.found() + test( + 'validate desktop file', + desktop_file_validate_exe, + args: [desktop_file], + ) + endif + + if is_flatpak_build + + flaptak_conf = configuration_data() + flaptak_conf.set('APP_ID', app_name) + flaptak_conf.set('APP_VERSION', meson.project_version()) + + metainfo_file = configure_file( + input: meson.project_source_root() / 'assets' / 'com.github.mgerhold.OOPetris.metainfo.xml.in', + output: app_name + '.metainfo.xml', + configuration: flaptak_conf, + install: true, + install_dir: datadir / 'metainfo', + install_tag: 'other', + ) + + ascli_exe = find_program('appstreamcli', required: require_checks) + + if ascli_exe.found() + test( + 'validate metainfo file', + ascli_exe, + args: [ + 'validate', + '--no-net', + '--explain', + '--pedantic', metainfo_file, + ], + ) + endif + + endif + logos = [ '24x24.png', '48x48.png', From 0432a6df914a6f98964fca905952458eb98b9b7d Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 19:12:58 +0100 Subject: [PATCH 2/9] fix: fix flatpak linter also rename he app, as the flatpak linter requires it to be lower case also use a proper url schema for github projects, see https://docs.flathub.org/docs/for-app-authors/requirements/#control-over-domain-or-repository --- .github/workflows/flatpak.yml | 2 +- ....openbrickprotocolfoundation.oopetris.metainfo.xml.in} | 6 ++++-- docs/linux.md | 8 ++++---- docs/releases.md | 2 +- ... => io.github.openbrickprotocolfoundation.oopetris.yml | 2 +- src/discord/core.hpp | 2 +- tools/dependencies/meson.build | 2 +- tools/install/meson.build | 8 +++++--- 8 files changed, 18 insertions(+), 14 deletions(-) rename assets/{com.github.mgerhold.OOPetris.metainfo.xml.in => io.github.openbrickprotocolfoundation.oopetris.metainfo.xml.in} (84%) rename com.github.mgerhold.OOPetris.yml => io.github.openbrickprotocolfoundation.oopetris.yml (95%) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 1319e6ac..17372c5a 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -20,5 +20,5 @@ jobs: - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 with: bundle: oopetris.flatpak - manifest-path: com.github.mgerhold.OOPetris.yml + manifest-path: io.github.openbrickprotocolfoundation.oopetris.yml verbose: ${{ runner.debug == '1' && 'true' || 'false' }} diff --git a/assets/com.github.mgerhold.OOPetris.metainfo.xml.in b/assets/io.github.openbrickprotocolfoundation.oopetris.metainfo.xml.in similarity index 84% rename from assets/com.github.mgerhold.OOPetris.metainfo.xml.in rename to assets/io.github.openbrickprotocolfoundation.oopetris.metainfo.xml.in index 60089084..d7633a50 100644 --- a/assets/com.github.mgerhold.OOPetris.metainfo.xml.in +++ b/assets/io.github.openbrickprotocolfoundation.oopetris.metainfo.xml.in @@ -13,13 +13,15 @@

- A Tetris clone in OOP + A Tetris clone in OOP. Supports multiplayer, recordings and many more features. For more information vist the github repository.

@APP_ID@.desktop + + Totto16 + - https://github.com/OpenBrickProtocolFoundation/oopetris/releases/tag/0.5.6 diff --git a/docs/linux.md b/docs/linux.md index 3119961d..ae8fea06 100644 --- a/docs/linux.md +++ b/docs/linux.md @@ -10,7 +10,6 @@ You just have to call these commands: - ```bash meson setup build @@ -19,14 +18,15 @@ meson compile -C build ./build/oopetris # to run the executable ``` - ## Compiling for flatpak You optionally can compile a flatpak image. For that you need some additional binaries, namely the flatpak-builder, than just run: - +> [!NOTE] +> that is not entirely correct + ```bash -flatpak-build com.github.mgerhold.OOPetris.yml +flatpak-build io.github.openbrickprotocolfoundation.oopetris.yml ``` diff --git a/docs/releases.md b/docs/releases.md index b45fa9ab..92566c7c 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -32,7 +32,7 @@ flatpak remote-add --if-not-exists oopetris-beta https://oopetris.totto.lt/repo/ Than install it by using this command: ```bash -flatpak install -v com.github.mgerhold.OOPetris +flatpak install -v io.github.openbrickprotocolfoundation.oopetris ``` To update use the normal flatpak update command, keep in mind, that the bet may be unstable and break things, use with caution! diff --git a/com.github.mgerhold.OOPetris.yml b/io.github.openbrickprotocolfoundation.oopetris.yml similarity index 95% rename from com.github.mgerhold.OOPetris.yml rename to io.github.openbrickprotocolfoundation.oopetris.yml index 14be55a0..25239e42 100644 --- a/com.github.mgerhold.OOPetris.yml +++ b/io.github.openbrickprotocolfoundation.oopetris.yml @@ -1,4 +1,4 @@ -app-id: com.github.mgerhold.OOPetris +app-id: io.github.openbrickprotocolfoundation.oopetris runtime: org.freedesktop.Platform runtime-version: "24.08" sdk: org.freedesktop.Sdk diff --git a/src/discord/core.hpp b/src/discord/core.hpp index 55d917bf..38d0ecd0 100644 --- a/src/discord/core.hpp +++ b/src/discord/core.hpp @@ -26,7 +26,7 @@ namespace constants::discord { #elif defined(__CONSOLE__) #error "Not supported" #elif defined(FLATPAK_BUILD) - constexpr const char* platform_dependent_launch_arguments = "flatpak run com.github.mgerhold.OOPetris --discord"; + constexpr const char* platform_dependent_launch_arguments = "flatpak run io.github.openbrickprotocolfoundation.oopetris --discord"; #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) constexpr const char* platform_dependent_launch_arguments = "oopetris.exe --discord"; #elif defined(__APPLE__) diff --git a/tools/dependencies/meson.build b/tools/dependencies/meson.build index 204bf626..319fcc3a 100644 --- a/tools/dependencies/meson.build +++ b/tools/dependencies/meson.build @@ -305,7 +305,7 @@ if build_application endif if is_flatpak_build - app_name = 'com.github.mgerhold.OOPetris' + app_name = 'io.github.openbrickprotocolfoundation.oopetris' temp = core_lib.get('compile_args') temp += '-DFLATPAK_BUILD' diff --git a/tools/install/meson.build b/tools/install/meson.build index 1a4e25d2..3ed51689 100644 --- a/tools/install/meson.build +++ b/tools/install/meson.build @@ -1,5 +1,7 @@ if build_application + flatpak_app_name = 'io.github.openbrickprotocolfoundation.oopetris' + ## TODO: only install needed ones, since sometimes we only need e.g. flacs or mp3 and no icons etc. ## install assets install_subdir( @@ -8,7 +10,7 @@ if build_application install_tag: 'assets', exclude_files: [ 'oopetris.desktop.in', - 'com.github.mgerhold.OOPetris.metainfo.xml.in', + flatpak_app_name+'.metainfo.xml.in', 'OOPetris.svg', 'recordings.magic', ], @@ -17,7 +19,7 @@ if build_application app_name = 'oopetris' if is_flatpak_build - app_name = 'com.github.mgerhold.OOPetris' + app_name = flatpak_app_name endif require_checks = get_option('tests') @@ -87,7 +89,7 @@ if build_application flaptak_conf.set('APP_VERSION', meson.project_version()) metainfo_file = configure_file( - input: meson.project_source_root() / 'assets' / 'com.github.mgerhold.OOPetris.metainfo.xml.in', + input: meson.project_source_root() / 'assets' / (flatpak_app_name+'.metainfo.xml.in'), output: app_name + '.metainfo.xml', configuration: flaptak_conf, install: true, From 050d9e139764d61a5ed4ecd500146f30a6f04763 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 19:34:58 +0100 Subject: [PATCH 3/9] fix: ci, install needed package --- .github/workflows/cpp-linter.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 4e440b3f..7b860f4b 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -31,7 +31,7 @@ jobs: - name: Prepare compile_commands.json run: | sudo apt-get update - sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* -y --no-install-recommends + sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* desktop-file-utils -y --no-install-recommends meson setup build -Dbuildtype=release -Dclang_libcpp=disabled -Dtests=true meson compile -C build git_version.hpp diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 20ecde2f..6f0894a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* gcovr -y --no-install-recommends + sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* gcovr desktop-file-utils -y --no-install-recommends - name: Configure run: meson setup build -Dbuildtype=debug -Db_coverage=true -Dtests=true -Dclang_libcpp=enabled From 0431302607d055b6d192d84f06ea2b656734d144 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 19:56:00 +0100 Subject: [PATCH 4/9] ci: add arm64 flatpak build + add upload to beta repository in case of a merge --- .github/workflows/flatpak.yml | 36 ++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 17372c5a..99617733 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -10,15 +10,49 @@ on: jobs: flatpak: - name: 'Flatpak build' + name: Flatpak build (${{ matrix.config.arch }}) runs-on: ubuntu-24.04 + strategy: + matrix: + config: + - arch: x86_64 + use_qemu: false + + - arch: aarch64 + use_qemu: true + qemu_arch: arm64 + # Don't fail the whole workflow if one architecture fails + fail-fast: false container: image: bilelmoussaoui/flatpak-github-actions:freedesktop-24.08 options: --privileged steps: - uses: actions/checkout@v4 + + - name: Install deps + if: ${{ matrix.config.use_qemu == true }} + run: | + dnf -y install docker + + - name: Set up QEMU + if: ${{ matrix.config.use_qemu == true }} + id: qemu + uses: docker/setup-qemu-action@v2 + with: + platforms: ${{ matrix.config.qemu_arch }} + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 with: bundle: oopetris.flatpak manifest-path: io.github.openbrickprotocolfoundation.oopetris.yml verbose: ${{ runner.debug == '1' && 'true' || 'false' }} + cache-key: flatpak-builder-${{ github.sha }} + arch: ${{ matrix.config.arch }} + + - uses: flatpak/flatpak-github-actions/flat-manager@v4 + name: 'Deploy' + if: github.event_name != 'pull_request' + with: + repository: beta + flat-manager-url: http://flat-man.oopetris.totto.lt + token: ${{ secrets.FLAT_MANAGER_TOKEN }} From 5078b4b52ad2aa76b1bd8a685ae2a2a37cf658fb Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 19:59:21 +0100 Subject: [PATCH 5/9] ci: fix lint action --- src/discord/core.hpp | 6 ++++-- tools/dependencies/meson.build | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/discord/core.hpp b/src/discord/core.hpp index 38d0ecd0..48af15a4 100644 --- a/src/discord/core.hpp +++ b/src/discord/core.hpp @@ -3,6 +3,7 @@ #pragma once #include +#include #include "../helper/windows.hpp" @@ -26,7 +27,8 @@ namespace constants::discord { #elif defined(__CONSOLE__) #error "Not supported" #elif defined(FLATPAK_BUILD) - constexpr const char* platform_dependent_launch_arguments = "flatpak run io.github.openbrickprotocolfoundation.oopetris --discord"; + constexpr const char* platform_dependent_launch_arguments = + "flatpak run io.github.openbrickprotocolfoundation.oopetris --discord"; #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) constexpr const char* platform_dependent_launch_arguments = "oopetris.exe --discord"; #elif defined(__APPLE__) @@ -38,7 +40,7 @@ namespace constants::discord { #endif // manually synchronized to https://discord.com/developers/applications/1220147916371394650/rich-presence/assets - enum class ArtAsset { logo }; + enum class ArtAsset : u8 { logo }; OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] std::string get_asset_key(ArtAsset asset); diff --git a/tools/dependencies/meson.build b/tools/dependencies/meson.build index 319fcc3a..f4f4e205 100644 --- a/tools/dependencies/meson.build +++ b/tools/dependencies/meson.build @@ -338,6 +338,7 @@ if build_application discord_sdk_dep = dependency( 'discord-game-sdk', + allow_fallback: true, required: not meson.is_cross_build() and get_option('build_installer'), # only with msvc we need a static library, all others work without adding __declspec() everywhere static: c.get_id() == 'msvc', From d91ceb1170994004d6af80a3c587deb8fbe788ac Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 20:03:51 +0100 Subject: [PATCH 6/9] ci: clean a few things up - name all CI's with the same naming schema - give the .yml files a descriptive name --- .github/workflows/flatpak.yml | 2 +- .github/workflows/{cpp-linter.yml => lint.yml} | 3 ++- .github/workflows/musl.yml | 2 +- .github/workflows/{installer.yml => windows_installer.yml} | 2 +- README.md | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) rename .github/workflows/{cpp-linter.yml => lint.yml} (97%) rename .github/workflows/{installer.yml => windows_installer.yml} (98%) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 99617733..59c70859 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -1,4 +1,4 @@ -name: Flatpak build +name: Flatpak CI on: release: diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/lint.yml similarity index 97% rename from .github/workflows/cpp-linter.yml rename to .github/workflows/lint.yml index 7b860f4b..51fc0fac 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: C++ lints(clang-format + clang-tidy) +name: Lint CI on: push: branches: ['main'] @@ -7,6 +7,7 @@ on: jobs: cpp-linter: + name: C++ lints(clang-format + clang-tidy) runs-on: ubuntu-24.04 permissions: pull-requests: write diff --git a/.github/workflows/musl.yml b/.github/workflows/musl.yml index ed8e543a..aa5c9037 100644 --- a/.github/workflows/musl.yml +++ b/.github/workflows/musl.yml @@ -1,4 +1,4 @@ -name: musl CI +name: Musl CI on: push: diff --git a/.github/workflows/installer.yml b/.github/workflows/windows_installer.yml similarity index 98% rename from .github/workflows/installer.yml rename to .github/workflows/windows_installer.yml index f15789cf..5816b7a4 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/windows_installer.yml @@ -1,4 +1,4 @@ -name: Installer CI +name: Windows Installer CI on: push: diff --git a/README.md b/README.md index 3b7fa9be..9b29e8de 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ To download artifacts, click on the newest action and download the artifacts. [Nintendo Switch / 3DS](https://github.com/OpenBrickProtocolFoundation/oopetris/actions/workflows/nintendo.yml) -[WIndows](https://github.com/OpenBrickProtocolFoundation/oopetris/actions/workflows/installer.yml) +[Windows](https://github.com/OpenBrickProtocolFoundation/oopetris/actions/workflows/windows_installer.yml) There is no correct MacOS build atm, you have to built it yourself or use the (maybe not published yet) releases on GitHub. From d903dc3817a4ce8685f7d79e87981c847450c1f3 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 20:07:06 +0100 Subject: [PATCH 7/9] build: disable discord dependency on unsupported architecture --- tools/dependencies/meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/dependencies/meson.build b/tools/dependencies/meson.build index f4f4e205..65c6dbe0 100644 --- a/tools/dependencies/meson.build +++ b/tools/dependencies/meson.build @@ -336,10 +336,17 @@ if build_application c = meson.get_compiler('c') + discord_dep_required = not meson.is_cross_build() and get_option('build_installer') + + if host_machine.system() == 'linux' and host_machine.cpu_family() == 'aarch64' + # not supported on aarch64 linux :( + discord_dep_required = false + endif + discord_sdk_dep = dependency( 'discord-game-sdk', allow_fallback: true, - required: not meson.is_cross_build() and get_option('build_installer'), + required: discord_dep_required, # only with msvc we need a static library, all others work without adding __declspec() everywhere static: c.get_id() == 'msvc', default_options: c.get_id() != 'msvc' ? {} : {'default_library': 'static'}, From dadcd7b4a3397bee8bfa5885b055a5b7a5f0c5ea Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 20:10:36 +0100 Subject: [PATCH 8/9] build: also add allow_fallback, if required can be false, so that subprojects are at least tried on that configuration --- tools/dependencies/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/dependencies/meson.build b/tools/dependencies/meson.build index 65c6dbe0..2e333dac 100644 --- a/tools/dependencies/meson.build +++ b/tools/dependencies/meson.build @@ -319,6 +319,7 @@ if build_application nfde_dep = dependency( 'nativefiledialog-extended', required: not meson.is_cross_build(), + allow_fallback: true, default_options: { 'xdg-desktop-portal': is_flatpak_build ? 'enabled' : 'auto', }, From 92b8badd92bce9661d95d2bbd7bcc6e263562ee0 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 30 Oct 2024 20:18:50 +0100 Subject: [PATCH 9/9] fix: fix clang-tidy errors --- src/discord/core.cpp | 2 +- src/discord/core.hpp | 2 +- src/scenes/main_menu/main_menu.cpp | 2 +- src/scenes/replay_game/replay_game.cpp | 2 +- src/scenes/single_player_game/single_player_game.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/discord/core.cpp b/src/discord/core.cpp index 217f24e4..97200f26 100644 --- a/src/discord/core.cpp +++ b/src/discord/core.cpp @@ -11,7 +11,7 @@ [[nodiscard]] std::string constants::discord ::get_asset_key(constants::discord::ArtAsset asset) { switch (asset) { - case ArtAsset::logo: + case ArtAsset::Logo: return "logo"; default: UNREACHABLE(); diff --git a/src/discord/core.hpp b/src/discord/core.hpp index 48af15a4..21423b00 100644 --- a/src/discord/core.hpp +++ b/src/discord/core.hpp @@ -40,7 +40,7 @@ namespace constants::discord { #endif // manually synchronized to https://discord.com/developers/applications/1220147916371394650/rich-presence/assets - enum class ArtAsset : u8 { logo }; + enum class ArtAsset : u8 { Logo }; OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] std::string get_asset_key(ArtAsset asset); diff --git a/src/scenes/main_menu/main_menu.cpp b/src/scenes/main_menu/main_menu.cpp index 9f7ea881..59aebd0d 100644 --- a/src/scenes/main_menu/main_menu.cpp +++ b/src/scenes/main_menu/main_menu.cpp @@ -90,7 +90,7 @@ namespace scenes { discord_instance->set_activity( DiscordActivityWrapper("Selecting playmode", discord::ActivityType::Playing) - .set_large_image("Playing OOPetris", constants::discord::ArtAsset::logo) + .set_large_image("Playing OOPetris", constants::discord::ArtAsset::Logo) .set_start_timestamp(std::chrono::system_clock::now()) ); } diff --git a/src/scenes/replay_game/replay_game.cpp b/src/scenes/replay_game/replay_game.cpp index 4a2362aa..75f0a2df 100644 --- a/src/scenes/replay_game/replay_game.cpp +++ b/src/scenes/replay_game/replay_game.cpp @@ -58,7 +58,7 @@ namespace scenes { discord_instance->set_activity( DiscordActivityWrapper("Replaying a game", discord::ActivityType::Playing) - .set_large_image("Playing OOPetris", constants::discord::ArtAsset::logo) + .set_large_image("Playing OOPetris", constants::discord::ArtAsset::Logo) .set_start_timestamp(std::chrono::system_clock::now()) ); } diff --git a/src/scenes/single_player_game/single_player_game.cpp b/src/scenes/single_player_game/single_player_game.cpp index e1a23899..9c35e66f 100644 --- a/src/scenes/single_player_game/single_player_game.cpp +++ b/src/scenes/single_player_game/single_player_game.cpp @@ -53,7 +53,7 @@ namespace scenes { discord_instance->set_activity( DiscordActivityWrapper("Playing a single-player game", discord::ActivityType::Playing) - .set_large_image("Playing OOPetris", constants::discord::ArtAsset::logo) + .set_large_image("Playing OOPetris", constants::discord::ArtAsset::Logo) .set_start_timestamp(std::chrono::system_clock::now()) ); }