Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions pkgs/applications/editors/emacs-24/default.nix
Original file line number Diff line number Diff line change
@@ -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
}:

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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;
};
}
7 changes: 3 additions & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7402,17 +7402,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;
};

Expand Down