From 606f5f6c86ba6becf26d41497f7d749bfc7615e5 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Sun, 9 Aug 2026 13:17:36 -0500 Subject: [PATCH] Updates Flapak plugin support and building Flatpak in GitLab CI --- .gitlab-ci.yml | 38 ++++++++++++++++ PluginManager.cpp | 2 +- flatpak/org.openrgb.OpenRGB.yaml | 74 ++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 flatpak/org.openrgb.OpenRGB.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f162e9a8e..b0ae5a73b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -320,6 +320,44 @@ before_script: rules: - !reference [.upstream_rules, rules] +#-----------------------------------------------------------# +# OpenRGB Common Flatpak Build Steps # +#-----------------------------------------------------------# +.hidden_flatpak_script: &flatpak_script_steps + image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.10 + stage: build + tags: + - linux + - ${TGT_ARCH} + script: + - flatpak-builder --user --disable-rofiles-fuse --repo=build/repo build/flatpak-build flatpak/org.openrgb.OpenRGB.yaml + - flatpak build-bundle build/repo org.openrgb.OpenRGB.flatpak org.openrgb.OpenRGB + + artifacts: + name: "${CI_PROJECT_NAME}_Linux_${TGT_ARCH}_Flatpak_${CI_COMMIT_SHORT_SHA}" + paths: + - org.openrgb.OpenRGB.flatpak + expire_in: 30 days + + rules: + - !reference [.upstream_rules, rules] + +#-----------------------------------------------------------# +# Linux Flatpak amd64 Build Target # +#-----------------------------------------------------------# +"Linux amd64 Flatpak": + variables: + TGT_ARCH: "amd64" + <<: *flatpak_script_steps + +#-----------------------------------------------------------# +# Linux Flatpak arm64 Build Target # +#-----------------------------------------------------------# +"Linux arm64 Flatpak": + variables: + TGT_ARCH: "arm64" + <<: *flatpak_script_steps + #-----------------------------------------------------------# # Debian i386 Bookworm test # #-----------------------------------------------------------# diff --git a/PluginManager.cpp b/PluginManager.cpp index 1a1cd4c53..a657825ca 100644 --- a/PluginManager.cpp +++ b/PluginManager.cpp @@ -152,7 +152,7 @@ void PluginManager::ScanAndLoadPluginsFrom(const filesystem::path & plugins_dir, /*-----------------------------------------------------*\ | Get a list of all files in the plugins directory | \*-----------------------------------------------------*/ - for(const filesystem::directory_entry& entry: filesystem::directory_iterator(plugins_dir)) + for(const filesystem::directory_entry& entry: filesystem::recursive_directory_iterator(plugins_dir)) { if(filesystem::is_directory(entry.path())) { diff --git a/flatpak/org.openrgb.OpenRGB.yaml b/flatpak/org.openrgb.OpenRGB.yaml new file mode 100644 index 000000000..fc625dee9 --- /dev/null +++ b/flatpak/org.openrgb.OpenRGB.yaml @@ -0,0 +1,74 @@ +id: org.openrgb.OpenRGB +sdk: org.kde.Sdk +runtime: org.kde.Platform +runtime-version: 6.10 +command: openrgb +finish-args: + - --device=all + - --share=ipc + - --share=network + - --socket=wayland + - --socket=fallback-x11 + # Tray Icon + - --talk-name=org.kde.StatusNotifierWatcher + # Udev Check + - --filesystem=host-etc:ro + - --filesystem=host:ro + +cleanup: + - /include + - /lib/cmake + - /lib/pkgconfig + - '*.a' + - '*.la' + +add-extensions: + org.openrgb.OpenRGB.Plugin: + version: '5' + directory: lib/openrgb/plugins + add-ld-path: lib + subdirectories: true + no-autodownload: false + +modules: + - name: libhidapi-hotplug + buildsystem: cmake-ninja + sources: + - type: git + url: https://gitlab.com/OpenRGBDevelopers/hidapi-hotplug.git + tag: hidapi-hotplug-0.15.0 + commit: 238df449ecc0a56a70a3c8f4ebf46bb46857af27 + + - name: mbedtls + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_POSITION_INDEPENDENT_CODE=ON + - -DENABLE_PROGRAMS=OFF + - -DENABLE_TESTING=OFF + - -DUSE_SHARED_MBEDTLS_LIBRARY=ON + - -DUSE_STATIC_MBEDTLS_LIBRARY=OFF + sources: + - type: git + url: https://github.com/ARMmbed/mbedtls.git + tag: v3.6.7 + commit: 068ff080b369adfac81509f9b57b2afabaf82dc5 + x-checker-data: + type: git + tag-pattern: ^v([\d.]+)$ + versions: + <: v4.0 + + - name: openrgb + buildsystem: qmake + config-opts: + - QMAKE_LIBS+=-L/app/lib + sources: + - type: dir + path: ../ + + - name: create-mount-points + buildsystem: simple + build-commands: + - mkdir -p /app/lib/openrgb/plugins \ No newline at end of file