From 2626a0c7c7099fa17f23f4d16fe786883abbab74 Mon Sep 17 00:00:00 2001 From: Logan Rupe Date: Mon, 2 Nov 2026 09:31:07 +1100 Subject: [PATCH 1/5] fix(linux): honour LDFLAGS and skip desktop/icon caches on staged installs A DESTDIR install wrote mimeinfo.cache and icon-theme.cache into the staging tree, so a package built from it would ship files that clash with the system caches pacman's hooks maintain. Linking also ignored LDFLAGS, which dropped the distro's RELRO/now hardening. --- CursorFollowLinux/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CursorFollowLinux/Makefile b/CursorFollowLinux/Makefile index f3ce962..b9b9a92 100644 --- a/CursorFollowLinux/Makefile +++ b/CursorFollowLinux/Makefile @@ -39,7 +39,7 @@ all: $(BIN) $(BIN): $(APP_OBJ) $(PROTO_OBJ) @mkdir -p $(dir $@) - $(CXX) $(CXXFLAGS) -o $@ $^ $(PKG_LIBS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(PKG_LIBS) $(BUILD)/obj/%.o: src/%.cpp $(PROTO_HDR) @mkdir -p $(dir $@) @@ -59,7 +59,7 @@ $(BUILD)/protocols/%.o: $(BUILD)/protocols/%.c $(PROTO_HDR) # Tests link the app objects minus main so they can exercise the real code. $(BUILD)/tests/%: tests/%.cpp $(LIB_OBJ) $(PROTO_OBJ) @mkdir -p $(dir $@) - $(CXX) $(CXXFLAGS) -Itests -o $@ $< $(LIB_OBJ) $(PROTO_OBJ) $(PKG_LIBS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -Itests -o $@ $< $(LIB_OBJ) $(PROTO_OBJ) $(PKG_LIBS) test: $(TEST_BIN) @set -e; for t in $(TEST_BIN); do echo "== $$t"; $$t; done @@ -71,8 +71,12 @@ install: $(BIN) install -Dm755 $(BIN) $(DESTDIR)$(PREFIX)/bin/cursorfollow install -Dm644 data/io.github.loganrupe.CursorFollowLinux.desktop $(DESTDIR)$(PREFIX)/share/applications/io.github.loganrupe.CursorFollowLinux.desktop install -Dm644 data/io.github.loganrupe.CursorFollowLinux.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/512x512/apps/io.github.loganrupe.CursorFollowLinux.png - -update-desktop-database $(DESTDIR)$(PREFIX)/share/applications 2>/dev/null - -gtk-update-icon-cache -q -t $(DESTDIR)$(PREFIX)/share/icons/hicolor 2>/dev/null +# Staged installs (DESTDIR, i.e. packages) leave the caches to the package manager's hooks; +# writing them here would ship files that clash with the system's own caches. +ifeq ($(DESTDIR),) + -update-desktop-database $(PREFIX)/share/applications 2>/dev/null + -gtk-update-icon-cache -q -t $(PREFIX)/share/icons/hicolor 2>/dev/null +endif uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/cursorfollow \ From a8e52467082bf34f5452f2bf0614408ee9b14fc1 Mon Sep 17 00:00:00 2001 From: Logan Rupe Date: Mon, 2 Nov 2026 09:34:15 +1100 Subject: [PATCH 2/5] feat(linux/packaging): Arch PKGBUILD and package script PKGBUILD for the AUR (cursorfollow, x86_64 and aarch64) built from the v$pkgver tag tarball, plus its .SRCINFO. package-arch.sh builds the same PKGBUILD from the current checkout and also emits the DESTDIR install tree as a tarball, for CI and the release workflow. --- CursorFollowLinux/packaging/arch/.SRCINFO | 16 ++++++++++ CursorFollowLinux/packaging/arch/PKGBUILD | 33 +++++++++++++++++++++ CursorFollowLinux/scripts/package-arch.sh | 36 +++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 CursorFollowLinux/packaging/arch/.SRCINFO create mode 100644 CursorFollowLinux/packaging/arch/PKGBUILD create mode 100755 CursorFollowLinux/scripts/package-arch.sh diff --git a/CursorFollowLinux/packaging/arch/.SRCINFO b/CursorFollowLinux/packaging/arch/.SRCINFO new file mode 100644 index 0000000..923cdb1 --- /dev/null +++ b/CursorFollowLinux/packaging/arch/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = cursorfollow + pkgdesc = Share one window that follows the window you are working in (Hyprland) + pkgver = 0.5.2 + pkgrel = 1 + url = https://github.com/LoganRupe/CursorFollow + arch = x86_64 + arch = aarch64 + license = MIT + makedepends = pkgconf + depends = gtk4 + depends = json-glib + depends = wayland + source = cursorfollow-0.5.2.tar.gz::https://github.com/LoganRupe/CursorFollow/archive/refs/tags/v0.5.2.tar.gz + sha256sums = a2028d5dcf805e410ad79cc7aac0b89f52b1fec0e831fc23c1f5363b679c43ae + +pkgname = cursorfollow diff --git a/CursorFollowLinux/packaging/arch/PKGBUILD b/CursorFollowLinux/packaging/arch/PKGBUILD new file mode 100644 index 0000000..98df217 --- /dev/null +++ b/CursorFollowLinux/packaging/arch/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: Logan Rupe + +pkgname=cursorfollow +pkgver=0.5.2 +pkgrel=1 +pkgdesc='Share one window that follows the window you are working in (Hyprland)' +arch=('x86_64' 'aarch64') +url='https://github.com/LoganRupe/CursorFollow' +license=('MIT') +depends=('gtk4' 'json-glib' 'wayland') +# wayland-scanner ships in the wayland package, already a runtime dependency. +makedepends=('pkgconf') +source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz") +sha256sums=('a2028d5dcf805e410ad79cc7aac0b89f52b1fec0e831fc23c1f5363b679c43ae') + +build() { + cd "CursorFollow-$pkgver/CursorFollowLinux" + make VERSION="$pkgver" +} + +check() { + cd "CursorFollow-$pkgver/CursorFollowLinux" + make VERSION="$pkgver" test +} + +package() { + cd "CursorFollow-$pkgver" + make -C CursorFollowLinux VERSION="$pkgver" PREFIX=/usr DESTDIR="$pkgdir" install + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + # 0.5.2's Makefile still writes these caches under DESTDIR; pacman's hooks own them. + rm -f "$pkgdir/usr/share/applications/mimeinfo.cache" \ + "$pkgdir/usr/share/icons/hicolor/icon-theme.cache" +} diff --git a/CursorFollowLinux/scripts/package-arch.sh b/CursorFollowLinux/scripts/package-arch.sh new file mode 100755 index 0000000..fc972ef --- /dev/null +++ b/CursorFollowLinux/scripts/package-arch.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# +# package-arch.sh — build the Arch package from this checkout, not the tag tarball. +# +# Packs HEAD into the tarball name the PKGBUILD expects and runs makepkg with checksums +# skipped (the PKGBUILD pins the published tag's hash, which HEAD won't match), so a +# packaging break shows up on the PR that caused it. Produces, in build/arch/: +# cursorfollow---.pkg.tar.zst +# cursorfollow--.tar.gz (the install tree, usr/...) +# +# Run as a non-root user on Arch with base-devel. Extra args go to makepkg (e.g. -s). +# Usage: ./CursorFollowLinux/scripts/package-arch.sh [makepkg args...] + +set -euo pipefail + +ROOT="$(git -C "$(dirname "${BASH_SOURCE[0]}")" rev-parse --show-toplevel)" +OUT="$ROOT/CursorFollowLinux/build/arch" + +rm -rf "$OUT" +mkdir -p "$OUT" +cp "$ROOT/CursorFollowLinux/packaging/arch/PKGBUILD" "$OUT/" +cd "$OUT" + +eval "$(makepkg --printsrcinfo | awk -F' = ' '/^\tpkgver/ {print "VER=" $2} /^pkgname/ {print "NAME=" $2}')" +ARCH="$(uname -m)" + +git -C "$ROOT" archive --prefix="CursorFollow-$VER/" -o "$OUT/$NAME-$VER.tar.gz" HEAD +makepkg -f --skipchecksums --noconfirm "$@" + +PKG="$(ls "$NAME-$VER"-*-"$ARCH".pkg.tar.zst)" +mkdir tree +bsdtar -xf "$PKG" -C tree --exclude '.*' +tar -czf "$NAME-$VER-$ARCH.tar.gz" -C tree usr + +echo "Built $OUT/$PKG" +echo "Built $OUT/$NAME-$VER-$ARCH.tar.gz" From de13db581d775bf5efb5951d356ca1f2a4e954e1 Mon Sep 17 00:00:00 2001 From: Logan Rupe Date: Mon, 2 Nov 2026 09:34:15 +1100 Subject: [PATCH 3/5] ci(linux): build and namcap the Arch package, attach it to releases --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++ .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++---- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a165e03..430cd23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,3 +48,26 @@ jobs: - name: Build and unit test working-directory: CursorFollowLinux run: make -j"$(nproc)" && make test + + # Builds the Arch package from this commit (not the tag tarball the PKGBUILD pins), + # so a packaging break shows up on the PR that caused it. + linux-arch: + runs-on: ubuntu-24.04 + container: archlinux:latest + steps: + - name: Install build tools + run: pacman -Syu --noconfirm --needed base-devel git namcap + - uses: actions/checkout@v7 + - name: Build package (makepkg refuses to run as root) + run: | + useradd -m builder + echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder + chown -R builder "$GITHUB_WORKSPACE" + sudo -u builder ./CursorFollowLinux/scripts/package-arch.sh --syncdeps + - name: namcap + run: | + namcap CursorFollowLinux/packaging/arch/PKGBUILD CursorFollowLinux/build/arch/cursorfollow-[0-9]*.pkg.tar.zst | tee namcap.txt + if grep -q ' E: ' namcap.txt; then echo "::error::namcap reported errors"; exit 1; fi + - name: .SRCINFO is current + working-directory: CursorFollowLinux/packaging/arch + run: sudo -u builder makepkg --printsrcinfo | diff -u .SRCINFO - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 643e078..4f7fe1d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,8 @@ name: Release -# Push a v* tag (matching the app versions) to build the macOS DMG and Windows MSI and -# attach them to a draft GitHub release. Review the draft, then publish it. +# Push a v* tag (matching the app versions) to build the macOS DMG, Windows MSI and Arch +# package + install tarball, and attach them to a draft GitHub release. Review the draft, +# then publish it. # Run manually (Actions -> Release -> Run workflow) to build the installers as workflow # artifacts without touching releases; pass an existing tag to (re)build its draft release. @@ -16,6 +17,9 @@ on: - CursorFollowWin/scripts/** - CursorFollowWin/installer/** - CursorFollowWin/CursorFollowWin.csproj + - CursorFollowLinux/Makefile + - CursorFollowLinux/packaging/** + - CursorFollowLinux/scripts/** workflow_dispatch: inputs: tag: @@ -89,9 +93,32 @@ jobs: path: CursorFollowWin/installer/dist/*.msi if-no-files-found: error + linux: + runs-on: ubuntu-latest + container: archlinux:latest + steps: + - name: Install build tools + run: pacman -Syu --noconfirm --needed base-devel git + - uses: actions/checkout@v7 + with: + ref: ${{ env.TAG || github.ref }} + - name: Build Arch package and install tarball + run: | + useradd -m builder + echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder + chown -R builder "$GITHUB_WORKSPACE" + sudo -u builder ./CursorFollowLinux/scripts/package-arch.sh --syncdeps + - uses: actions/upload-artifact@v7 + with: + name: linux-arch + path: | + CursorFollowLinux/build/arch/cursorfollow-[0-9]*-x86_64.pkg.tar.zst + CursorFollowLinux/build/arch/cursorfollow-[0-9]*-x86_64.tar.gz + if-no-files-found: error + release: if: ${{ github.event_name == 'push' || inputs.tag != '' }} - needs: [macos, windows] + needs: [macos, windows, linux] runs-on: ubuntu-latest permissions: contents: write @@ -107,7 +134,8 @@ jobs: run: | v="${TAG#v}" ls dist - ls dist/CursorFollowMac-"$v".dmg dist/CursorFollowWin-"$v"-win-x64.msi + ls dist/CursorFollowMac-"$v".dmg dist/CursorFollowWin-"$v"-win-x64.msi \ + dist/cursorfollow-"$v"-*-x86_64.pkg.tar.zst dist/cursorfollow-"$v"-x86_64.tar.gz - name: Release notes from CHANGELOG.md run: | v="${TAG#v}" From 5213e56a8fc3e9b52ead437dc9810968458145fa Mon Sep 17 00:00:00 2001 From: Logan Rupe Date: Mon, 2 Nov 2026 09:34:15 +1100 Subject: [PATCH 4/5] docs(linux): install from the AUR, release package or tarball --- CHANGELOG.md | 2 ++ CursorFollowLinux/README.md | 35 ++++++++++++++++++++++++++++++++++- README.md | 7 ++++--- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a7d98e..b6561be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- **Linux packages for Arch and Omarchy**: install with `yay -S cursorfollow` from the AUR, or grab the `.pkg.tar.zst` (for `sudo pacman -U`) or the `x86_64` install tarball from the release. The Makefile now honours `LDFLAGS` and no longer writes the desktop and icon caches during staged (`DESTDIR`) installs. + ## 0.5.2 - **Windows dependencies**: Microsoft.Extensions.Logging 10.0.13. Package versions for the Windows projects now live in one place, so they can't drift apart. diff --git a/CursorFollowLinux/README.md b/CursorFollowLinux/README.md index 0ff53fe..f5c40bf 100644 --- a/CursorFollowLinux/README.md +++ b/CursorFollowLinux/README.md @@ -46,7 +46,7 @@ What is not in yet: - **dmabuf transport.** The compositor offers it; the engine uses `wl_shm` for now. - **System tray icon.** Hyprland setups vary too much (waybar, omarchy-shell, none); the panel is a normal window and the CLI covers key bindings. -- Packaging (PKGBUILD / Flatpak) and a global-shortcuts portal integration. +- Flatpak and other distro packages, and a global-shortcuts portal integration. --- @@ -73,6 +73,39 @@ No permissions dialog: Hyprland's export protocol does not go through the portal --- +## Install + +Arch and Omarchy, from the AUR: + +```sh +yay -S cursorfollow +``` + +Or take `cursorfollow--1-x86_64.pkg.tar.zst` from +[GitHub Releases](https://github.com/LoganRupe/CursorFollow/releases/latest) and install it +with pacman, which pulls in the dependencies: + +```sh +sudo pacman -U cursorfollow--1-x86_64.pkg.tar.zst +``` + +Other x86_64 distros: the release also has `cursorfollow--x86_64.tar.gz`, the same +files laid out under `usr/`. Install the runtime libraries from [Requirements](#requirements), +then unpack it into a prefix: + +```sh +sudo tar -xzf cursorfollow--x86_64.tar.gz -C /usr/local --strip-components=1 +``` + +That binary is built on Arch, so it needs a glibc and GTK at least as new as Arch's at +release time. If it won't start, build from source instead. + +From source, see [Build, test, run](#build-test-run) below; `make install` puts it under +`~/.local`. The PKGBUILD lives in `packaging/arch/`; `scripts/package-arch.sh` builds it from +your checkout instead of the release tarball. + +--- + ## Build, test, run From this directory: diff --git a/README.md b/README.md index 66a38bb..935f7b2 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Download the latest build from **[GitHub Releases](https://github.com/LoganRupe/ - **macOS** — open the `.dmg` and drag **CursorFollowMac** into **Applications**. Releases are not notarized, so approve the first launch in **System Settings → Privacy & Security → Open Anyway**, then grant **Screen Recording** when prompted. See [macOS install](CursorFollowMac/README.md#install). - **Windows** — run the `.msi` (no admin required). See [Windows setup](CursorFollowWin/README.md#installer). -- **Linux** — no packaged build yet; build from source with `make` and `make install`. See [Linux build](CursorFollowLinux/README.md#build-test-run). +- **Linux (Arch / Omarchy)** — `yay -S cursorfollow` from the AUR, or `sudo pacman -U` the release `.pkg.tar.zst`. Other distros: the release tarball or a source build. See [Linux install](CursorFollowLinux/README.md#install). Then point your meeting app's **window** picker at **CursorFollow Output**: pick a target window (or set **Target Mode** to **Auto**), make sure output isn't paused, and share it. @@ -95,9 +95,10 @@ The general reset is the same everywhere — quit your meeting app and CursorFol GitHub Actions builds the installers ([.github/workflows/release.yml](.github/workflows/release.yml)): -1. Bump the version on every platform (`MARKETING_VERSION` in the Xcode project, `Version`/`FileVersion`/`AssemblyVersion` in `CursorFollowWin.csproj`, `VERSION` in `CursorFollowLinux/Makefile`) and move the **Unreleased** notes in `CHANGELOG.md` under a `## ` heading. +1. Bump the version on every platform (`MARKETING_VERSION` in the Xcode project, `Version`/`FileVersion`/`AssemblyVersion` in `CursorFollowWin.csproj`, `VERSION` in `CursorFollowLinux/Makefile`, `pkgver` in `CursorFollowLinux/packaging/arch/PKGBUILD`) and move the **Unreleased** notes in `CHANGELOG.md` under a `## ` heading. 2. Merge to `main`, then tag and push: `git tag -a v0.5.2 -m "CursorFollow 0.5.2" && git push origin v0.5.2`. -3. The workflow builds the signed macOS DMG and the Windows MSI and attaches both to a **draft** release, with the changelog section as notes. Review it, then publish. +3. The workflow builds the signed macOS DMG, the Windows MSI and the Arch package plus install tarball, and attaches them to a **draft** release, with the changelog section as notes. Review it, then publish. +4. Update the AUR: set `sha256sums` in the PKGBUILD to the new tag tarball's hash (`curl -sL https://github.com/LoganRupe/CursorFollow/archive/refs/tags/v.tar.gz | sha256sum`), regenerate `.SRCINFO` with `makepkg --printsrcinfo > .SRCINFO`, commit both here, and push them to `aur.archlinux.org/cursorfollow.git`. macOS signing in CI uses the self-signed identity from two repository secrets, `MAC_SIGNING_P12` (base64 of the `.p12`) and `MAC_SIGNING_P12_PASSWORD`. See [Docs/Distribution/Packaging.md](Docs/Distribution/Packaging.md). Local builds still work: `./CursorFollowMac/scripts/package.sh` and `./CursorFollowWin/scripts/package.ps1`. From e804cb7048dfc87b96c88e076a70cc06e75ca078 Mon Sep 17 00:00:00 2001 From: Logan Rupe Date: Mon, 2 Nov 2026 09:35:25 +1100 Subject: [PATCH 5/5] fix(linux/packaging): root-owned files in the install tarball --- CursorFollowLinux/scripts/package-arch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CursorFollowLinux/scripts/package-arch.sh b/CursorFollowLinux/scripts/package-arch.sh index fc972ef..186d54e 100755 --- a/CursorFollowLinux/scripts/package-arch.sh +++ b/CursorFollowLinux/scripts/package-arch.sh @@ -30,7 +30,7 @@ makepkg -f --skipchecksums --noconfirm "$@" PKG="$(ls "$NAME-$VER"-*-"$ARCH".pkg.tar.zst)" mkdir tree bsdtar -xf "$PKG" -C tree --exclude '.*' -tar -czf "$NAME-$VER-$ARCH.tar.gz" -C tree usr +tar -czf "$NAME-$VER-$ARCH.tar.gz" --owner=0 --group=0 --numeric-owner -C tree usr echo "Built $OUT/$PKG" echo "Built $OUT/$NAME-$VER-$ARCH.tar.gz"