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
12 changes: 0 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ BUILD_DIR := build-dir
SQUASHFS_ROOT := squashfs-root
ARCH ?= x86_64

# The user MUST provide these variables when running make
# Example: make build VERSION=0.25.4 CURSOR_URL=https://.../Cursor-0.25.4.AppImage
ifndef CURSOR_URL
$(error CURSOR_URL is not set. Please provide the download URL for the AppImage.)
endif
ifndef VERSION
$(error VERSION is not set. Please provide the version number.)
endif

APPIMAGE_FILE = $(notdir $(CURSOR_URL))

Expand All @@ -27,13 +19,9 @@ APPIMAGE_FILE = $(notdir $(CURSOR_URL))
all: build

# Builds the Flatpak. Depends on the AppImage being extracted.
build: $(SQUASHFS_ROOT)
@echo "--> Building the Flatpak..."
# Update the version in the appdata file before building
sed -i 's/{{VERSION}}/$(VERSION)/g' $(APPDATA)
flatpak-builder $(BUILD_DIR) $(MANIFEST) --force-clean
# Revert the version change so the template remains clean
sed -i 's/$(VERSION)/{{VERSION}}/g' $(APPDATA)
@echo "--> Build complete."

# Installs the Flatpak for the current user.
Expand Down
2 changes: 1 addition & 1 deletion com.anysphere.Cursor.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<launchable type="desktop-id">com.cursor.App.desktop</launchable>

<releases>
<release version="{{VERSION}}" date-iso="2025-07-03"/>
<release version="1.2.2" date-iso="2025-07-03"/>
</releases>

<content_rating type="oars-1.1" />
Expand Down
42 changes: 28 additions & 14 deletions com.anysphere.Cursor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,55 @@ command: zypak-run.sh
base: org.electronjs.Electron2.BaseApp
base-version: "24.08"
finish-args:
# Basic X11 and Wayland access
- --socket=x11
- --share=ipc
- --socket=wayland
- --socket=x11
# GPU acceleration
- --device=dri
# Audio
- --socket=pulseaudio
- --socket=ssh-auth
# Network access - Cursor needs this for its AI features
- --share=network
# Allow talking to the D-Bus session bus
- --socket=session-bus
- --socket=system-bus
- --persist=.vscode-oss
- --allow=devel
- --talk-name=org.freedesktop.secrets
- --talk-name=org.kde.kwalletd5
- --talk-name=org.freedesktop.Flatpak
- --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons
- --filesystem=xdg-run/gnupg:ro
- --filesystem=xdg-config/kdeglobals:ro
- --talk-name=com.canonical.AppMenu.Registrar
- --system-talk-name=org.freedesktop.login1
# Unsure
- --talk-name=org.freedesktop.Notifications
# Deny access to the home directory for security
- --nofilesystem=home
# Grant access to a specific projects folder
- --filesystem=~/cursor-workspace:create

modules:
# Module for the Cursor application itself
- shared-modules/libcanberra/libcanberra.json
- name: cursor
buildsystem: simple
build-commands:
- chmod +x ./Cursor.AppImage
- ./Cursor.AppImage --appimage-extract
# Copy the extracted AppImage contents into the /app directory
- cp -r usr /app/usr
- cp -r squashfs-root/usr /app/usr
# Install metadata files
- install -Dm644 com.anysphere.Cursor.desktop /app/share/applications/com.anysphere.Cursor.desktop
- install -Dm644 com.anysphere.Cursor.appdata.xml /app/share/metainfo/com.anysphere.cursor.appdata.xml
- install -Dm644 co.anysphere.cursor.png /app/share/icons/hicolor/256x256/apps/com.anysphere.Cursor.png
- mkdir -p /app/share/icons/hicolor/256x256/apps
- ffmpeg -width 256 -i squashfs-root/usr/share/pixmaps/co.anysphere.cursor.png -vf scale=256:-1 -frames:v 1 /app/share/icons/hicolor/256x256/apps/com.anysphere.Cursor.png
- install -Dm755 run.sh /app/bin/zypak-run.sh
- rm -rf squashfs-root
sources:
# The Makefile will create this directory before the build starts
- type: dir
path: squashfs-root
- type: file
dest-filename: Cursor.AppImage
url: https://api2.cursor.sh/updates/download/golden/linux-x64/cursor/1.7
sha256: 5c328365809a82bedb10be07cd016485d5213e22f931a4736533cdacb0cf6433
x-checker-data:
type: rotating-url
url: https://api2.cursor.sh/updates/download/golden/linux-x64/cursor/1.7
dest-filename: Cursor.AppImage
# These are the metadata files from our project directory
- type: file
path: com.anysphere.Cursor.desktop
Expand Down