diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 8b77a6b..42e412d 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -127,7 +127,7 @@ jobs: # (x86_64 only) against the runner's glibc. sudo apt-get update sudo apt-get install -y --no-install-recommends \ - libgtk-3-dev libayatana-appindicator3-dev libxdo-dev + libgtk-3-dev libayatana-appindicator3-dev cargo build --release --locked \ --target "${{ matrix.gnu_target }}" --bin tsunagi-tray else diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 841da9d..5aa157c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,7 +129,7 @@ jobs: # (x86_64 only) against the runner's glibc. sudo apt-get update sudo apt-get install -y --no-install-recommends \ - libgtk-3-dev libayatana-appindicator3-dev libxdo-dev + libgtk-3-dev libayatana-appindicator3-dev cargo build --release --locked \ --target "${{ matrix.gnu_target }}" --bin tsunagi-tray else diff --git a/Cargo.lock b/Cargo.lock index 0a9a83e..fd42e5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3253,25 +3253,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "libxdo" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00333b8756a3d28e78def82067a377de7fa61b24909000aeaa2b446a948d14db" -dependencies = [ - "libxdo-sys", -] - -[[package]] -name = "libxdo-sys" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23b9e7e2b7831bbd8aac0bbeeeb7b68cbebc162b227e7052e8e55829a09212" -dependencies = [ - "libc", - "x11", -] - [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -3491,7 +3472,6 @@ dependencies = [ "dpi", "gtk", "keyboard-types", - "libxdo", "objc2 0.6.4", "objc2-app-kit 0.3.2", "objc2-core-foundation", @@ -7625,16 +7605,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "x11" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" -dependencies = [ - "libc", - "pkg-config", -] - [[package]] name = "x11-dl" version = "2.21.0" diff --git a/README.md b/README.md index f32595d..9fa6962 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,8 @@ Online nodes and the currently selected exit node cannot be forgotten. ² Newer and less battle-tested than on Linux. ³ Builds from source, not covered by CI. -The Linux CLI is a single static binary: it runs on any distribution. +The Linux release CLI is a single static musl binary, independent of the +distribution's libc. The tray uses dynamic desktop libraries. ## NixOS @@ -226,6 +227,18 @@ cargo build --release --bin tsng # the agent and CLI cargo build --release --bin tsunagi-tray # the tray (Linux needs GTK 3 and libayatana-appindicator) ``` +These commands use the host target. On a glibc-based Linux distribution, +`target/release/tsng` is dynamically linked. For the static x86_64 Linux CLI, +release CI uses Zig 0.14.1 and `cargo-zigbuild` (with CMake, Clang and libclang +installed): + +```sh +rustup target add x86_64-unknown-linux-musl +cargo zigbuild --release --locked --target x86_64-unknown-linux-musl --bin tsng +``` + +The static binary is `target/x86_64-unknown-linux-musl/release/tsng`. + Windows needs [Wintun](https://www.wintun.net) next to `tsng.exe`. Per-platform notes: [Linux](dist/linux/README.md), [Arch](dist/arch/README.md), [macOS](dist/macos/README.md), [Windows](dist/windows/README.md). diff --git a/crates/tsunagi-tray/Cargo.toml b/crates/tsunagi-tray/Cargo.toml index 89f5450..5b45b5c 100644 --- a/crates/tsunagi-tray/Cargo.toml +++ b/crates/tsunagi-tray/Cargo.toml @@ -19,7 +19,9 @@ tsunagi-core = { path = "../tsunagi-core", version = "0.1.0" } # Native, lightweight GUI — no web engine. eframe re-exports egui. eframe = { version = "0.31", default-features = false, features = ["default_fonts", "glow", "wayland", "x11"] } # Cross-platform tray icon + menu (Windows tray, macOS menu bar, Linux SNI). -tray-icon = "0.21" +# libxdo only implements predefined Copy/Cut/Paste/SelectAll menu actions, +# which this tray does not use. Avoid a distro-specific libxdo SONAME dependency. +tray-icon = { version = "0.21", default-features = false } # Background worker that talks to the agent off the UI thread. tokio = { version = "1.53", features = ["rt", "rt-multi-thread", "sync", "time", "macros"] } tracing.workspace = true diff --git a/dist/arch/README.md b/dist/arch/README.md index d74b262..838076e 100644 --- a/dist/arch/README.md +++ b/dist/arch/README.md @@ -45,7 +45,7 @@ usermod -aG tsunagi "$USER"`. The group also lets its members configure systemd-resolved for the overlay zones through the polkit rule. The GUI package depends on `gtk3`, `libayatana-appindicator` (the tray icon), -`xdotool` (its `libxdo`), and the usual windowing libraries. +and the usual windowing libraries. ## Removal diff --git a/dist/arch/build-pkg.sh b/dist/arch/build-pkg.sh index 8081845..4094f59 100755 --- a/dist/arch/build-pkg.sh +++ b/dist/arch/build-pkg.sh @@ -52,7 +52,7 @@ if [ -n "$tray" ]; then relations=$'conflict = tsunagi\nprovides = tsunagi\nreplaces = tsunagi\n' # What the tray and its window load at run time; none of it is linked in # statically, so pacman has to be told. - for dep in gtk3 libayatana-appindicator xdotool libxkbcommon wayland libx11 libglvnd; do + for dep in gtk3 libayatana-appindicator libxkbcommon wayland libx11 libglvnd; do relations+="depend = ${dep}"$'\n' done install -D -m 0755 "$tray" "$root/usr/bin/tsunagi-tray" diff --git a/dist/deb/build-deb.sh b/dist/deb/build-deb.sh index 50981c5..d422698 100755 --- a/dist/deb/build-deb.sh +++ b/dist/deb/build-deb.sh @@ -46,7 +46,7 @@ if [ -n "$tray" ]; then # with it (both ship /usr/bin/tsng). extra_control=$'Conflicts: tsunagi\nReplaces: tsunagi\nProvides: tsunagi\n' # What the tray and its window load at run time. - extra_control+=$'Depends: libgtk-3-0 | libgtk-3-0t64, libayatana-appindicator3-1 | libappindicator3-1, libxdo3, libxkbcommon0, libwayland-client0, libx11-6, libgl1\n' + extra_control+=$'Depends: libgtk-3-0 | libgtk-3-0t64, libayatana-appindicator3-1 | libappindicator3-1, libxkbcommon0, libwayland-client0, libx11-6, libgl1\n' desc_gui=" It also installs the tray GUI (tsunagi-tray) and a desktop launcher so it can be started from the applications menu." install -D -m 0755 "$tray" "$root/usr/bin/tsunagi-tray" install -D -m 0644 "$here/../linux/tsunagi-tray.desktop" \ diff --git a/nix/package.nix b/nix/package.nix index 87553b7..32dd70e 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -11,7 +11,6 @@ libxkbcommon, vulkan-loader, wayland, - xdotool, libx11, libxcursor, libxi, @@ -62,7 +61,6 @@ rustPlatform.buildRustPackage { buildInputs = lib.optionals withTray [ gtk3 libayatana-appindicator - xdotool ]; dontWrapGApps = true;