diff --git a/.forgejo/workflows/desktop.yml b/.forgejo/workflows/desktop.yml index 6b5c68d..bd6c862 100644 --- a/.forgejo/workflows/desktop.yml +++ b/.forgejo/workflows/desktop.yml @@ -45,11 +45,6 @@ jobs: run: npm ci && npm run build working-directory: frontend - # Generate the platform icon set from the committed 1024px source PNG. - - name: Generate app icons - run: cargo tauri icon app-icon.png - working-directory: desktop/src-tauri - - name: Rust format check run: cargo fmt --check working-directory: desktop/src-tauri diff --git a/desktop/packaging/arch/PKGBUILD b/desktop/packaging/arch/PKGBUILD new file mode 100644 index 0000000..67d852d --- /dev/null +++ b/desktop/packaging/arch/PKGBUILD @@ -0,0 +1,68 @@ +# Maintainer: bvandeusen +# +# ThoughtSync desktop (Tauri v2) — native Arch package. +# +# Built from THIS repo checkout, from SOURCE, linked against your SYSTEM libraries. +# That is the whole point: it uses the host's graphics stack (webkit2gtk-4.1 + your +# GPU driver), which avoids the bundled-AppImage "EGL_BAD_PARAMETER" black window. +# +# Usage (from a clone of the thoughtsync repo): +# cd desktop/packaging/arch +# makepkg -si +# +pkgname=thoughtsync-desktop +pkgver=0.1.0 +pkgrel=1 +pkgdesc="ThoughtSync desktop — local-first Keep-style thought capture" +arch=('x86_64') +url="https://git.fabledsword.com/bvandeusen/thoughtsync" +license=('MIT') +depends=( + 'webkit2gtk-4.1' + 'gtk3' + 'cairo' + 'gdk-pixbuf2' + 'glib2' + 'libsoup3' + 'pango' + 'hicolor-icon-theme' + 'desktop-file-utils' + 'librsvg' +) +makedepends=('rust' 'nodejs' 'npm' 'git' 'pkgconf') +# Cargo's release profile already does its own LTO; don't let makepkg inject C-level +# LTO flags into the crates that build native code. +options=('!lto') + +# Locate the repo root this PKGBUILD lives inside (desktop/packaging/arch/). +_repo() { git -C "$startdir" rev-parse --show-toplevel; } + +pkgver() { + cd "$startdir" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + local repo; repo="$(_repo)" + + # 1) Build the shared Vue frontend — it's embedded into the binary at compile time + # (tauri generate_context!), so it must exist before the cargo build. + cd "$repo/frontend" + npm ci + npm run build + + # 2) Compile the native binary against SYSTEM libraries (no bundling, no tauri-cli). + cd "$repo/desktop/src-tauri" + cargo build --release +} + +package() { + local repo; repo="$(_repo)" + + install -Dm755 "$repo/desktop/src-tauri/target/release/thoughtsync-desktop" \ + "$pkgdir/usr/bin/thoughtsync" + install -Dm644 "$repo/desktop/src-tauri/app-icon.png" \ + "$pkgdir/usr/share/pixmaps/thoughtsync.png" + install -Dm644 "$startdir/thoughtsync.desktop" \ + "$pkgdir/usr/share/applications/thoughtsync.desktop" +} diff --git a/desktop/packaging/arch/README.md b/desktop/packaging/arch/README.md new file mode 100644 index 0000000..0ae6b92 --- /dev/null +++ b/desktop/packaging/arch/README.md @@ -0,0 +1,31 @@ +# ThoughtSync desktop — Arch package + +A native Arch/pacman package, built **from source** so it links against your +**system** libraries (webkit2gtk-4.1 + your GPU driver). This is the robust install +on Arch/CachyOS: it avoids the bundled-AppImage `EGL_BAD_PARAMETER` black-window +problem entirely, and it installs a proper application-menu entry. + +## Install + +From a clone of the `thoughtsync` repo: + +```sh +cd desktop/packaging/arch +makepkg -si +``` + +`makepkg` will pull the build tools (`rust`, `nodejs`, `npm`) and runtime deps +(`webkit2gtk-4.1`, `gtk3`, …) via pacman, compile the frontend + the Rust binary, +and install: + +- `/usr/bin/thoughtsync` — the app +- `/usr/share/applications/thoughtsync.desktop` — the menu entry +- `/usr/share/pixmaps/thoughtsync.png` — the icon + +Then launch **ThoughtSync** from your app menu (or run `thoughtsync`). + +## Notes + +- Builds in-place from the checkout (`makepkg` reads the committed state via git). +- The compile takes a few minutes the first time (Rust release build). +- Uninstall: `sudo pacman -R thoughtsync-desktop`. diff --git a/desktop/packaging/arch/thoughtsync.desktop b/desktop/packaging/arch/thoughtsync.desktop new file mode 100644 index 0000000..7328f95 --- /dev/null +++ b/desktop/packaging/arch/thoughtsync.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=ThoughtSync +Comment=Capture a fleeting thought in a second +Exec=thoughtsync %U +Icon=thoughtsync +Terminal=false +Categories=Utility;Office; +StartupWMClass=ThoughtSync diff --git a/desktop/src-tauri/.gitignore b/desktop/src-tauri/.gitignore index 3b90f41..732d389 100644 --- a/desktop/src-tauri/.gitignore +++ b/desktop/src-tauri/.gitignore @@ -3,7 +3,3 @@ # Generated by Tauri /gen/schemas - -# App icons are generated from ../../frontend/public/icon.svg via `cargo tauri -# icon` (in CI before the build); not committed. -/icons/ diff --git a/desktop/src-tauri/icons/128x128.png b/desktop/src-tauri/icons/128x128.png new file mode 100644 index 0000000..bf90912 Binary files /dev/null and b/desktop/src-tauri/icons/128x128.png differ diff --git a/desktop/src-tauri/icons/128x128@2x.png b/desktop/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..370b36b Binary files /dev/null and b/desktop/src-tauri/icons/128x128@2x.png differ diff --git a/desktop/src-tauri/icons/32x32.png b/desktop/src-tauri/icons/32x32.png new file mode 100644 index 0000000..f48f6d4 Binary files /dev/null and b/desktop/src-tauri/icons/32x32.png differ diff --git a/desktop/src-tauri/icons/icon.png b/desktop/src-tauri/icons/icon.png new file mode 100644 index 0000000..7c35940 Binary files /dev/null and b/desktop/src-tauri/icons/icon.png differ diff --git a/desktop/src-tauri/src/lib.rs b/desktop/src-tauri/src/lib.rs index c9c2a3f..d186010 100644 --- a/desktop/src-tauri/src/lib.rs +++ b/desktop/src-tauri/src/lib.rs @@ -30,17 +30,11 @@ pub fn run() { /// (https://v2.tauri.app/develop/debug/linux-graphics/) is to force the software /// fallbacks at startup, before the webview is created, so end users don't have to. /// -/// We apply the fix ONLY for AppImage launches (where these failures cluster and where -/// bundled libs are in play), leaving each var overridable — native (.deb) installs use -/// system libs and keep GPU acceleration untouched. WebKit software rendering is plenty -/// for this UI. +/// Applied on all Linux launches (this UI doesn't need GPU compositing, and the failure +/// spans AppImage, native, and dev builds), each var left overridable so a user can +/// re-enable acceleration by exporting it themselves before launch. #[cfg(target_os = "linux")] fn harden_linux_webkit_rendering() { - let is_appimage = - std::env::var_os("APPIMAGE").is_some() || std::env::var_os("APPDIR").is_some(); - if !is_appimage { - return; - } // Ordered per Tauri's escalation ladder; each set only if the user hasn't chosen. for (key, value) in [ ("__NV_DISABLE_EXPLICIT_SYNC", "1"), diff --git a/desktop/src-tauri/tauri.conf.json b/desktop/src-tauri/tauri.conf.json index 5594984..ed5c26b 100644 --- a/desktop/src-tauri/tauri.conf.json +++ b/desktop/src-tauri/tauri.conf.json @@ -37,8 +37,7 @@ "icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" + "icons/icon.png" ] } }