Ship OpenClaw as the seed for a self-updating copy under ~/.openclaw (#651)
A copy under /usr/lib/node_modules belongs to pacman, and upstream's updater refuses to write there, so neither `openclaw update` nor the Control UI's Update Gateway worked. The package now carries the release instead: the sha256-pinned npm tarball and the install-cli.sh that came in it, from which Omarchy seeds a copy under ~/.openclaw that updates itself.
This commit is contained in:
1 parent
282bc1c43e
commit
f6b9267b3b
2 files changed
+26
-47
No files matched your search
+16
-37
@@ -5,20 +5,26 @@
|
|||||||
# Contributor: Wuxxin <wuxxin@gmail.com>
|
# Contributor: Wuxxin <wuxxin@gmail.com>
|
||||||
# Followed here straight from the npm registry (see .omarchy/package.json), since
|
# Followed here straight from the npm registry (see .omarchy/package.json), since
|
||||||
# upstream's release cadence outruns the AUR.
|
# upstream's release cadence outruns the AUR.
|
||||||
|
#
|
||||||
|
# This is the release Omarchy ships, not the OpenClaw that runs: a copy in /usr
|
||||||
|
# belongs to pacman, and `openclaw update` refuses to write there.
|
||||||
|
# omarchy-install-openclaw-cli seeds a copy under ~/.openclaw from this tarball
|
||||||
|
# with the installer that came in it, and that copy updates itself.
|
||||||
|
|
||||||
pkgname=openclaw
|
pkgname=openclaw
|
||||||
pkgver=2026.9.6
|
pkgver=2026.9.6
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
pkgdesc='Multi-channel AI gateway with extensible messaging integrations'
|
pkgdesc='Multi-channel AI gateway with extensible messaging integrations'
|
||||||
arch=(x86_64 aarch64)
|
arch=(x86_64 aarch64)
|
||||||
url=https://github.com/openclaw/openclaw
|
url=https://github.com/openclaw/openclaw
|
||||||
license=(MIT)
|
license=(MIT)
|
||||||
|
|
||||||
depends=('nodejs>=22')
|
# The installer brings its own Node, and git is the one thing it would
|
||||||
makedepends=(npm)
|
# otherwise try to install with sudo.
|
||||||
|
depends=(bash curl git)
|
||||||
optdepends=(
|
optdepends=(
|
||||||
|
'omarchy: sets up the self-updating OpenClaw under ~/.openclaw'
|
||||||
'1password-cli: 1password skill'
|
'1password-cli: 1password skill'
|
||||||
'curl: weather, openai-whisper-api skills'
|
|
||||||
'ffmpeg: video-frames skill'
|
'ffmpeg: video-frames skill'
|
||||||
'github-cli: github, gh-issues skills'
|
'github-cli: github, gh-issues skills'
|
||||||
'jq: session-logs, trello skills'
|
'jq: session-logs, trello skills'
|
||||||
@@ -35,38 +41,11 @@ install=$pkgname.install
|
|||||||
noextract=($pkgname-$pkgver.tgz)
|
noextract=($pkgname-$pkgver.tgz)
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
export SHARP_IGNORE_GLOBAL_LIBVIPS=1
|
install -Dm644 "$srcdir"/$pkgname-$pkgver.tgz "$pkgdir"/usr/share/$pkgname/$pkgname.tgz
|
||||||
# npm 12 blocks install-time lifecycle scripts unless the package is
|
|
||||||
# allow-listed, and for a local tarball the allow-list key is the tarball's
|
|
||||||
# own file: spec, not the package name (arborist matches node.resolved).
|
|
||||||
# Upstream's postinstall prunes stale dist files and clears the
|
|
||||||
# .openclaw-lifecycle-pending marker the tarball ships with; without it,
|
|
||||||
# every openclaw invocation tries to finish that lifecycle itself and dies
|
|
||||||
# with EACCES on the root-owned install.
|
|
||||||
# That postinstall also migrates legacy state under whatever home it sees
|
|
||||||
# (pruning plugin-runtime-deps in ~/.openclaw and friends), so it gets a
|
|
||||||
# scratch home: a maintainer's own OpenClaw is not the build's to touch.
|
|
||||||
mkdir -p "$srcdir"/home
|
|
||||||
env -u OPENCLAW_HOME -u OPENCLAW_STATE_DIR -u OPENCLAW_CONFIG_PATH HOME="$srcdir"/home \
|
|
||||||
npm install --silent --global --cache "$srcdir"/npm-cache \
|
|
||||||
--allow-scripts="file:$srcdir/$pkgname-$pkgver.tgz" \
|
|
||||||
--prefix "$pkgdir"/usr "$srcdir"/$pkgname-$pkgver.tgz
|
|
||||||
if [[ -e "$pkgdir"/usr/lib/node_modules/$pkgname/.openclaw-lifecycle-pending ]]; then
|
|
||||||
error "openclaw's postinstall did not run; the package would fail on first use"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat > $pkgname <<'EOF'
|
bsdtar -xf "$srcdir"/$pkgname-$pkgver.tgz -C "$srcdir" \
|
||||||
#!/bin/sh
|
package/scripts/install-cli.sh package/dist/control-ui/apple-touch-icon.png package/LICENSE
|
||||||
export SHARP_IGNORE_GLOBAL_LIBVIPS=1
|
install -Dm644 "$srcdir"/package/scripts/install-cli.sh "$pkgdir"/usr/share/$pkgname/install-cli.sh
|
||||||
exec node /usr/lib/node_modules/openclaw/openclaw.mjs "$@"
|
install -Dm644 "$srcdir"/package/dist/control-ui/apple-touch-icon.png "$pkgdir"/usr/share/$pkgname/$pkgname.png
|
||||||
EOF
|
install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname "$srcdir"/package/LICENSE
|
||||||
install -Dm755 -t "$pkgdir"/usr/bin $pkgname
|
|
||||||
|
|
||||||
cd "$pkgdir"/usr/lib/node_modules/$pkgname
|
|
||||||
install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE
|
|
||||||
install -Dm644 -t "$pkgdir"/usr/share/doc/$pkgname README.md CHANGELOG.md
|
|
||||||
for f in docs/*
|
|
||||||
do ln -s /usr/lib/node_modules/$pkgname/"$f" "$pkgdir"/usr/share/doc/$pkgname/
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
post_install() {
|
post_install() {
|
||||||
printf "%s\n" \
|
printf "%s\n" \
|
||||||
"==> Install gateway service: openclaw gateway install --force" \
|
"==> This is the release a self-updating OpenClaw starts from." \
|
||||||
"==> Perform onboarding once: openclaw onboard"
|
"==> Set it up under ~/.openclaw: omarchy-install-openclaw-cli --now"
|
||||||
}
|
}
|
||||||
|
|
||||||
post_upgrade() {
|
post_upgrade() {
|
||||||
# The gateway runs as a systemd user unit (openclaw-gateway.service in
|
# Earlier releases of this package were OpenClaw itself, under
|
||||||
# ~/.config/systemd/user), which a root pacman hook has no session bus
|
# /usr/lib/node_modules/openclaw, and which of those a machine is leaving
|
||||||
# to reach, so it cannot be restarted from here and keeps running the
|
# cannot be told from the version alone, since the upstream sync moves it.
|
||||||
# old code until the user restarts it.
|
# A root pacman hook has no session bus to move a user's OpenClaw, so
|
||||||
|
# Omarchy's migration does, and this says what happens either way.
|
||||||
printf "%s\n" \
|
printf "%s\n" \
|
||||||
"==> Restart the gateway to apply updates:" \
|
"==> OpenClaw runs from ~/.openclaw and updates itself: openclaw update" \
|
||||||
" openclaw gateway restart" \
|
"==> This package only sets the release new installs start from;" \
|
||||||
"==> Run doctor to migrate configs, check gateway health, etc.:" \
|
" omarchy update moves an OpenClaw still running from /usr there."
|
||||||
" openclaw doctor"
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user