Skip to content
Open
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
4 changes: 1 addition & 3 deletions pkgbuilds/grok-bot/.omarchy/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"source": "aur",
"sync": false,
"upstream_commit": "05eb78fca06b482affda28b26223cbf249d4bbcd"
"source": "local"
}
60 changes: 60 additions & 0 deletions pkgbuilds/grok-bot/.omarchy/upstream.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
# Cursor publishes Grok Bot through the linux-x64 sand update feed. The feed
# carries version plus the 40-char build id that the Linux .deb URL needs.
# Darwin's feed no longer embeds that id, so this hook reads Linux directly.
#
# bin/sync-upstream rewrites pkgver and sha256sums_x86_64. The Linux URL also
# needs _commit, which that rewriter does not touch, so this hook updates
# _commit itself when it reports a new release.
set -euo pipefail

FEED='https://api2.cursor.sh/updates/api/update/linux-x64/sand/0.0.0/00000000-0000-0000-0000-000000000000/stable'
PKGBUILD="${PKGBUILD:-PKGBUILD}"

if ! command -v vercmp >/dev/null 2>&1; then
echo "vercmp not found: this hook needs pacman to compare versions" >&2
exit 1
fi

[[ -f "${PKGBUILD}" ]] || {
echo "PKGBUILD not found at ${PKGBUILD}" >&2
exit 1
}

json=$(curl -fsSL -H 'cache-control: no-cache' "${FEED}")
version=$(jq -er '.version // .productVersion // .name' <<<"${json}")
feed_url=$(jq -er '.url' <<<"${json}")
commit=$(sed -nE 's@.*/grokbot/stable/([0-9a-f]{40})/.*@\1@p' <<<"${feed_url}")

[[ -n "${version}" && -n "${commit}" ]] || {
echo "Could not parse version/commit from linux-x64 sand feed: ${json}" >&2
exit 1
}

current=$(awk -F= '/^pkgver=/ { print $2; exit }' "${PKGBUILD}" | tr -d "\"'")
if [[ -n "${current}" ]] && [[ "$(vercmp "${version}" "${current}")" -le 0 ]]; then
echo '{}'
exit 0
fi

deb_url="https://downloads.cursor.com/grokbot/stable/${commit}/linux/x64/grok-bot_${version}_amd64.deb"
code=$(curl -fsSIL -o /dev/null -w '%{http_code}' "${deb_url}")
[[ "${code}" == "200" ]] || {
echo "Linux deb not fetchable (${code}): ${deb_url}" >&2
exit 1
}

sha256=$(curl -fL --retry 3 -sS "${deb_url}" | sha256sum | awk '{print $1}')
[[ "${sha256}" =~ ^[0-9a-f]{64}$ ]] || {
echo "Could not hash ${deb_url}" >&2
exit 1
}

if [[ $(grep -c '^_commit=' "${PKGBUILD}") -ne 1 ]]; then
echo "Expected exactly one _commit= assignment in ${PKGBUILD}" >&2
exit 1
fi
sed -i "s/^_commit=.*/_commit=${commit}/" "${PKGBUILD}"

jq -n --arg pkgver "${version}" --arg sha256 "${sha256}" \
'{pkgver: $pkgver, sha256sums: {x86_64: [$sha256]}}'
22 changes: 15 additions & 7 deletions pkgbuilds/grok-bot/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Maintainer: petrouil
# Contributor: Omarchy

# Cursor ships Grok Bot as a Debian package on downloads.cursor.com. The Linux
# sand update feed carries the version and the 40-char build id the .deb URL
# needs. .omarchy/upstream.sh rewrites pkgver, _commit, and sha256sums_x86_64
# from that feed. Darwin's feed no longer embeds the build id.

pkgname=grok-bot
pkgver=0.29.0
pkgver=0.39.0
pkgrel=1
_commit=f0e5bfcee649ea84c0c61369cf896cd146d72136
_commit=d8bc9c753edddb313047c9c69b480b7f8f321087
pkgdesc='Grok Bot desktop agent'
arch=('x86_64')
url='https://x.ai/bot'
Expand All @@ -25,18 +30,21 @@ optdepends=('libappindicator-gtk3: tray support')
provides=('sand')
conflicts=('sand')
options=('!strip' '!debug')
_deb="${pkgname}_${pkgver}.deb"
source=(
"${pkgname}_${pkgver}.deb::https://downloads.cursor.com/grokbot/stable/${_commit}/linux/x64/Grok_Bot_${pkgver}.deb"
'grok-bot.sh'
'grok-bot.desktop'
)
sha256sums=('d223b5830282aef11d5c46d8f4d1edd239bf992e336405cbd288d4476b9233d4'
'6dfa6c305941afa6cbaefbeaae06d05ab5a88f31630005d25a819a160c20c7a3'
source_x86_64=(
"${_deb}::https://downloads.cursor.com/grokbot/stable/${_commit}/linux/x64/grok-bot_${pkgver}_amd64.deb"
)
sha256sums=('6dfa6c305941afa6cbaefbeaae06d05ab5a88f31630005d25a819a160c20c7a3'
'856056c9ca63dda5d01158ce8fb6a9a7cbb3f67c13a92b573cd196d3e50f26e7')
noextract=("${pkgname}_${pkgver}.deb")
sha256sums_x86_64=('ae498adaf71f9ff1734a786163c5807fa50165acb5aa102bb68f43ead96de4fe')
noextract=("${_deb}")

package() {
bsdtar -xOf "${srcdir}/${pkgname}_${pkgver}.deb" data.tar.xz |
bsdtar -xOf "${srcdir}/${_deb}" data.tar.xz |
bsdtar -x -C "${pkgdir}" -f -

rm -rf "${pkgdir}/usr/share/doc" \
Expand Down
49 changes: 0 additions & 49 deletions pkgbuilds/grok-bot/update-pkgver.sh

This file was deleted.