Add snap package support for KLog - #1064
Open
ea4k wants to merge 6 commits into
Open
Conversation
Package KLog as a strictly confined snap so it can be installed on any GNU/Linux distribution running snapd, independently of the Qt version that distribution ships. The recipe builds against core26 (Ubuntu 26.04). KLog links against Qt6 Location for the map window, and upstream Qt had no QtLocation between 6.0 and 6.4, so the module is absent from the Ubuntu 24.04 archive that core24 snaps are built from. The KDE neon extensions ship a newer Qt but explicitly leave out QtCharts, which KLog needs for the statistics widgets. Ubuntu 26.04 carries the complete Qt 6.10 set as well as Hamlib, so every dependency comes from the distribution archive: nothing is built from source and no third-party apt repository is involved. core26 has no GNOME/KDE desktop extension yet, so snap/local/klog-launch does the work those extensions normally do for a Qt application - Qt plugin and QML search paths, the library path for the staged Qt, fontconfig and the XDG data directories - and the "gpu" extension provides the Mesa userspace drivers the QtQuick map needs. Because a confined snap gets its own home, KLog's data directory becomes ~/snap/klog/current/.klog. The launcher copies an existing ~/.klog into it on the first run so a logbook made by the .deb is not left behind; the original is never modified and KLOG_SNAP_NO_MIGRATE=1 skips the copy. Added: snap/snapcraft.yaml the recipe snap/local/klog-launch command-chain wrapper devscripts/snap-create-package.sh build helper, matching the .deb one .github/workflows/snap.yml CI build, artifact and store publishing INSTALL-snap installing, interfaces, building, publishing The build checks that the translations made it into the package, the same check the Debian package script performs, and CI additionally verifies that the QtLocation QML module, the geoservices plugins and the Qt SQLite driver are present. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019NH3YWvwLzEr3nZuQdhUZM
…ment core26 (Ubuntu 26.04) is the newest snap base available - bases are only made from LTS releases, so there is nothing above it - and it is the only Ubuntu that carries both Qt6 Location and Qt6 Charts, the two modules KLog needs that no earlier base can supply. Record the exact versions the archive publishes (Qt 6.10.2, Hamlib 4.6.5) and spell out that the base is what KLog is built against, not what the user has to be running: snapd pulls the base snap in as a dependency, so the package installs the same on Ubuntu 22.04, Debian, Fedora or Arch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019NH3YWvwLzEr3nZuQdhUZM
"snapcraft login" keeps its token in the system keyring, so on a build server, in a container or over SSH it fails outright with "No keyring found to store or retrieve credentials from". Section 7 sent the reader straight into that command with no warning. Explain the headless route instead: "snapcraft export-login" does not touch the keyring, and exporting SNAPCRAFT_STORE_CREDENTIALS from the file it writes authenticates every snapcraft command in the shell. Note that the first export cannot use --snaps, since credentials can only be scoped to a snap that is already registered, and point at the web registration form as the alternative that needs no working CLI login. Also state up front that building the snap needs no store account at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019NH3YWvwLzEr3nZuQdhUZM
The publishing section told the reader to check whether "klog" was free and what to do if an unrelated project held it. The name is registered to the KLog account, which is the name the recipe builds under, so drop the speculation and say so. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019NH3YWvwLzEr3nZuQdhUZM
devscripts/jenkins/Jenkinsfile.snap builds the snap on the debian-stable
agent in the same shape as the other platform jobs: power the ESXi VM on,
build, verify, upload to the NAS, power it off, and power it off again from
the failure handler. It reuses the credentials klog-debian-stable already
needs, so Jenkins gains no new secrets.
The agent does not need any Qt6 or Hamlib development package, because
snapcraft builds inside an LXD container running Ubuntu 26.04. What it does
need is snapd, snapcraft, LXD and a jenkins user in the lxd group, none of
which the .deb build required, so the pipeline opens with a Preflight stage
that checks for each of them and reports the exact missing command instead
of failing later mid-build.
Two details specific to running snapcraft under Jenkins are handled in the
build script as well, so it behaves the same when called by hand:
- /snap/bin is only put on PATH by a login shell, and Jenkins runs sh
non-login, so snapcraft would not be found at all.
- snapcraft clean has nothing to do on a fresh checkout, and its non-zero
exit must not abort the run.
It also pins SNAPCRAFT_BUILD_ENVIRONMENT to lxd and fails with the setup
commands if LXD is missing or unreachable, since core26 cannot be built
destructively on a Debian host.
klog-snap and klog-debian-stable share the one VM, so Jenkinsfile.all runs
them sequentially inside its "Debian stable" stage; in parallel the first to
finish would power the machine off under the other.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019NH3YWvwLzEr3nZuQdhUZM
Revert Jenkinsfile.all to exactly what it was: klog-snap runs on its own with Build Now, not as part of the all-platforms run. Keep the note about the two jobs sharing the debian-stable VM, since it still applies the day klog-snap is added there - each job powers the machine off when it finishes, so a parallel branch would pull the VM out from under klog-debian-stable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019NH3YWvwLzEr3nZuQdhUZM
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




This PR adds comprehensive snap package support for KLog, enabling distribution and installation as a self-contained snap on any GNU/Linux distribution with snapd.
Summary
KLog can now be built and distributed as a snap package that bundles Qt6, Hamlib, and all dependencies. This allows users to install KLog on any Linux distribution regardless of which Qt version that distribution ships, without requiring compilation or dependency resolution.
Key Changes
snap/snapcraft.yaml: Complete snapcraft recipe that:
core26(Ubuntu 26.04) as the base, which is the first LTS release with complete Qt6 support including QtLocation, QtCharts, and QtSerialPortsnap/local/klog-launch: Command-chain wrapper script that:
INSTALL-snap: Comprehensive documentation covering:
devscripts/snap-create-package.sh: Build helper script that:
.github/workflows/snap.yml: CI/CD workflow that:
Documentation updates:
Notable Implementation Details
core26instead ofcore24because Qt6 Location (required for the map window) was only restored in Qt 6.5, which is first available in Ubuntu 26.04https://claude.ai/code/session_019NH3YWvwLzEr3nZuQdhUZM