从源 Build 安装 Emacs 支持 OS X 及 Linux 平台

Mac OS X

brew install emacs --with-imagemagick --with-gnutls --with-cocoa 

更多信息可以通过 brew info emacs 来获取,

$ brew info emacs
emacs: stable 24.5 (bottled), devel 25.0.92, HEAD
GNU Emacs text editor
https://www.gnu.org/software/emacs/
/usr/local/Cellar/emacs/25.0.92 (4,054 files, 118.9M) *
  Built from source with: --with-imagemagick --with-gnutls --with-cocoa
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/emacs.rb
==> Dependencies
Build: xz ✔, pkg-config ✔
Optional: d-bus ✘, gnutls ✔, librsvg ✘, imagemagick ✔, mailutils ✘, glib ✘
==> Options
--with-cocoa
	Build a Cocoa version of emacs
--with-ctags
	Don't remove the ctags executable that emacs provides
--with-d-bus
	Build with d-bus support
--with-glib
	Build with glib support
--with-gnutls
	Build with gnutls support
--with-imagemagick
	Build with imagemagick support
--with-librsvg
	Build with librsvg support
--with-mailutils
	Build with mailutils support
--with-x11
	Build with x11 support
--without-libxml2
	Don't build with libxml2 support
--devel
	Install development version 25.0.92
--HEAD
	Install HEAD version
==> Caveats
A command line wrapper for the cocoa app was installed to:
  /usr/local/Cellar/emacs/24.5/bin/emacs

To have launchd start emacs at login:
  ln -sfv /usr/local/opt/emacs/*.plist ~/Library/LaunchAgents
Then to load emacs now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.emacs.plist

.app bundles were installed.
Run `brew linkapps emacs` to symlink these to /Applications.

Linux

最简单的方式就是安装 LinuxBrew 后使用和 Mac 相同的方式进行安装!(感谢 jiegec 的推荐)

上面方法安装出来的是命令行版本的 Emacs。

自己从编译的方法可以在这个链接中找到:

http://ergoemacs.org/emacs/building_emacs_from_git_repository.html

信息来源于 codefalling

2 个赞

安利一下Linuxbrew: http://linuxbrew.sh/

2 个赞

@xcodebuild 杀哥的网站并没有如何 build 时候添加 imagemagick 的方法诶。还是不会。。。 (摊手

我正在跟着教程安装 Emacs ,今天遇到了个解决不了的 Bug。

configure的时候–with-imagemagick.

1 个赞

我现在装 ./configure 一直过不了 libpng 这个包 用了 apt-get install build-dep emacs24 还是过不了。明天早上我再发一个具体问题。现在在家了。

homebrew编译的cocoa没有封包。

is it possible to build GUI version of emacs using linuxbrew ?

–with-x11 Build with x11 support