emacs24Macport: change expressions to better match emacs24

This commit is contained in:
John Wiegley 2016-01-11 12:55:25 -08:00
parent fdc69f2e8f
commit b7ff0301d6

View File

@ -1,12 +1,13 @@
{ stdenv, fetchurl, ncurses, pkgconfig, texinfo, libxml2, gnutls { stdenv, fetchurl, ncurses, pkgconfig, texinfo, libxml2, gnutls
, Carbon, Cocoa, ImageCaptureCore, OSAKit, Quartz, WebKit , Carbon, Cocoa, ImageCaptureCore, OSAKit, Quartz, WebKit, gettext
, AppKit, GSS, ImageIO
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
emacsName = "emacs-24.5"; emacsName = "emacs-24.5";
name = "${emacsName}-mac-5.15"; name = "${emacsName}-mac-5.15";
#builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
url = "mirror://gnu/emacs/${emacsName}.tar.xz"; url = "mirror://gnu/emacs/${emacsName}.tar.xz";
@ -21,11 +22,11 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
buildInputs = [ buildInputs = [
ncurses pkgconfig texinfo libxml2 gnutls ncurses libxml2 gnutls pkgconfig texinfo gettext
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
Carbon Cocoa ImageCaptureCore OSAKit Quartz WebKit Carbon Cocoa ImageCaptureCore OSAKit Quartz WebKit AppKit GSS ImageIO
]; ];
postUnpack = '' postUnpack = ''
@ -34,46 +35,25 @@ stdenv.mkDerivation rec {
mv $name $emacsName mv $name $emacsName
''; '';
preConfigure = '' postPatch = ''
substituteInPlace lisp/international/mule-cmds.el --replace /usr $TMPDIR
substituteInPlace Makefile.in --replace "/bin/pwd" "pwd"
substituteInPlace lib-src/Makefile.in --replace "/bin/pwd" "pwd"
patch -p1 < patch-mac patch -p1 < patch-mac
sed -i 's|/usr/share/locale|${gettext}/share/locale|g' lisp/international/mule-cmds.el
# The search for 'tputs' will fail because it's in ncursesw within the
# ncurses package, yet Emacs' configure script only looks in ncurses.
# Further, we need to make sure that the -L option occurs before mention
# of the library, so that it finds it within the Nix store.
sed -i 's/tinfo ncurses/tinfo ncursesw/' configure
ncurseslib=$(echo ${ncurses}/lib | sed 's#/#\\/#g')
sed -i "s/OLIBS=\$LIBS/OLIBS=\"-L$ncurseslib \$LIBS\"/" configure
sed -i 's/LIBS="\$LIBS_TERMCAP \$LIBS"/LIBS="\$LIBS \$LIBS_TERMCAP"/' configure
configureFlagsArray=(
LDFLAGS=-L${ncurses}/lib
--with-xml2=yes
--with-gnutls=yes
--with-mac
--enable-mac-app=$out/Applications
)
makeFlagsArray=(
CFLAGS=-O3
LDFLAGS="-O3 -L${ncurses}/lib"
);
''; '';
postInstall = '' configureFlags = [
cat >$out/share/emacs/site-lisp/site-start.el <<EOF "LDFLAGS=-L${ncurses}/lib"
;; nixos specific load-path "--with-xml2=yes"
(when (getenv "NIX_PROFILES") (setq load-path "--with-gnutls=yes"
(append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/")) "--with-mac"
(split-string (getenv "NIX_PROFILES")))) "--enable-mac-app=$$out/Applications"
load-path))) ];
;; make tramp work for NixOS machines CFLAGS = "-O3";
(eval-after-load 'tramp '(add-to-list 'tramp-remote-path "/run/current-system/sw/bin")) LDFLAGS = "-O3 -L${ncurses}/lib";
EOF
postInstall = ''
mkdir -p $out/share/emacs/site-lisp/
cp ${./site-start.el} $out/share/emacs/site-lisp/site-start.el
''; '';
doCheck = true; doCheck = true;