From a52e6baeaad60459a37c6e2c4a6ebd507ffcae83 Mon Sep 17 00:00:00 2001 From: Riley Beckett Date: Thu, 30 Jul 2026 23:51:35 -0400 Subject: package emacs --- packages/emacs/emacs.sh | 22 ++++++++++++++++++++++ snag/src/build_db.c | 8 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 packages/emacs/emacs.sh diff --git a/packages/emacs/emacs.sh b/packages/emacs/emacs.sh new file mode 100644 index 0000000..08a2f90 --- /dev/null +++ b/packages/emacs/emacs.sh @@ -0,0 +1,22 @@ +pkg_id=emacs +pkg_name="Emacs" +pkg_desc="GNU Emacs" +pkg_webpage="https://www.gnu.org/software/emacs/" +pkg_license="GPL-3.0" +pkg_version=30.2 + +pkg_source_name="emacs-$pkg_version.tar.xz" +pkg_source_url="https://ftpmirror.gnu.org/gnu/emacs/emacs-$pkg_version.tar.xz" +pkg_source_checksum="b3f36f18a6dd2715713370166257de2fae01f9d38cfe878ced9b1e6ded5befd9" + +configure() { + ./configure --prefix="/usr" --without-x --with-pgtk --without-tree-sitter +} + +build() { + make -j16 +} + +install() { + make DESTDIR="$root" install +} diff --git a/snag/src/build_db.c b/snag/src/build_db.c index cb3785d..ad68be5 100644 --- a/snag/src/build_db.c +++ b/snag/src/build_db.c @@ -89,6 +89,12 @@ bool set_child_sandbox(const package_build_t* build) { if (!landlock_add_path_rule(landlock_fd, &ruleset_attr, build->package->script_path, &path_beneath)) { return false; } + path_beneath.allowed_access = + LANDLOCK_ACCESS_FS_READ_FILE | + LANDLOCK_ACCESS_FS_WRITE_FILE; + if (!landlock_add_path_rule(landlock_fd, &ruleset_attr, "/dev/null", &path_beneath)) { + return false; + } path_beneath.allowed_access = LANDLOCK_ACCESS_FS_EXECUTE | LANDLOCK_ACCESS_FS_READ_FILE | @@ -118,7 +124,7 @@ bool set_child_sandbox(const package_build_t* build) { return false; } // this is just specific to my system - (rjb) - if (!landlock_add_path_rule(landlock_fd, &ruleset_attr, "/opt/gnome/lib64", &path_beneath)) { + if (!landlock_add_path_rule(landlock_fd, &ruleset_attr, "/opt/gnome/", &path_beneath)) { } path_beneath.allowed_access = LANDLOCK_ACCESS_FS_WRITE_FILE | -- cgit v1.2.3