From 198874e4897793a180bf61543bb39dea0a4d8abc Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 3 Nov 2014 10:51:29 -0600 Subject: emacs24Macport: allow installing either 24.3 or 24.4 --- .../applications/editors/emacs-24/macport-24.3.nix | 100 +++++++++++++++++++++ .../applications/editors/emacs-24/macport-24.4.nix | 100 +++++++++++++++++++++ pkgs/applications/editors/emacs-24/macport.nix | 100 --------------------- 3 files changed, 200 insertions(+), 100 deletions(-) create mode 100644 pkgs/applications/editors/emacs-24/macport-24.3.nix create mode 100644 pkgs/applications/editors/emacs-24/macport-24.4.nix delete mode 100644 pkgs/applications/editors/emacs-24/macport.nix (limited to 'pkgs/applications/editors') diff --git a/pkgs/applications/editors/emacs-24/macport-24.3.nix b/pkgs/applications/editors/emacs-24/macport-24.3.nix new file mode 100644 index 000000000000..d9b32351040b --- /dev/null +++ b/pkgs/applications/editors/emacs-24/macport-24.3.nix @@ -0,0 +1,100 @@ +{ stdenv, fetchurl, ncurses, pkgconfig, texinfo, libxml2, gnutls +}: + +stdenv.mkDerivation rec { + emacsName = "emacs-24.3"; + name = "${emacsName}-mac-4.8"; + + #builder = ./builder.sh; + + src = fetchurl { + url = "mirror://gnu/emacs/${emacsName}.tar.xz"; + sha256 = "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh"; + }; + + macportSrc = fetchurl { + url = "ftp://ftp.math.s.chiba-u.ac.jp/emacs/${name}.tar.gz"; + sha256 = "194y341zrpjp75mc3099kjc0inr1d379wwsnav257bwsc967h8yx"; + }; + + patches = [ ./darwin-new-sections.patch ]; + + buildInputs = [ ncurses pkgconfig texinfo libxml2 gnutls ]; + + postUnpack = '' + mv $emacsName $name + tar xzf $macportSrc + mv $name $emacsName + ''; + + preConfigure = '' + patch -p0 < 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 <$out/share/emacs/site-lisp/site-start.el <$out/share/emacs/site-lisp/site-start.el <