build: add RPM packaging for releases#121
Conversation
Builds an RPM alongside the release tarball in both CI and release workflows, using a shared spec template and helper scripts so the packaging path can't silently regress between releases.
|
Thanks! Is this meant to be a completion of #94? |
|
Yes, with end-to-end testing of both the build/release jobs and on my Fedora 44 system. |
There was a problem hiding this comment.
Isn't it a job of a distro to package?
|
Strictly speaking, yes, but that simple calculus changes a lot for Electron and Rust applications, particularly ones like this that have so many dependencies. Electron and Rust packaging in distributions is a known pain point, requiring a lot of manual labor to package each and every crate or to build Chromium from source (in the case of Electron). For applications like Wayle that use so many crates, it would take so much effort to package the program "properly" in Fedora or Ubuntu that I see little chance of this ever happening. Options then become:
For a project like Wayle, where an officially sanctioned package in core Fedora or Ubuntu is unrealistic and probably not achievable, I think it would be preferable for there to be official Wayle packages and repositories for the popular distributions that offer statically linked binaries, which aren't acceptable in core Fedora and Ubuntu. This PR is the first step in that direction. I'm willing to make more PRs after this to help take packaging even further:
Ultimately I think the main goal of @Jas-SinghFSU is to reach as many users as possible, and I think that goal would be best achieved through official rather than community packaging, and since "distribution official" in Debian and Fedora is unachievable for a Rust program like this without superhuman amounts of effort, then "Wayle official" is the next best thing, and this PR is a first step in that direction. |
This sounds like a serious issue in their packaging system; in Nix we just do |
There's definitely an impedance mismatch between traditional Linux distribution packaging and modern Rust and Electron apps. There's a reason so many popular Rust projects are packaged for Debian/Fedora by having you run @Jas-SinghFSU Perhaps you could consider which direction you want this project to go in:
|
|
Unfortunately, this cannot be packaged as a flatpak because Also, can't the user just use Although @Jas-SinghFSU has the final say |
|
@PerchunPak I think we've gone back and forth on this enough for now, and I'll note that I already wrote that my gut feeling is that a Flatpak wouldn't work too well for a shell like Wayle. |
|
Guess I can close #94? |
|
@Jas-SinghFSU Any update on this PR? |
Objective
Make it easy for Fedora (and other RPM-based) users to install Wayle by publishing official RPM packages as part of every GitHub release, alongside the existing
tar.gzarchive.Solution
packaging/rpm/wayle.spec.inrepackages the prebuilt upstream tarball into an RPM. Installs the binaries,wayle.serviceuser unit,.desktopentry (validated withdesktop-file-validate), app/action icons, and shell completions into the canonical FHS locations.@VERSION@/@DATE@are substituted at build time.debug_packageis disabled because the archive contains a prebuilt binary with no source to generate debuginfo from. A fallback for_userunitdiris defined since Arch'srpm-toolsdoes not shipsystemd-rpm-macros.scripts/ci/build-archive.sh. The tarball staging logic previously lived inline inrelease.yml. It now lives in a script that takes<target-dir> <version> <arch>, so both CI and the release job can produce the exact same archive layout that the spec file consumes.scripts/ci/build-packages.sh. Given the archive and version, renders the spec from the template and runsrpmbuild -bbagainst a local_topdir. Keeps the packaging surface out of the workflow YAML. The file is namedbuild-packages.shin the plural because the idea is that hopefully some Ubuntu user will come along in the future and add a.debpackage to it as well.release.ymlnow callsbuild-archive.shthenbuild-packages.sh, and uploadsrpmbuild/RPMS/${ARCH}/*.rpmto the release alongside the tarball. The checksums job also picks up*.rpmsoSHA256SUMScovers both artifacts.ci.ymlruns the same two scripts on every push so the packaging path can't silently regress between releases. There should be no surprises at tag time. Addedpackaging/**to the path filter, anddesktop-file-utils+rpm-toolsto the package install step in both workflows.Testing Done
wayle-0.2.1-1.x86_64.rpmlocally in anarchlinux:base-develcontainer (same image as the release job) from the v0.2.1 release tarball. Installed on Fedora 44, started bothwayleandwayle-settings. Both launch cleanly.