87 lines
3.1 KiB
Bash
87 lines
3.1 KiB
Bash
# Maintainer: s1d3sw1ped <https://git.s1d3sw1ped.com/s1d3sw1ped>
|
|
# Unofficial Arch/CachyOS repackage of the official Grok Bot .deb.
|
|
# Temporary until upstream ships a native package.
|
|
#
|
|
# Version oracle (commit is in the download URL):
|
|
# https://api2.cursor.sh/updates/api/update/linux-x64/sand/0.0.0/00000000-0000-0000-0000-000000000000/stable
|
|
# Deb URL:
|
|
# https://downloads.cursor.com/grokbot/stable/<commit>/linux/x64/grok-bot_<pkgver>_amd64.deb
|
|
|
|
pkgname=grok-bot-bin
|
|
pkgver=0.43.0
|
|
_commit=dd6e1fd3efb029e94e3c9d5c4d3e66510a917395
|
|
pkgrel=1
|
|
pkgdesc="Grok Bot desktop agent (official .deb repackaged)"
|
|
arch=('x86_64')
|
|
url="https://cursor.com/download/bot"
|
|
license=('LicenseRef-proprietary')
|
|
depends=(
|
|
'alsa-lib'
|
|
'at-spi2-core'
|
|
'gtk3'
|
|
'libdrm'
|
|
'libnotify'
|
|
'libsecret'
|
|
'libxkbcommon'
|
|
'libxss'
|
|
'libxtst'
|
|
'mesa'
|
|
'nss'
|
|
'xdg-utils'
|
|
)
|
|
optdepends=(
|
|
'libappindicator-gtk3: tray icon support'
|
|
'curl: auto-update check on launch'
|
|
'polkit: graphical password prompt for desktop auto-update (pkexec)'
|
|
)
|
|
provides=('grok-bot' 'sand')
|
|
conflicts=('grok-bot' 'sand')
|
|
replaces=('sand')
|
|
options=('!strip' '!debug')
|
|
source=(
|
|
"https://downloads.cursor.com/grokbot/stable/${_commit}/linux/x64/grok-bot_${pkgver}_amd64.deb"
|
|
"grok-bot-launch.sh"
|
|
"pkexec-pacman-u"
|
|
"com.s1d3sw1ped.grok-bot-bin.policy"
|
|
)
|
|
noextract=("grok-bot_${pkgver}_amd64.deb")
|
|
sha256sums=(
|
|
'451ecae8fcbda48a7c75dfc74a0da8f1d6452f6063b72330cbbaad29f3455380'
|
|
'36e1c522f7a3920a850a6235263d82ad5990611612979447c1e9eff92548ac1e'
|
|
)
|
|
|
|
package() {
|
|
bsdtar -O -xf "$srcdir/grok-bot_${pkgver}_amd64.deb" data.tar.xz \
|
|
| bsdtar -xJf - -C "$pkgdir"
|
|
|
|
# Auto-update launch shim (not a plain symlink into /opt).
|
|
install -Dm755 "$srcdir/grok-bot-launch.sh" "$pkgdir/usr/bin/grok-bot"
|
|
# Keep provides(sand) on PATH; both names run the same shim.
|
|
ln -sf grok-bot "$pkgdir/usr/bin/sand"
|
|
|
|
# pkexec helper + polkit action (auth_admin, not NOPASSWD) for desktop auto-update.
|
|
install -Dm755 "$srcdir/pkexec-pacman-u" "$pkgdir/usr/lib/grok-bot-bin/pkexec-pacman-u"
|
|
install -Dm644 "$srcdir/com.s1d3sw1ped.grok-bot-bin.policy" \
|
|
"$pkgdir/usr/share/polkit-1/actions/com.s1d3sw1ped.grok-bot-bin.policy"
|
|
|
|
# Always point the menu entry at the PATH shim. Upstream .desktop has used
|
|
# Exec="/opt/Grok Bot/grok-bot" (0.30) which bypasses auto-update; rewrite
|
|
# every build so a future /opt regression cannot ship again.
|
|
if [[ -f "$pkgdir/usr/share/applications/grok-bot.desktop" ]]; then
|
|
sed -i 's|^Exec=.*|Exec=grok-bot %U|' \
|
|
"$pkgdir/usr/share/applications/grok-bot.desktop"
|
|
fi
|
|
|
|
# Path contains a space, so Chromium cannot use the SUID sandbox.
|
|
# Arch/CachyOS kernels have user namespaces; keep chrome-sandbox non-setuid.
|
|
if [[ -f "$pkgdir/opt/Grok Bot/chrome-sandbox" ]]; then
|
|
chmod 0755 "$pkgdir/opt/Grok Bot/chrome-sandbox"
|
|
fi
|
|
|
|
install -dm755 "$pkgdir/usr/share/licenses/$pkgname"
|
|
ln -sf "/opt/Grok Bot/LICENSE.electron.txt" \
|
|
"$pkgdir/usr/share/licenses/$pkgname/LICENSE.electron.txt"
|
|
ln -sf "/opt/Grok Bot/LICENSES.chromium.html" \
|
|
"$pkgdir/usr/share/licenses/$pkgname/LICENSES.chromium.html"
|
|
}
|