2016-09-21 20:19:57 +00:00
|
|
|
{ stdenv, fetchurl, ncurses, pkgconfig, texinfo, libxml2, gnutls, gettext, autoconf, automake
|
|
|
|
, AppKit, Carbon, Cocoa, IOKit, OSAKit, Quartz, QuartzCore, WebKit
|
|
|
|
, ImageCaptureCore, GSS, ImageIO # These may be optional
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-09-14 20:22:19 +00:00
|
|
|
emacsVersion = "25.3";
|
2017-03-24 21:16:39 +00:00
|
|
|
emacsName = "emacs-${emacsVersion}";
|
2017-09-14 20:22:19 +00:00
|
|
|
macportVersion = "6.7";
|
2017-03-24 21:16:39 +00:00
|
|
|
name = "emacs-mac-${emacsVersion}-${macportVersion}";
|
2016-09-21 20:19:57 +00:00
|
|
|
|
|
|
|
builder = ./builder.sh;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2017-04-22 18:39:47 +00:00
|
|
|
url = "mirror:///gnu/emacs/${emacsName}.tar.xz";
|
2017-09-14 20:22:19 +00:00
|
|
|
sha256 = "02y00y9q42g1iqgz5qhmsja75hwxd88yrn9zp14lanay0zkwafi5";
|
2016-09-21 20:19:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
macportSrc = fetchurl {
|
2017-03-24 21:16:39 +00:00
|
|
|
url = "ftp://ftp.math.s.chiba-u.ac.jp/emacs/${emacsName}-mac-${macportVersion}.tar.gz";
|
2017-09-14 20:22:19 +00:00
|
|
|
sha256 = "0fivrasvigszr31w8wg8kb808hmqv2cc8klrm9n0hdxwg5fs5d0y";
|
2016-09-21 20:19:57 +00:00
|
|
|
};
|
|
|
|
|
2017-01-23 23:49:39 +00:00
|
|
|
hiresSrc = fetchurl {
|
|
|
|
url = "ftp://ftp.math.s.chiba-u.ac.jp/emacs/emacs-hires-icons-2.0.tar.gz";
|
|
|
|
sha256 = "1ari8n3y1d4hdl9npg3c3hk27x7cfkwfgyhgzn1vlqkrdah4z434";
|
|
|
|
};
|
|
|
|
|
2016-09-21 20:19:57 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-04-22 18:40:41 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig autoconf automake ];
|
|
|
|
|
|
|
|
buildInputs = [ ncurses libxml2 gnutls texinfo gettext ];
|
2016-09-21 20:19:57 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
AppKit Carbon Cocoa IOKit OSAKit Quartz QuartzCore WebKit
|
|
|
|
ImageCaptureCore GSS ImageIO # may be optional
|
|
|
|
];
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
mv $sourceRoot $name
|
2017-03-24 21:16:39 +00:00
|
|
|
tar xzf $macportSrc -C $name --strip-components=1
|
2016-09-21 20:19:57 +00:00
|
|
|
mv $name $sourceRoot
|
2017-01-23 23:49:39 +00:00
|
|
|
|
|
|
|
# extract retina image resources
|
|
|
|
tar xzfv $hiresSrc --strip 1 -C $sourceRoot
|
2016-09-21 20:19:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patch -p1 < patch-mac
|
|
|
|
substituteInPlace lisp/international/mule-cmds.el \
|
|
|
|
--replace /usr/share/locale ${gettext}/share/locale
|
2017-01-23 23:49:39 +00:00
|
|
|
|
|
|
|
# use newer emacs icon
|
|
|
|
cp nextstep/Cocoa/Emacs.base/Contents/Resources/Emacs.icns mac/Emacs.app/Contents/Resources/Emacs.icns
|
2016-09-21 20:19:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"LDFLAGS=-L${ncurses.out}/lib"
|
|
|
|
"--with-xml2=yes"
|
|
|
|
"--with-gnutls=yes"
|
|
|
|
"--with-mac"
|
2017-04-22 18:40:41 +00:00
|
|
|
"--with-modules"
|
2016-09-21 20:19:57 +00:00
|
|
|
"--enable-mac-app=$$out/Applications"
|
|
|
|
];
|
|
|
|
|
2017-03-19 03:20:24 +00:00
|
|
|
CFLAGS = "-O3 -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_10";
|
2016-09-21 20:19:57 +00:00
|
|
|
LDFLAGS = "-O3 -L${ncurses.out}/lib";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/emacs/site-lisp/
|
|
|
|
cp ${./site-start.el} $out/share/emacs/site-lisp/site-start.el
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "GNU Emacs 25, the extensible, customizable text editor";
|
|
|
|
homepage = http://www.gnu.org/software/emacs/;
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ jwiegley ];
|
|
|
|
platforms = platforms.darwin;
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
GNU Emacs is an extensible, customizable text editor—and more. At its
|
|
|
|
core is an interpreter for Emacs Lisp, a dialect of the Lisp
|
|
|
|
programming language with extensions to support text editing.
|
|
|
|
|
|
|
|
The features of GNU Emacs include: content-sensitive editing modes,
|
|
|
|
including syntax coloring, for a wide variety of file types including
|
|
|
|
plain text, source code, and HTML; complete built-in documentation,
|
|
|
|
including a tutorial for new users; full Unicode support for nearly all
|
|
|
|
human languages and their scripts; highly customizable, using Emacs
|
|
|
|
Lisp code or a graphical interface; a large number of extensions that
|
|
|
|
add other functionality, including a project planner, mail and news
|
|
|
|
reader, debugger interface, calendar, and more. Many of these
|
|
|
|
extensions are distributed with GNU Emacs; others are available
|
|
|
|
separately.
|
|
|
|
|
2017-03-24 21:16:50 +00:00
|
|
|
This is "Mac port" addition to GNU Emacs 25. This provides a native
|
|
|
|
GUI support for Mac OS X 10.6 - 10.12. Note that Emacs 23 and later
|
2016-09-21 20:19:57 +00:00
|
|
|
already contain the official GUI support via the NS (Cocoa) port for
|
|
|
|
Mac OS X 10.4 and later. So if it is good enough for you, then you
|
|
|
|
don't need to try this.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|