Skip to content

Instantly share code, notes, and snippets.

@orther
Last active February 27, 2019 16:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orther/fc1b4e3e377f0674d73f250790df8658 to your computer and use it in GitHub Desktop.
Save orther/fc1b4e3e377f0674d73f250790df8658 to your computer and use it in GitHub Desktop.
Build Emacs 27 with XWidget Patch on OS X

Steps

  1. Get the webkit patch for emacs 27 (0_all_webkit.patch) here: https://gist.github.com/fuxialexander/0231e994fd27be6dd87db60339238813
  1. Clone Emacs repo locally: git clone git@github.com:emacs-mirror/emacs.git emacs-mirror

  2. Create branch for patch git checkout -b nsxwidget-patch

  3. Apply Patch: git am --signoff < 0_all_webkit.patch

  4. Build:

make clean
make
./configure --prefix=$HOME/work/emacs-mirror --with-xwidgets
make install
  1. Locate Emacs.app and emacsclient:
ln -s /Users/brandon/work/code/emacs-mirror/nextstep/Emacs.app/Contents/MacOS/Emacs /usr/local/bin/emacs
ln -s /Users/brandon/work/code/emacs-mirror/nextstep/Emacs.app/Contents/MacOS/bin/emacsclient /usr/local/bin/emacsclient

Notes

May need to install texinfo with brew install texinfo and export the PATH and LDFLAGS that brew prints. Mine were:

export PATH=/usr/local/opt/texinfo/bin:$PATH
export LDFLAGS=-L/usr/local/opt/texinfo/lib

Emacs macOS Install Guide: https://github.com/emacs-mirror/emacs/blob/cab400aacde04e4455caea4a6525b26ca7909850/INSTALL#L209

@owaski
Copy link

owaski commented Jan 31, 2019

I have encountered a problem when applying the patch, following is the error message:

Applying: Support xwidget webkit for macOS X
error: patch failed: configure.ac:5481
error: configure.ac: patch does not apply
error: patch failed: nextstep/templates/Info.plist.in:675
error: nextstep/templates/Info.plist.in: patch does not apply
error: patch failed: src/emacs.c:1618
error: src/emacs.c: patch does not apply
error: patch failed: src/nsterm.m:4248
error: src/nsterm.m: patch does not apply
error: patch failed: src/xwidget.c:18
error: src/xwidget.c: patch does not apply
Patch failed at 0001 Support xwidget webkit for macOS X
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@seagle0128
Copy link

Same issue here.

Applying: Support xwidget webkit for macOS X
error: patch failed: configure.ac:5481
error: configure.ac: patch does not apply
error: patch failed: nextstep/templates/Info.plist.in:675
error: nextstep/templates/Info.plist.in: patch does not apply
error: patch failed: src/emacs.c:1618
error: src/emacs.c: patch does not apply
error: patch failed: src/nsterm.m:4248
error: src/nsterm.m: patch does not apply
error: patch failed: src/xwidget.c:18
error: src/xwidget.c: patch does not apply
Patch failed at 0001 Support xwidget webkit for macOS X
hint: Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment