-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (47 loc) · 1.64 KB
/
Makefile
File metadata and controls
61 lines (47 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Makefile for building the Cursor Flatpak
# --- Variables ---
APP_ID := codes.t3.app
MANIFEST := $(APP_ID).yml
APPDATA := $(APP_ID).appdata.xml
DESKTOP := $(APP_ID).desktop
BUILD_DIR := build-dir
SQUASHFS_ROOT := squashfs-root
ARCH ?= x86_64
APPIMAGE_FILE = $(notdir $(CURSOR_URL))
.PHONY: all build install run clean uninstall
# --- Main Targets ---
all: build
# Builds the Flatpak. Depends on the AppImage being extracted.
@echo "--> Building the Flatpak..."
# Update the version in the appdata file before building
flatpak-builder $(BUILD_DIR) $(MANIFEST) --force-clean
@echo "--> Build complete."
# Installs the Flatpak for the current user.
install: build
@echo "--> Installing the Flatpak for the current user..."
flatpak-builder --user --install --force-clean $(BUILD_DIR) $(MANIFEST)
@echo "--> Installation complete."
# Uninstalls the application.
uninstall:
@echo "--> Uninstalling Cursor..."
flatpak uninstall $(APP_ID)
# --- Helper Targets ---
# This target handles downloading and extracting the AppImage.
# It's triggered by the 'build' target.
Cursor-$(VERSION)-$(ARCH).AppImage:
@echo "--> Preparing AppImage..."
@echo " Downloading from: $(CURSOR_URL)"
wget -O $(APPIMAGE_FILE) "$(CURSOR_URL)"
@echo " Making executable..."
chmod +x $(APPIMAGE_FILE)
$(SQUASHFS_ROOT): Cursor-$(VERSION)-$(ARCH).AppImage
@echo " Extracting AppImage..."
./$(APPIMAGE_FILE) --appimage-extract
@echo " Extraction complete. Extracted to '$(SQUASHFS_ROOT)'."
# Cleans up all generated files and directories.
clean:
@echo "--> Cleaning up..."
rm -rf $(BUILD_DIR)
rm -rf $(SQUASHFS_ROOT)
rm -f *.AppImage
@echo "--> Cleanup complete."