Skip to content
Draft
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
39 changes: 39 additions & 0 deletions user/gram/patches/0001-hardcode-desktop-file-values.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From fc8fa92dad36327fe1b98b475e5b3267da49d1c4 Mon Sep 17 00:00:00 2001
From: ItsHarper <git-f4cbe@harperandrews.org>
Date: Sun, 10 May 2026 13:11:03 -0400
Subject: hardcode desktop file values

---
crates/gram/resources/gram.desktop.in | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/crates/gram/resources/gram.desktop.in b/crates/gram/resources/gram.desktop.in
index 5daceabe7d..d95bcac27b 100644
--- a/crates/gram/resources/gram.desktop.in
+++ b/crates/gram/resources/gram.desktop.in
@@ -1,13 +1,13 @@
[Desktop Entry]
Version=1.0
Type=Application
-Name=$APP_NAME
+Name=Gram
GenericName=Text Editor
Comment=A code editor for humanoid apes and grumpy toads
-TryExec=$APP_CLI
-StartupNotify=$DO_STARTUP_NOTIFY
-Exec=$APP_CLI $APP_ARGS
-Icon=$APP_ICON
+TryExec=gram
+StartupNotify=true
+Exec=gram %U
+Icon=app.liten.Gram
Categories=Utility;TextEditor;Development;IDE;
Keywords=gram;
# To add Gram to "Open Folder With..." context menu, add `inode/directory` to the MimeType field (semicolon separated)
@@ -18,5 +18,5 @@ Actions=NewWorkspace;
StartupWMClass=app.liten.Gram

[Desktop Action NewWorkspace]
-Exec=$APP_CLI --new $APP_ARGS
+Exec=gram --new %U
Name=Open a new workspace
22 changes: 22 additions & 0 deletions user/gram/patches/0002-show-pkgrel-on-about-modal.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 08d6a96f2a899b4b32e564b4a19195750ef077f7 Mon Sep 17 00:00:00 2001
From: ItsHarper <git-f4cbe@harperandrews.org>
Date: Sun, 10 May 2026 13:15:33 -0400
Subject: show pkgrel on about modal

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is solely about showing pkgrel, i don't think we need it and can drop it


---
crates/gram/src/gram.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crates/gram/src/gram.rs b/crates/gram/src/gram.rs
index 980d86d417..c93f131269 100644
--- a/crates/gram/src/gram.rs
+++ b/crates/gram/src/gram.rs
@@ -1052,7 +1052,7 @@ fn open_about(cx: &mut App) {

impl AboutWindow {
fn new(cx: &mut Context<Self>) -> Self {
- let version = env!("CARGO_PKG_VERSION");
+ let version = env!("RELEASE_VERSION");
let debug = if cfg!(debug_assertions) {
"(debug)"
} else {
22 changes: 22 additions & 0 deletions user/gram/patches/0003-unbundle-sqlite.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From eb416d52ac7ec898089f3040e8028814dec8f7ea Mon Sep 17 00:00:00 2001
From: ItsHarper <git-f4cbe@harperandrews.org>
Date: Sun, 10 May 2026 13:17:06 -0400
Subject: unbundle sqlite

---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Cargo.toml b/Cargo.toml
index fa2a8b128a..260244988d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -402,7 +402,7 @@ jupyter-protocol = "1.1.0"
jupyter-websocket-client = "1.0.0"
kdl = "6.5.0"
libc = "0.2"
-libsqlite3-sys = { version = "0.37", features = ["bundled"] }
+libsqlite3-sys = { version = "0.37" }
linkify = "0.11"
log = { version = "0.4.16", features = ["kv_unstable_serde", "serde"] }
lsp-types = { git = "https://github.com/zed-industries/lsp-types", rev = "b71ab4eeb27d9758be8092020a46fe33fbca4e33" }
74 changes: 74 additions & 0 deletions user/gram/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
pkgname = "gram"
pkgver = "2.0.0"
pkgrel = 0
build_style = "cargo"
make_env = {
"RELEASE_VERSION": f"{pkgver}-chimera-linux-r{pkgrel}",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to the above comment

"GRAM_UPDATE_EXPLANATION": "Update Gram using the apk package manager",
}
make_build_args = ["--package", "gram", "--package", "cli"]
make_check_args = [
"--workspace",
"--exclude=ui_macros",
"--",
"--skip=repository::tests::test_checkpoint_basic",
"--skip=repository::tests::test_checkpoint_empty_repo",
"--skip=repository::tests::test_checkpoint_exclude_binary_files",
"--skip=repository::tests::test_compare_checkpoints",
"--skip=project_tests::test_file_status",
"--skip=project_tests::test_git_repository_status",
"--skip=project_tests::test_rename_work_directory",
"--skip=project_tests::test_staging_hunk_preserve_executable_permission",
"--skip=gram::tests::test_window_edit_state_restoring_enabled",
]
hostmakedepends = [
"cargo-auditable",
"cmake",
"pkgconf",
"protobuf-protoc",
"rust-bindgen",
]
makedepends = [
"alsa-lib-devel",
"libgit2-devel",
"libx11-devel",
"libxkbcommon-devel",
"openssl3-devel",
"sqlite-devel",
"zstd-devel",
]
pkgdesc = "Code editor for humanoid apes and grumpy toads, forked from Zed"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text editor forked from Zed

license = "GPL-3.0-only"
url = "https://gram-editor.com"
source = f"https://codeberg.org/GramEditor/gram/archive/{pkgver}.tar.gz"
sha256 = "091e2788a31261e76c01c272bdb9b4f53a3106a4c9e16dfa1318fb916e50e5bf"
# TODO(Harper): Patch message "Installation from source URL requires rustup to be installed"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a simple change in crates/extensions_ui/src/extension_suggest.rs

# TODO(Harper): Patch in extension compilation errors that explain which packages to install

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this is necessary



def install(self):
self.install_file(
f"target/{self.profile().triplet}/release/gram",
"usr/lib/gram",
name="gram-editor",
)
self.install_bin(
f"target/{self.profile().triplet}/release/cli",
name="gram",
)
self.install_file(
"crates/gram/resources/app-icon.png",
"usr/share/icons/hicolor/512x512/apps",
name="app.liten.Gram.png",
)
self.install_file(
"crates/gram/resources/app-icon@2x.png",
"usr/share/icons/hicolor/1024x1024/apps",
name="app.liten.Gram.png",
)
Comment on lines +59 to +68

@q66 q66 Jul 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the scalable app icon as in https://codeberg.org/GramEditor/gram/commit/76a368e0397a01141bbe7f7f13616cb70e5d8347#diff-89b78e428e295773d6e28127128e2a92d4beaea1 following upstream

don't install the png ones as they are different

follow the upstream naming as well, which will need adjustment for the .desktop file patch

self.install_file(
"crates/gram/resources/gram.desktop.in",
"usr/share/applications",
name="app.liten.Gram.desktop",
)
self.install_license("LICENSE-GPL")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's unnecessary to install the GPL