From ff555c3b471979cd076e8d001e25caed0590bdc1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 11 Apr 2015 00:02:56 -0500 Subject: [PATCH] emacs24Macports: 24.4-mac-5.3 -> 24.5-mac-5.7 --- .../editors/emacs-24/macport-24.5.nix | 103 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 +- 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/editors/emacs-24/macport-24.5.nix diff --git a/pkgs/applications/editors/emacs-24/macport-24.5.nix b/pkgs/applications/editors/emacs-24/macport-24.5.nix new file mode 100644 index 00000000000..4ca1d334b97 --- /dev/null +++ b/pkgs/applications/editors/emacs-24/macport-24.5.nix @@ -0,0 +1,103 @@ +{ stdenv, fetchurl, ncurses, pkgconfig, texinfo, libxml2, gnutls +}: + +stdenv.mkDerivation rec { + emacsName = "emacs-24.5"; + name = "${emacsName}-mac-5.7"; + + #builder = ./builder.sh; + + src = fetchurl { + url = "mirror://gnu/emacs/${emacsName}.tar.xz"; + sha256 = "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx"; + }; + + macportSrc = fetchurl { + url = "ftp://ftp.math.s.chiba-u.ac.jp/emacs/${name}.tar.gz"; + sha256 = "1a86l3556h24x9ml6r8n6xbrxymb9gr38sicny3f0m281myhlsvv"; + }; + + # patches = [ ./darwin-new-sections.patch ]; + + buildInputs = [ ncurses pkgconfig texinfo libxml2 gnutls ]; + + postUnpack = '' + mv $emacsName $name + tar xzf $macportSrc + mv $name $emacsName + ''; + + preConfigure = '' + substituteInPlace Makefile.in --replace "/bin/pwd" "pwd" + substituteInPlace lib-src/Makefile.in --replace "/bin/pwd" "pwd" + + patch -p1 < patch-mac + + # 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 = '' + cat >$out/share/emacs/site-lisp/site-start.el <