From 764bf611750a6047763d38585aa36e28b7587bd2 Mon Sep 17 00:00:00 2001 From: Dyltom <2175114+Dyltom@users.noreply.github.com> Date: Tue, 12 May 2026 12:04:00 +1000 Subject: [PATCH 1/3] Add Flatpak packaging --- .github/workflows/build-flatpak.yml | 29 ++++ CMakeLists.txt | 26 ++-- packaging/flatpak/README.md | 22 +++ .../org.ngscopeclient.ngscopeclient.yml | 126 ++++++++++++++++++ .../patches/yaml-cpp-gcc15-cstdint.patch | 10 ++ src/ngscopeclient/CMakeLists.txt | 3 +- ...g.ngscopeclient.ngscopeclient.metainfo.xml | 25 ++++ 7 files changed, 229 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build-flatpak.yml create mode 100644 packaging/flatpak/README.md create mode 100644 packaging/flatpak/org.ngscopeclient.ngscopeclient.yml create mode 100644 packaging/flatpak/patches/yaml-cpp-gcc15-cstdint.patch create mode 100644 src/ngscopeclient/org.ngscopeclient.ngscopeclient.metainfo.xml diff --git a/.github/workflows/build-flatpak.yml b/.github/workflows/build-flatpak.yml new file mode 100644 index 00000000..08a54c05 --- /dev/null +++ b/.github/workflows/build-flatpak.yml @@ -0,0 +1,29 @@ +name: Build-flatpak + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + Flatpak: + runs-on: ubuntu-latest + container: + image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50 + options: --privileged + + steps: + - name: Check Out Code + uses: actions/checkout@v6 + with: + submodules: recursive + fetch-depth: 0 + + - name: Build Flatpak bundle + uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + env: + FLATPAK_BUILDER_N_JOBS: "2" + with: + bundle: ngscopeclient.flatpak + manifest-path: packaging/flatpak/org.ngscopeclient.ngscopeclient.yml + cache-key: flatpak-builder-${{ github.sha }} diff --git a/CMakeLists.txt b/CMakeLists.txt index a57b41c7..58e340bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,17 +361,21 @@ set(CPACK_STRIP_FILES TRUE) # Figure out what distro version we're on if(LINUX) - find_program(LSB_RELEASE_EXEC lsb_release REQUIRED) - execute_process(COMMAND ${LSB_RELEASE_EXEC} -is - OUTPUT_VARIABLE DISTRO_NAME - OUTPUT_STRIP_TRAILING_WHITESPACE - COMMAND_ERROR_IS_FATAL ANY) - execute_process(COMMAND ${LSB_RELEASE_EXEC} -rs - OUTPUT_VARIABLE DISTRO_VER - OUTPUT_STRIP_TRAILING_WHITESPACE - COMMAND_ERROR_IS_FATAL ANY) - - message(STATUS "Linux distribution target for packaging: name ${DISTRO_NAME}, version ${DISTRO_VER}") + find_program(LSB_RELEASE_EXEC lsb_release) + if(LSB_RELEASE_EXEC) + execute_process(COMMAND ${LSB_RELEASE_EXEC} -is + OUTPUT_VARIABLE DISTRO_NAME + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) + execute_process(COMMAND ${LSB_RELEASE_EXEC} -rs + OUTPUT_VARIABLE DISTRO_VER + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) + + message(STATUS "Linux distribution target for packaging: name ${DISTRO_NAME}, version ${DISTRO_VER}") + else() + message(STATUS "lsb_release not found; distro-specific package metadata unavailable") + endif() # Debian specific packaging config set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andrew Zonenberg ") diff --git a/packaging/flatpak/README.md b/packaging/flatpak/README.md new file mode 100644 index 00000000..29cc37cf --- /dev/null +++ b/packaging/flatpak/README.md @@ -0,0 +1,22 @@ +# Flatpak packaging + +This directory contains a Flatpak manifest for building ngscopeclient as +`org.ngscopeclient.ngscopeclient`. + +Build locally from the repository root with: + +```sh +flatpak-builder --force-clean --install-deps-from=flathub build-flatpak packaging/flatpak/org.ngscopeclient.ngscopeclient.yml +``` + +On memory-constrained builders, add `--jobs=2`. + +Create a bundle with: + +```sh +flatpak-builder --repo=flatpak-repo --force-clean --install-deps-from=flathub build-flatpak packaging/flatpak/org.ngscopeclient.ngscopeclient.yml +flatpak build-bundle flatpak-repo ngscopeclient.flatpak org.ngscopeclient.ngscopeclient +``` + +The manifest grants network and device access because ngscopeclient controls +test instruments over network, USB, serial, and GPU/Vulkan interfaces. diff --git a/packaging/flatpak/org.ngscopeclient.ngscopeclient.yml b/packaging/flatpak/org.ngscopeclient.ngscopeclient.yml new file mode 100644 index 00000000..cbac7d4d --- /dev/null +++ b/packaging/flatpak/org.ngscopeclient.ngscopeclient.yml @@ -0,0 +1,126 @@ +app-id: org.ngscopeclient.ngscopeclient +runtime: org.gnome.Platform +runtime-version: "50" +sdk: org.gnome.Sdk +command: ngscopeclient +rename-desktop-file: ngscopeclient.desktop +rename-icon: ngscopeclient +finish-args: + - --share=ipc + - --share=network + - --socket=fallback-x11 + - --socket=wayland + - --device=dri + - --device=all + - --filesystem=xdg-documents:rw + - --filesystem=xdg-download:rw +cleanup: + - /include + - /lib/cmake + - /lib/pkgconfig + - /share/doc + - /share/man +modules: + - name: yaml-cpp + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + - -DYAML_BUILD_SHARED_LIBS=ON + - -DYAML_CPP_BUILD_TESTS=OFF + - -DYAML_CPP_BUILD_TOOLS=OFF + sources: + - type: git + url: https://github.com/jbeder/yaml-cpp.git + commit: f7320141120f720aecc4c32be25586e7da9eb978 + - type: patch + path: patches/yaml-cpp-gcc15-cstdint.patch + + - name: libsigcplusplus + buildsystem: meson + config-opts: + - -Dbuild-documentation=false + - -Dbuild-examples=false + - -Dbuild-tests=false + - -Dmaintainer-mode=false + sources: + - type: git + url: https://github.com/libsigcplusplus/libsigcplusplus.git + commit: eb7db8ef3b5cba44ec4b46d158ec03e2aa3c537a + + - name: hidapi + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DBUILD_SHARED_LIBS=ON + - -DHIDAPI_BUILD_HIDTEST=OFF + - -DHIDAPI_WITH_HIDRAW=ON + - -DHIDAPI_WITH_LIBUSB=OFF + sources: + - type: git + url: https://github.com/libusb/hidapi.git + commit: dbff4ea89f55a572aeb0c53a7b32ea70853ec260 + + - name: glfw + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DGLFW_BUILD_DOCS=OFF + - -DGLFW_BUILD_EXAMPLES=OFF + - -DGLFW_BUILD_TESTS=OFF + sources: + - type: git + url: https://github.com/glfw/glfw.git + commit: a74efa0d5628b74adc0426af4c5710e287fa7c2c + + - name: spirv-headers + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + sources: + - type: git + url: https://github.com/KhronosGroup/SPIRV-Headers.git + commit: 09913f088a1197aba4aefd300a876b2ebbaa3391 + + - name: spirv-tools + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DSPIRV_SKIP_TESTS=ON + - -DSPIRV_WERROR=OFF + sources: + - type: git + url: https://github.com/KhronosGroup/SPIRV-Tools.git + commit: f289d047f49fb60488301ec62bafab85573668cc + - type: git + url: https://github.com/KhronosGroup/SPIRV-Headers.git + commit: 09913f088a1197aba4aefd300a876b2ebbaa3391 + dest: external/spirv-headers + + - name: glslang + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DBUILD_TESTING=OFF + - -DBUILD_EXTERNAL=OFF + - -DALLOW_EXTERNAL_SPIRV_TOOLS=ON + - -DENABLE_OPT=ON + sources: + - type: git + url: https://github.com/KhronosGroup/glslang.git + commit: 7200bc12a8979d13b22cd52de80ffb7d41939615 + + - name: ngscopeclient + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DDISABLE_PCH=ON + - -DBUILD_TESTING=OFF + - -DBUILD_DOCS=OFF + - -DBUILD_DEVDOCS=OFF + - -DNGSCOPECLIENT_PACKAGE_VERSION=v0.1 + - -DNGSCOPECLIENT_PACKAGE_VERSION_LONG=v0.1-0 + sources: + - type: dir + path: ../.. diff --git a/packaging/flatpak/patches/yaml-cpp-gcc15-cstdint.patch b/packaging/flatpak/patches/yaml-cpp-gcc15-cstdint.patch new file mode 100644 index 00000000..1956ac75 --- /dev/null +++ b/packaging/flatpak/patches/yaml-cpp-gcc15-cstdint.patch @@ -0,0 +1,10 @@ +diff --git a/src/emitterutils.cpp b/src/emitterutils.cpp +index 91408b2..450f7b0 100644 +--- a/src/emitterutils.cpp ++++ b/src/emitterutils.cpp +@@ -1,4 +1,5 @@ + #include ++#include + #include + #include + diff --git a/src/ngscopeclient/CMakeLists.txt b/src/ngscopeclient/CMakeLists.txt index afe85991..b9c44fc1 100644 --- a/src/ngscopeclient/CMakeLists.txt +++ b/src/ngscopeclient/CMakeLists.txt @@ -259,6 +259,8 @@ if(LINUX) DESTINATION share/applications) install(FILES ${CMAKE_SOURCE_DIR}/src/ngscopeclient/ngscopeclient.xml DESTINATION share/mime/packages) + install(FILES ${CMAKE_SOURCE_DIR}/src/ngscopeclient/org.ngscopeclient.ngscopeclient.metainfo.xml + DESTINATION share/metainfo) endif() if(APPLE) @@ -357,4 +359,3 @@ if(WIXPATH AND WIN32) elseif(WIN32) message("Skipping MSI package build; define WIXPATH to enable") endif() - diff --git a/src/ngscopeclient/org.ngscopeclient.ngscopeclient.metainfo.xml b/src/ngscopeclient/org.ngscopeclient.ngscopeclient.metainfo.xml new file mode 100644 index 00000000..fb474e5b --- /dev/null +++ b/src/ngscopeclient/org.ngscopeclient.ngscopeclient.metainfo.xml @@ -0,0 +1,25 @@ + + + org.ngscopeclient.ngscopeclient + CC0-1.0 + BSD-3-Clause + ngscopeclient + Remote-control and signal-analysis suite for test equipment + +

+ ngscopeclient provides cross-platform remote control, waveform analysis, + protocol decoding, and visualization for oscilloscopes and other test and + measurement instruments. +

+
+ org.ngscopeclient.ngscopeclient.desktop + https://www.ngscopeclient.org/ + https://github.com/ngscopeclient/scopehal-apps/issues + + ngscopeclient.org project + + + + + +
From bf931c0fd6928cc27c5d60d06dd4cb09de67cce5 Mon Sep 17 00:00:00 2001 From: Dyltom <2175114+Dyltom@users.noreply.github.com> Date: Wed, 13 May 2026 08:04:16 +1000 Subject: [PATCH 2/3] ci: fix flatpak workflow submodules on forks --- .github/workflows/build-flatpak.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-flatpak.yml b/.github/workflows/build-flatpak.yml index 08a54c05..e3b266a0 100644 --- a/.github/workflows/build-flatpak.yml +++ b/.github/workflows/build-flatpak.yml @@ -16,9 +16,16 @@ jobs: - name: Check Out Code uses: actions/checkout@v6 with: - submodules: recursive + submodules: false fetch-depth: 0 + - name: Check Out Submodules + run: | + git config submodule.lib.url https://github.com/ngscopeclient/scopehal.git + git config submodule.doc.url https://github.com/ngscopeclient/scopehal-docs.git + git submodule sync --recursive + git submodule update --init --recursive + - name: Build Flatpak bundle uses: flatpak/flatpak-github-actions/flatpak-builder@v6 env: From 3d4cf51da552952d6b662f1edae8ac505aafe68b Mon Sep 17 00:00:00 2001 From: Dyltom <2175114+Dyltom@users.noreply.github.com> Date: Wed, 13 May 2026 08:22:57 +1000 Subject: [PATCH 3/3] ci: run flatpak submodule setup in workspace --- .github/workflows/build-flatpak.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-flatpak.yml b/.github/workflows/build-flatpak.yml index e3b266a0..2abd4005 100644 --- a/.github/workflows/build-flatpak.yml +++ b/.github/workflows/build-flatpak.yml @@ -21,10 +21,10 @@ jobs: - name: Check Out Submodules run: | - git config submodule.lib.url https://github.com/ngscopeclient/scopehal.git - git config submodule.doc.url https://github.com/ngscopeclient/scopehal-docs.git - git submodule sync --recursive - git submodule update --init --recursive + git -C "$GITHUB_WORKSPACE" config submodule.lib.url https://github.com/ngscopeclient/scopehal.git + git -C "$GITHUB_WORKSPACE" config submodule.doc.url https://github.com/ngscopeclient/scopehal-docs.git + git -C "$GITHUB_WORKSPACE" submodule sync --recursive + git -C "$GITHUB_WORKSPACE" submodule update --init --recursive - name: Build Flatpak bundle uses: flatpak/flatpak-github-actions/flatpak-builder@v6