# Maintainer: Gunther Schulz pkgname=cursor-bin pkgver=3.24.12 pkgrel=1 pkgdesc='AI-first coding environment' arch=('x86_64' 'aarch64') url="https://www.cursor.com" license=('LicenseRef-Cursor_EULA') # upstream uses Electron newer than internal VSCode _electron=electron42 depends=(xdg-utils gcc-libs hicolor-icon-theme libxkbfile) depends_x86_64=(ripgrep $_electron nodejs) # ARM retains bundled Electron because electron42 is unavailable in ALARM. depends_aarch64=( alsa-lib at-spi2-core ca-certificates cairo curl dbus expat glib2 glibc gtk3 libcups libsecret libx11 libxcb libxcomposite libxdamage libxext libxfixes libxkbcommon libxrandr mesa nspr nss pango systemd-libs which ) options=(!strip !debug) # Don't break ext of VSCode _commit=37b865941ccb31e2fc90c685157534efca87f964 source_x86_64=("https://downloads.cursor.com/production/${_commit}/linux/x64/deb/amd64/deb/cursor_${pkgver}_amd64.deb" "https://gitlab.archlinux.org/archlinux/packaging/packages/code/-/raw/main/code."{sh,mjs} rg.sh) sha512sums_x86_64=('336dc2b642cbb6d16a65bbd79cd4241e53c0d1fd3d9189850d7a922d1afcc9c37908d8a1e24d8c06429a12b375e7629a06e5f168c51e7be12e0b57430f6f1b86' '937299c6cb6be2f8d25f7dbc95cf77423875c5f8353b8bd6cd7cc8e5603cbf8405b14dbf8bd615db2e3b36ed680fc8e1909410815f7f8587b7267a699e00ab37' '793f9ff6306e3992ac89802d98110cba288ea1181a901467333293b7d76182ef9792c2a39ff49d9347a18a174b1f42bc58862091dff583f4146c2704eea28033' 'e79fe7659f59d1ae02fc68816399bfd31587315df6cdb6ccf1d0ca76f7cdc692c2a42b30591c0091147bd97ef14b1c7745dc26bd7cb3ea6bba45698e5044fa2a') source_aarch64=("https://downloads.cursor.com/production/${_commit}/linux/arm64/deb/arm64/deb/cursor_${pkgver}_arm64.deb") sha512sums_aarch64=('fd2fc67f4cbec2e35a43046019ecddf14c025ae06398a1652369839a58fbd0edd565cf433525734c8a114b0bb4b5a3a6c9cfce0cc71739f4f803cbf984275876') noextract=(cursor_${pkgver}_amd64.deb cursor_${pkgver}_arm64.deb) # avoid double tarball _app=usr/share/cursor/resources/app package() { local deb="cursor_${pkgver}_amd64.deb" local -a excludes=(--exclude 'usr/share/cursor/[^r]*' --exclude 'usr/share/cursor/*.pak') if [[ "$CARCH" == aarch64 ]]; then deb="cursor_${pkgver}_arm64.deb" # Keep bundled Electron; omit Debian's AppArmor and sysctl settings. excludes=(--exclude './etc') fi bsdtar -xOf "${srcdir}/${deb}" data.tar.xz | tar -xJf - -C "$pkgdir" "${excludes[@]}" cd "$pkgdir" # Disable Cursor's bundled updater; Omarchy manages updates via pacman (#238). sed -i '/^[[:space:]]*"\(backupUpdateUrl\|updateUrl\)":/d' \ "${_app}/product.json" mv usr/share/zsh/{vendor-completions,site-functions} if [[ "$CARCH" == aarch64 ]]; then install -d usr/bin ln -s /usr/share/cursor/bin/cursor usr/bin/cursor # Use Electron's unprivileged namespace sandbox. chmod 0755 usr/share/cursor/chrome-sandbox return fi ln -sf /usr/bin/node ${_app}/resources/helpers/node install -Dm755 "${srcdir}/rg.sh" ${_app}/node_modules/@vscode/ripgrep/bin/rg ln -sf /usr/bin/xdg-open ${_app}/node_modules/open/xdg-open sed -e "1s|.*|#!/usr/lib/${_electron}/electron|" \ -e "s|code-oss|cursor|g" -e "s|code.mjs|cursor.mjs|g" \ "${srcdir}"/code.mjs | install -Dm644 /dev/stdin "${pkgdir}/${_app}/cursor.mjs" sed -e "s|code-flags|cursor-flags|" -e "s|/usr/lib/code|/${_app}|" -e "s|/usr/lib/code/code.mjs|/${_app}/cursor.mjs|" \ -e "s|name=electron|name=${_electron}|" "${srcdir}"/code.sh | install -Dm755 /dev/stdin "${pkgdir}"/usr/share/cursor/cursor install -d "$pkgdir"/usr/bin ln -sf /usr/share/cursor/cursor "$pkgdir"/usr/bin/cursor }