summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJason \"Don\" O'Conal <lovek323@gmail.com>2013-09-07 10:28:03 +1000
committerVladimír Čunát <vcunat@gmail.com>2013-09-14 15:19:54 +0200
commitad454f3511deadfaeaf0f5235b9be2d269e585d4 (patch)
tree6c56326904f5b94757c919f5903d80a5a4669e65 /pkgs
parent5bfb4a4f30f110833a5477b43a1a060c2cd04dab (diff)
downloadnixpkgs-ad454f3511deadfaeaf0f5235b9be2d269e585d4.tar
nixpkgs-ad454f3511deadfaeaf0f5235b9be2d269e585d4.tar.gz
nixpkgs-ad454f3511deadfaeaf0f5235b9be2d269e585d4.tar.bz2
nixpkgs-ad454f3511deadfaeaf0f5235b9be2d269e585d4.tar.lz
nixpkgs-ad454f3511deadfaeaf0f5235b9be2d269e585d4.tar.xz
nixpkgs-ad454f3511deadfaeaf0f5235b9be2d269e585d4.tar.zst
nixpkgs-ad454f3511deadfaeaf0f5235b9be2d269e585d4.zip
emacs24: fix build on darwin (clos #932)
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/editors/emacs-24/default.nix36
-rw-r--r--pkgs/top-level/all-packages.nix7
2 files changed, 23 insertions, 20 deletions
diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix
index bdb7c2a565a..ad42cc7cf33 100644
--- a/pkgs/applications/editors/emacs-24/default.nix
+++ b/pkgs/applications/editors/emacs-24/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, ncurses, x11, libXaw, libXpm, Xaw3d
 , pkgconfig, gtk, libXft, dbus, libpng, libjpeg, libungif
 , libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls
-, alsaLib
+, alsaLib, cairo
 , withX ? true
 }:
 
@@ -14,27 +14,31 @@ stdenv.mkDerivation rec {
   builder = ./builder.sh;
 
   src = fetchurl {
-    url = "mirror://gnu/emacs/${name}.tar.xz";
+    url    = "mirror://gnu/emacs/${name}.tar.xz";
     sha256 = "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh";
   };
 
   buildInputs =
     [ ncurses gconf libxml2 gnutls alsaLib pkgconfig texinfo ]
     ++ stdenv.lib.optional stdenv.isLinux dbus
-    ++ stdenv.lib.optionals withX [
-         x11 libXaw Xaw3d libXpm libpng libjpeg libungif
-         libtiff librsvg libXft imagemagick gtk
-       ];
+    ++ stdenv.lib.optionals withX
+      [ x11 libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
+        imagemagick gtk ]
+    ++ stdenv.lib.optional stdenv.isDarwin cairo;
 
   configureFlags =
-    (if withX then 
-      [ "--with-x-toolkit=gtk" "--with-xft"]
-    else
-      [ "--with-x=no --with-xpm=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no" ])
+    ( if withX then 
+        [ "--with-x-toolkit=gtk" "--with-xft"]
+      else
+        [ "--with-x=no" "--with-xpm=no" "--with-jpeg=no" "--with-png=no"
+          "--with-gif=no" "--with-tiff=no" ] )
     # On NixOS, help Emacs find `crt*.o'.
     ++ stdenv.lib.optional (stdenv ? glibc)
          [ "--with-crt-dir=${stdenv.glibc}/lib" ];
 
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.isDarwin && withX)
+    "-I${cairo}/include/cairo";
+
   postInstall = ''
     cat >$out/share/emacs/site-lisp/site-start.el <<EOF
 ;; nixos specific load-path
@@ -45,10 +49,16 @@ stdenv.mkDerivation rec {
 EOF
   '';
 
+
+
   doCheck = true;
 
   meta = with stdenv.lib; {
     description = "GNU Emacs 24, the extensible, customizable text editor";
+    homepage    = http://www.gnu.org/software/emacs/;
+    license     = licenses.gplv3Plus;
+    maintainers = with maintainers; [ chaoflow lovek323 simons the-kenny ];
+    platforms   = platforms.all;
 
     longDescription = ''
       GNU Emacs is an extensible, customizable text editor—and more.  At its
@@ -66,11 +76,5 @@ EOF
       extensions are distributed with GNU Emacs; others are available
       separately.
     '';
-
-    homepage = "http://www.gnu.org/software/emacs/";
-    license = "GPLv3+";
-
-    maintainers = with maintainers; [ chaoflow lovek323 simons the-kenny ];
-    platforms = platforms.all;
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6086f255d14..b7fe9e36889 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7439,17 +7439,16 @@ let
     # use override to enable additional features
     libXaw = if stdenv.isDarwin then xlibs.libXaw else null;
     Xaw3d = null;
-    gtk = if stdenv.isDarwin then null else gtk;
     gconf = null;
     librsvg = null;
     alsaLib = null;
     imagemagick = null;
     texinfo = texinfo5;
 
-    # use gccApple on darwin to deal with: unexec: 'my_edata is not in section
-    # __data'
+    # use clangStdenv on darwin to deal with: unexec: 'my_edata is not in
+    # section __data'
     stdenv = if stdenv.isDarwin
-      then stdenvAdapters.overrideGCC stdenv gccApple
+      then clangStdenv
       else stdenv;
   };