Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions pkgbuilds/hermes-desktop/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Maintainer: David Heinemeier Hansson <david@hey.com>

# Build a prebuilt release; Omarchy seeds it into the user's Hermes checkout
# so the upstream updater can rebuild and relaunch it in place.
# Build a prebuilt release; Omarchy seeds it into the runtime hermes-agent
# installs under ~/.hermes, so the upstream updater can rebuild and relaunch
# it in place.

pkgname=hermes-desktop
pkgver=2026.9.7
pkgrel=2
pkgrel=3
pkgdesc='Native desktop shell for Hermes Agent'
arch=('x86_64')
url='https://github.com/NousResearch/hermes-agent'
license=('MIT')

# The same release of hermes-agent, because the app only runs against a
# runtime built from the commit it was built from.
depends=(
"hermes-agent=${pkgver}"
'alsa-lib'
'at-spi2-core'
'cairo'
Expand Down Expand Up @@ -74,14 +78,12 @@ source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz
'hermes-desktop.sh'
'hermes-desktop.desktop'
'hermes-desktop.png'
'runtime.patch'
'runtime-test.py')
sha256sums=('907c2a72db1c5dd637ea8eeae97f4cb5b32cef615c17258f6b190924ec5bf688'
'c68233f93387251f08537559c072c9ec36ba9a304b1669decc56df17c464b252'
'3ef685bfcf366776b025d26c37d32854d8d4aa2023b2bd07c8e08b001ef1e8c4'
'd60d164e24fdcf6532133b8ea43c77a201e4b9e9dbc396187b58d51d8590ef52'
'9d5015d1be762a901f8f64319981ae862e9852fa5cb9a22a2ba1e691f90430a2'
'1cd91eac5b29e4ef5f76984f838448ce41e5cee703c4ea20399b32a108290c4b')
'dfd48f45271687f12bf9d948016cc5ae970c55a43848785b9f7348eea5fe5d0e')

build() {
cd "${srcdir}/${_srcdir}"
Expand All @@ -98,7 +100,7 @@ build() {
}

check() {
python "${srcdir}/runtime-test.py" "${srcdir}/${_srcdir}" "${srcdir}/runtime.patch" "${srcdir}/hermes-desktop.sh"
python "${srcdir}/runtime-test.py" "${srcdir}/${_srcdir}" "${srcdir}/hermes-desktop.sh"
}

package() {
Expand All @@ -109,11 +111,11 @@ package() {

install -Dm755 "${srcdir}/hermes-desktop.sh" "${pkgdir}/usr/bin/${pkgname}"

install -Dm644 "${srcdir}/${_srcdir}/scripts/install.sh" \
"${pkgdir}/usr/share/${pkgname}/install.sh"
# Omarchy's installer still requires this patch. The release includes the
# fix, so the installer recognizes it through its reverse-apply check.
install -Dm644 "${srcdir}/runtime.patch" "${pkgdir}/usr/share/${pkgname}/runtime.patch"
# The installer and runtime patch now ship with hermes-agent. Omarchy
# releases that predate that package still read them from here.
install -dm755 "${pkgdir}/usr/share/${pkgname}"
ln -s ../hermes-agent/install.sh "${pkgdir}/usr/share/${pkgname}/install.sh"
ln -s ../hermes-agent/runtime.patch "${pkgdir}/usr/share/${pkgname}/runtime.patch"

install -Dm644 "${srcdir}/hermes-desktop.desktop" \
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
Expand Down
5 changes: 1 addition & 4 deletions pkgbuilds/hermes-desktop/runtime-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@
import sys
import tempfile

source, patch_file, launcher = map(Path, sys.argv[1:])
source, launcher = map(Path, sys.argv[1:])
with tempfile.TemporaryDirectory(prefix="hermes-runtime-check-") as temporary:
root = Path(temporary)
destination = root / "scripts/desktop-update/posix.sh"
destination.parent.mkdir(parents=True)
shutil.copyfile(source / "scripts/desktop-update/posix.sh", destination)
# Omarchy's installer requires the patch and accepts an upstreamed fix
# through its reverse check. Verify that path without changing the release.
subprocess.run(["git", "apply", "--reverse", "--check", str(patch_file.resolve())], cwd=root, check=True)

home = root / "home with spaces"
runtime = home / ".hermes/hermes-agent"
Expand Down
13 changes: 0 additions & 13 deletions pkgbuilds/hermes-desktop/runtime.patch

This file was deleted.

9 changes: 9 additions & 0 deletions tests/hermes-release-pin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,13 @@ for var in pkgver _commit; do
fi
done

# The dependency is what makes pacman install them as a pair, read from the
# sourced array rather than the text so a comment cannot stand in for it.
pkgver=$(pkgbuild_var hermes-agent pkgver)
depends_list=$(cd "$root/pkgbuilds/hermes-desktop" && bash -c 'source PKGBUILD >/dev/null 2>&1; printf "%s\n" "${depends[@]}"')
if ! grep -qxF "hermes-agent=$pkgver" <<<"$depends_list"; then
echo "hermes-desktop must depend on hermes-agent=$pkgver" >&2
exit 1
fi

echo "ok - hermes-agent and hermes-desktop pin the same release"
Loading