Skip to content

Commit 36d9e21

Browse files
committed
Add Flatpak packaging
1 parent a351059 commit 36d9e21

7 files changed

Lines changed: 229 additions & 12 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build-flatpak
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
Flatpak:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
13+
options: --privileged
14+
15+
steps:
16+
- name: Check Out Code
17+
uses: actions/checkout@v6
18+
with:
19+
submodules: recursive
20+
fetch-depth: 0
21+
22+
- name: Build Flatpak bundle
23+
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
24+
env:
25+
FLATPAK_BUILDER_N_JOBS: "2"
26+
with:
27+
bundle: ngscopeclient.flatpak
28+
manifest-path: packaging/flatpak/org.ngscopeclient.ngscopeclient.yml
29+
cache-key: flatpak-builder-${{ github.sha }}

CMakeLists.txt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -361,17 +361,21 @@ set(CPACK_STRIP_FILES TRUE)
361361

362362
# Figure out what distro version we're on
363363
if(LINUX)
364-
find_program(LSB_RELEASE_EXEC lsb_release REQUIRED)
365-
execute_process(COMMAND ${LSB_RELEASE_EXEC} -is
366-
OUTPUT_VARIABLE DISTRO_NAME
367-
OUTPUT_STRIP_TRAILING_WHITESPACE
368-
COMMAND_ERROR_IS_FATAL ANY)
369-
execute_process(COMMAND ${LSB_RELEASE_EXEC} -rs
370-
OUTPUT_VARIABLE DISTRO_VER
371-
OUTPUT_STRIP_TRAILING_WHITESPACE
372-
COMMAND_ERROR_IS_FATAL ANY)
373-
374-
message(STATUS "Linux distribution target for packaging: name ${DISTRO_NAME}, version ${DISTRO_VER}")
364+
find_program(LSB_RELEASE_EXEC lsb_release)
365+
if(LSB_RELEASE_EXEC)
366+
execute_process(COMMAND ${LSB_RELEASE_EXEC} -is
367+
OUTPUT_VARIABLE DISTRO_NAME
368+
OUTPUT_STRIP_TRAILING_WHITESPACE
369+
COMMAND_ERROR_IS_FATAL ANY)
370+
execute_process(COMMAND ${LSB_RELEASE_EXEC} -rs
371+
OUTPUT_VARIABLE DISTRO_VER
372+
OUTPUT_STRIP_TRAILING_WHITESPACE
373+
COMMAND_ERROR_IS_FATAL ANY)
374+
375+
message(STATUS "Linux distribution target for packaging: name ${DISTRO_NAME}, version ${DISTRO_VER}")
376+
else()
377+
message(STATUS "lsb_release not found; distro-specific package metadata unavailable")
378+
endif()
375379

376380
# Debian specific packaging config
377381
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andrew Zonenberg <andrew.zonenberg@antikernel.net>")

packaging/flatpak/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Flatpak packaging
2+
3+
This directory contains a Flatpak manifest for building ngscopeclient as
4+
`org.ngscopeclient.ngscopeclient`.
5+
6+
Build locally from the repository root with:
7+
8+
```sh
9+
flatpak-builder --force-clean --install-deps-from=flathub build-flatpak packaging/flatpak/org.ngscopeclient.ngscopeclient.yml
10+
```
11+
12+
On memory-constrained builders, add `--jobs=2`.
13+
14+
Create a bundle with:
15+
16+
```sh
17+
flatpak-builder --repo=flatpak-repo --force-clean --install-deps-from=flathub build-flatpak packaging/flatpak/org.ngscopeclient.ngscopeclient.yml
18+
flatpak build-bundle flatpak-repo ngscopeclient.flatpak org.ngscopeclient.ngscopeclient
19+
```
20+
21+
The manifest grants network and device access because ngscopeclient controls
22+
test instruments over network, USB, serial, and GPU/Vulkan interfaces.
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
app-id: org.ngscopeclient.ngscopeclient
2+
runtime: org.gnome.Platform
3+
runtime-version: "50"
4+
sdk: org.gnome.Sdk
5+
command: ngscopeclient
6+
rename-desktop-file: ngscopeclient.desktop
7+
rename-icon: ngscopeclient
8+
finish-args:
9+
- --share=ipc
10+
- --share=network
11+
- --socket=fallback-x11
12+
- --socket=wayland
13+
- --device=dri
14+
- --device=all
15+
- --filesystem=xdg-documents:rw
16+
- --filesystem=xdg-download:rw
17+
cleanup:
18+
- /include
19+
- /lib/cmake
20+
- /lib/pkgconfig
21+
- /share/doc
22+
- /share/man
23+
modules:
24+
- name: yaml-cpp
25+
buildsystem: cmake-ninja
26+
config-opts:
27+
- -DCMAKE_BUILD_TYPE=Release
28+
- -DCMAKE_POLICY_VERSION_MINIMUM=3.5
29+
- -DYAML_BUILD_SHARED_LIBS=ON
30+
- -DYAML_CPP_BUILD_TESTS=OFF
31+
- -DYAML_CPP_BUILD_TOOLS=OFF
32+
sources:
33+
- type: git
34+
url: https://github.com/jbeder/yaml-cpp.git
35+
commit: f7320141120f720aecc4c32be25586e7da9eb978
36+
- type: patch
37+
path: patches/yaml-cpp-gcc15-cstdint.patch
38+
39+
- name: libsigcplusplus
40+
buildsystem: meson
41+
config-opts:
42+
- -Dbuild-documentation=false
43+
- -Dbuild-examples=false
44+
- -Dbuild-tests=false
45+
- -Dmaintainer-mode=false
46+
sources:
47+
- type: git
48+
url: https://github.com/libsigcplusplus/libsigcplusplus.git
49+
commit: eb7db8ef3b5cba44ec4b46d158ec03e2aa3c537a
50+
51+
- name: hidapi
52+
buildsystem: cmake-ninja
53+
config-opts:
54+
- -DCMAKE_BUILD_TYPE=Release
55+
- -DBUILD_SHARED_LIBS=ON
56+
- -DHIDAPI_BUILD_HIDTEST=OFF
57+
- -DHIDAPI_WITH_HIDRAW=ON
58+
- -DHIDAPI_WITH_LIBUSB=OFF
59+
sources:
60+
- type: git
61+
url: https://github.com/libusb/hidapi.git
62+
commit: dbff4ea89f55a572aeb0c53a7b32ea70853ec260
63+
64+
- name: glfw
65+
buildsystem: cmake-ninja
66+
config-opts:
67+
- -DCMAKE_BUILD_TYPE=Release
68+
- -DGLFW_BUILD_DOCS=OFF
69+
- -DGLFW_BUILD_EXAMPLES=OFF
70+
- -DGLFW_BUILD_TESTS=OFF
71+
sources:
72+
- type: git
73+
url: https://github.com/glfw/glfw.git
74+
commit: a74efa0d5628b74adc0426af4c5710e287fa7c2c
75+
76+
- name: spirv-headers
77+
buildsystem: cmake-ninja
78+
config-opts:
79+
- -DCMAKE_BUILD_TYPE=Release
80+
sources:
81+
- type: git
82+
url: https://github.com/KhronosGroup/SPIRV-Headers.git
83+
commit: 09913f088a1197aba4aefd300a876b2ebbaa3391
84+
85+
- name: spirv-tools
86+
buildsystem: cmake-ninja
87+
config-opts:
88+
- -DCMAKE_BUILD_TYPE=Release
89+
- -DSPIRV_SKIP_TESTS=ON
90+
- -DSPIRV_WERROR=OFF
91+
sources:
92+
- type: git
93+
url: https://github.com/KhronosGroup/SPIRV-Tools.git
94+
commit: f289d047f49fb60488301ec62bafab85573668cc
95+
- type: git
96+
url: https://github.com/KhronosGroup/SPIRV-Headers.git
97+
commit: 09913f088a1197aba4aefd300a876b2ebbaa3391
98+
dest: external/spirv-headers
99+
100+
- name: glslang
101+
buildsystem: cmake-ninja
102+
config-opts:
103+
- -DCMAKE_BUILD_TYPE=Release
104+
- -DBUILD_TESTING=OFF
105+
- -DBUILD_EXTERNAL=OFF
106+
- -DALLOW_EXTERNAL_SPIRV_TOOLS=ON
107+
- -DENABLE_OPT=ON
108+
sources:
109+
- type: git
110+
url: https://github.com/KhronosGroup/glslang.git
111+
commit: 7200bc12a8979d13b22cd52de80ffb7d41939615
112+
113+
- name: ngscopeclient
114+
buildsystem: cmake-ninja
115+
builddir: true
116+
config-opts:
117+
- -DCMAKE_BUILD_TYPE=Release
118+
- -DDISABLE_PCH=ON
119+
- -DBUILD_TESTING=OFF
120+
- -DBUILD_DOCS=OFF
121+
- -DBUILD_DEVDOCS=OFF
122+
- -DNGSCOPECLIENT_PACKAGE_VERSION=v0.1
123+
- -DNGSCOPECLIENT_PACKAGE_VERSION_LONG=v0.1-0
124+
sources:
125+
- type: dir
126+
path: ../..
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
diff --git a/src/emitterutils.cpp b/src/emitterutils.cpp
2+
index 91408b2..450f7b0 100644
3+
--- a/src/emitterutils.cpp
4+
+++ b/src/emitterutils.cpp
5+
@@ -1,4 +1,5 @@
6+
#include <algorithm>
7+
+#include <cstdint>
8+
#include <iomanip>
9+
#include <sstream>
10+

src/ngscopeclient/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ if(LINUX)
259259
DESTINATION share/applications)
260260
install(FILES ${CMAKE_SOURCE_DIR}/src/ngscopeclient/ngscopeclient.xml
261261
DESTINATION share/mime/packages)
262+
install(FILES ${CMAKE_SOURCE_DIR}/src/ngscopeclient/org.ngscopeclient.ngscopeclient.metainfo.xml
263+
DESTINATION share/metainfo)
262264
endif()
263265

264266
if(APPLE)
@@ -357,4 +359,3 @@ if(WIXPATH AND WIN32)
357359
elseif(WIN32)
358360
message("Skipping MSI package build; define WIXPATH to enable")
359361
endif()
360-
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<component type="desktop-application">
3+
<id>org.ngscopeclient.ngscopeclient</id>
4+
<metadata_license>CC0-1.0</metadata_license>
5+
<project_license>BSD-3-Clause</project_license>
6+
<name>ngscopeclient</name>
7+
<summary>Remote-control and signal-analysis suite for test equipment</summary>
8+
<description>
9+
<p>
10+
ngscopeclient provides cross-platform remote control, waveform analysis,
11+
protocol decoding, and visualization for oscilloscopes and other test and
12+
measurement instruments.
13+
</p>
14+
</description>
15+
<launchable type="desktop-id">org.ngscopeclient.ngscopeclient.desktop</launchable>
16+
<url type="homepage">https://www.ngscopeclient.org/</url>
17+
<url type="bugtracker">https://github.com/ngscopeclient/scopehal-apps/issues</url>
18+
<developer id="org.ngscopeclient">
19+
<name>ngscopeclient.org project</name>
20+
</developer>
21+
<content_rating type="oars-1.1" />
22+
<releases>
23+
<release version="0.1" date="2026-05-12" />
24+
</releases>
25+
</component>

0 commit comments

Comments
 (0)