From 4ebb07b267412e22042912b821c7c251033307a2 Mon Sep 17 00:00:00 2001 From: Omabot Date: Wed, 19 Aug 2026 03:08:40 -0700 Subject: [PATCH] Fix what the review found in the desktop package Pin the build stamp. write-build-stamp.mjs resolves the commit the app pins its first-launch bootstrap to, preferring $GITHUB_SHA and otherwise running `git rev-parse`. That fallback is wrong under makepkg: the build happens inside this repository, so git ascends out of srcdir and stamps the app with an omarchy-pkgs commit that means nothing upstream. Confirmed by rebuilding -- the stamp now reads the tag's own commit rather than this repo's HEAD. Ship upstream's MIT licence. The package declares MIT and was installing only Electron's licence text. Repair a drifted CLI before launching rather than only a missing one. `mise up` can leave Hermes rebuilt against the system Python, and a stub can be there but cold; either way the wrapper's own repair takes minutes while the app allows 15 seconds before bootstrapping its own copy. Running the installer unconditionally costs nothing when Hermes is healthy. Register the hermes:// scheme. The desktop entry took %U while declaring no MimeType, so the scheme electron-builder configures went unhandled. --- pkgbuilds/hermes-desktop/PKGBUILD | 16 ++++++++++++++-- pkgbuilds/hermes-desktop/hermes-desktop.desktop | 1 + pkgbuilds/hermes-desktop/hermes-desktop.sh | 16 +++++++++------- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/pkgbuilds/hermes-desktop/PKGBUILD b/pkgbuilds/hermes-desktop/PKGBUILD index 42c786f..b854973 100644 --- a/pkgbuilds/hermes-desktop/PKGBUILD +++ b/pkgbuilds/hermes-desktop/PKGBUILD @@ -58,19 +58,29 @@ makedepends=('git' 'imagemagick' 'nodejs' 'npm' 'python') # Electron bundles prebuilt binaries that stripping corrupts. options=('!strip' '!debug') +# The tag's commit. apps/desktop/scripts/write-build-stamp.mjs pins the app's +# first-launch bootstrap to a Hermes commit, and resolves it from $GITHUB_SHA +# before falling back to `git rev-parse`. That fallback is wrong here: makepkg +# builds inside this repository, so git ascends out of srcdir and stamps the +# app with an omarchy-pkgs commit that means nothing upstream. +_commit=e624e9fde561e1add9388384012b295fde669ade + _srcdir="hermes-agent-${pkgver}" source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz" 'hermes-desktop.sh' 'hermes-desktop.desktop' 'hermes-desktop.png') sha256sums=('1e3d39d3638ec15fa9d31af262568a953e9272090deb1c50c44cd401175f5b80' - 'f6d06594c2a60a01c369992e44b20afcaf92d8f454a822dc6fccad67d4b6c58b' - 'a71e5b3599515b97ea694d51771edede69107a221f301f91c088a5d81de7a8c0' + 'bac4626a3bbde4c05cf6072c05f6c47d1804c99066e04ee5328cea707fae1a3f' + '3ef685bfcf366776b025d26c37d32854d8d4aa2023b2bd07c8e08b001ef1e8c4' 'd60d164e24fdcf6532133b8ea43c77a201e4b9e9dbc396187b58d51d8590ef52') build() { cd "${srcdir}/${_srcdir}" + export GITHUB_SHA="${_commit}" + export GITHUB_REF_NAME="v${pkgver}" + # The desktop workspace resolves against the repo root, so the install has to # happen there rather than in apps/desktop. npm ci @@ -99,6 +109,8 @@ package() { "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/${pkgname}.png" done + install -Dm644 "${srcdir}/${_srcdir}/LICENSE" \ + "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -Dm644 "${pkgdir}/opt/${pkgname}/LICENSE.electron.txt" \ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.electron.txt" diff --git a/pkgbuilds/hermes-desktop/hermes-desktop.desktop b/pkgbuilds/hermes-desktop/hermes-desktop.desktop index 61e375c..8186b65 100644 --- a/pkgbuilds/hermes-desktop/hermes-desktop.desktop +++ b/pkgbuilds/hermes-desktop/hermes-desktop.desktop @@ -8,6 +8,7 @@ Exec=hermes-desktop %U Icon=hermes-desktop Terminal=false Categories=Development; +MimeType=x-scheme-handler/hermes; Keywords=ai;agent;assistant;hermes;nous; StartupNotify=true StartupWMClass=Hermes diff --git a/pkgbuilds/hermes-desktop/hermes-desktop.sh b/pkgbuilds/hermes-desktop/hermes-desktop.sh index dac5444..0ffbe18 100644 --- a/pkgbuilds/hermes-desktop/hermes-desktop.sh +++ b/pkgbuilds/hermes-desktop/hermes-desktop.sh @@ -7,13 +7,15 @@ set -euo pipefail # # command -v rather than omarchy-cmd-present: no other launcher in this repo # makes a package depend on omarchy, and this has to behave on a plain Arch box. -if ! command -v hermes >/dev/null 2>&1; then - if command -v omarchy-install-hermes-cli >/dev/null 2>&1; then - omarchy-install-hermes-cli --now - else - echo "The Hermes CLI is not installed, so Hermes Desktop will install its" >&2 - echo "own copy under ~/.hermes. Install the CLI first to avoid that." >&2 - fi +# Run the installer even when hermes is already on PATH. A stub can be there +# and cold, and `mise up` can leave one pointing at a Hermes built against the +# wrong Python; repairing either costs minutes, and the app allows 15 seconds +# before it gives up and bootstraps. Installing here is a no-op when healthy. +if command -v omarchy-install-hermes-cli >/dev/null 2>&1; then + omarchy-install-hermes-cli --now +elif ! command -v hermes >/dev/null 2>&1; then + echo "The Hermes CLI is not installed, so Hermes Desktop will install its" >&2 + echo "own copy under ~/.hermes. Install the CLI first to avoid that." >&2 fi # Chromium's own Ozone detection falls back to XWayland often enough to matter,