Skip to content

Instantly share code, notes, and snippets.

@jonpalmisc
Created January 3, 2023 02:28
Show Gist options
  • Save jonpalmisc/30b829cda835b51d59dc88db065c8df5 to your computer and use it in GitHub Desktop.
Save jonpalmisc/30b829cda835b51d59dc88db065c8df5 to your computer and use it in GitHub Desktop.
From ab31655804c4e6c89b873e2a11b9d8f1b676a171 Mon Sep 17 00:00:00 2001
From: Jon Palmisciano <[email protected]>
Date: Mon, 2 Jan 2023 21:13:45 -0500
Subject: [PATCH] Add macOS build and fix scripts
---
jp-configure.sh | 9 +++++++++
jp-inject-path.sh | 15 +++++++++++++++
2 files changed, 24 insertions(+)
create mode 100755 jp-configure.sh
create mode 100755 jp-inject-path.sh
diff --git a/jp-configure.sh b/jp-configure.sh
new file mode 100755
index 0000000000..9c993e2a41
--- /dev/null
+++ b/jp-configure.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export CFLAGS="$CFLAGS -O2 -g -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT"
+export CPATH="$(brew --prefix)/include"
+export LIBRARY_PATH="$(brew --prefix)/lib/gcc/current"
+
+./configure --with-ns --with-native-compilation --with-modules \
+ --with-json --with-xml2 --with-gnutls \
+ --without-dbus --without-imagemagick
diff --git a/jp-inject-path.sh b/jp-inject-path.sh
new file mode 100755
index 0000000000..55e76369ae
--- /dev/null
+++ b/jp-inject-path.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+APP="./nextstep/Emacs.app"
+PLIST="$APP/Contents/Info.plist"
+
+CLEAN_PATH=$(echo "$PATH" | tr ':' '\n' | grep -v -e VMware\ Fusion -e Little\ Snitch -e .antigen -e .cargo | tr '\n' ':')
+
+cp "$PLIST" "$PLIST.bak"
+
+/usr/libexec/PlistBuddy -c "Add :LSEnvironment dict" "$PLIST"
+/usr/libexec/PlistBuddy -c "Add :LSEnvironment:PATH string" "$PLIST"
+/usr/libexec/PlistBuddy -c "Set :LSEnvironment:PATH $CLEAN_PATH" "$PLIST"
+/usr/libexec/PlistBuddy -c "Print :LSEnvironment" "$PLIST"
+
+touch "$APP"
--
2.39.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment