# Flatpak manifest for the capture application. # # Runtime is org.kde.Platform because the application is Qt 6; the KDE runtime carries Qt # itself, libusb and libFLAC, so this manifest builds one module and nothing else. # # 6.11 is a floor, not a preference. libusb reached the freedesktop-sdk base the KDE runtime # is built on in 25.08, so 6.9 and earlier carry libFLAC but no libusb, and the build fails # at the find_package for it. The packaging workflow reads this value rather than repeating # it. # # The .desktop file, the AppStream metadata and the icons are installed by the CMake build # (see ../../CMakeLists.txt) rather than copied here, so there is one definition of the # application ID rather than two that can drift apart. # # BUILD_TESTING is off: the suite needs gtest, which the runtime does not carry, and it has # already run in CI against the same commit. A Flatpak build that also built the tests would # be adding a dependency to prove something already proved. # # SPDX-License-Identifier: GPL-3.0-or-later app-id: io.github.simoninns.DddGui runtime: org.kde.Platform runtime-version: '6.11' sdk: org.kde.Sdk command: ddd-gui finish-args: - --share=ipc - --socket=wayland - --socket=x11 # Not for the network. This application makes no network connections at all — it is asked # for here because it is the only way a Flatpak receives kernel device-attach events, and # without them a Duplicator plugged in after the window opens is never found. # # The chain, measured on org.kde.Platform 6.11 rather than assumed: # # 1. The runtime's libusb is built against libudev and learns about devices appearing # and disappearing from a udev netlink monitor (udev_monitor_new_from_netlink in # libusb-1.0.so.0.5.0). libusb_get_device_list does not rescan; on Linux it returns # the list that monitor maintains, seeded by one sysfs scan at libusb_init. # 2. Without this line the sandbox gets a network namespace of its own — measured: # net:[4026534450] against the host's net:[4026531833] — owned by the sandbox's user # namespace rather than by the initial one. # 3. The netlink socket is still created and bound in there without complaint (also # measured), but the kernel does not broadcast untagged kobject uevents into a # network namespace outside the initial user namespace. So the monitor waits for # events that can never arrive, reports no error, and libusb's device list is frozen # at whatever was attached when the application started. # # With this line the sandbox stays in the host's own network namespace — measured: # net:[4026531833], the same one — and the events arrive. # # This is the permission a Flathub review will ask about after --device=all, and the # answer is that a capture application that opens no sockets needs to be in the host's # network namespace to be told a cable was plugged in. There is no narrower Flatpak # permission for kernel uevents, and no portal for them. - --share=network # Raw USB access to the capture device. Flatpak has no narrower static permission for # USB — --device=all is the only option that grants it, and the capture path is a libusb # bulk transfer, so there is no portal alternative. This is the permission a Flathub # review will ask about, and the answer is that the application's entire purpose is # talking to one specific USB 3.0 device. The same permission covers updating the # device's own firmware and gateware, which is the same cable and the same endpoint. # # It is also what grants the serial port for LaserDisc player control: /dev/ttyUSB* and # /dev/ttyACM* are inside /dev, there is no narrower static permission that reaches them # and no portal for a serial device, so this one line covers both cables. Two things # worth stating rather than discovering: the sandbox keeps the user's supplementary # groups, so membership of dialout (or uucp) is still required exactly as it is outside # a Flatpak — this permission does not route around it — and player control is off until # a user turns it on, so a Flatpak install opens no serial port until asked to. - --device=all # Captures are large and usually land on an external or secondary drive, and the file # chooser portal only grants the single file picked — which is no use for choosing an # output directory that a multi-hour capture then writes into. - --filesystem=home - --filesystem=/run/media - --filesystem=/media - --filesystem=/mnt modules: # The KDE runtime carries Qt, libusb and libFLAC, but not spdlog, so the one dependency # this manifest has to build is the log's console and file destinations. Pinned by tag # and checksum like every other Flatpak source: flatpak-builder fetches sources before # it starts, and the build itself has no network. # # Static, with spdlog's own bundled copy of fmt. A shared library would need a second # module for fmt and would put two more files in /app/lib to no purpose — nothing but # ddd-gui links it. - name: spdlog buildsystem: cmake-ninja config-opts: - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_POSITION_INDEPENDENT_CODE=ON # Stated rather than left to GNUInstallDirs, which chooses lib64 on a 64-bit host and # would put the library somewhere the cleanup patterns below do not name. - -DCMAKE_INSTALL_LIBDIR=lib - -DSPDLOG_BUILD_SHARED=OFF - -DSPDLOG_BUILD_EXAMPLE=OFF - -DSPDLOG_BUILD_TESTS=OFF sources: - type: archive url: https://github.com/gabime/spdlog/archive/refs/tags/v1.17.0.tar.gz sha256: d8862955c6d74e5846b3f580b1605d2428b11d97a410d86e2fb13e857cd3a744 cleanup: - /include - /lib/cmake - /lib/pkgconfig - /lib/*.a - name: ddd-gui buildsystem: cmake-ninja subdir: ddd-gui config-opts: - -DCMAKE_BUILD_TYPE=Release - -DBUILD_TESTING=OFF # Passed in by the packaging workflow. There is no .git inside a flatpak-builder # sandbox, so CMake cannot find the commit for itself and would report "unknown", # which is what the release gate fails a build for. - -DDDD_COMMIT=@DDD_COMMIT@ # The release signing key, whose public half is committed. The source below is the # repository root rather than ddd-gui/ alone, so tools/keys/ is inside the sandbox # and CMake's in-tree default would find it — this states it rather than relying on # a relative path that a subdir build makes surprising. - -DDDD_RELEASE_UPDATE_KEY_FILE=/run/build/ddd-gui/tools/keys/release.pub # The bundled update file, so that a board can be brought up on a machine with # no network. Fetched by digest before the build from the pin in # packaging/bundled-update.env — flatpak-builder gives the build no network, # which is exactly right: the file has to be in the source tree by then or it is not # in this build at all. The packaging workflow substitutes the path here, or deletes # this line when nothing is pinned. - -DDDD_BUNDLED_UPDATE_FILE=@DDD_BUNDLED_UPDATE_FILE@ sources: - type: dir path: ../../..