summary refs log tree commit diff
path: root/pkgs/applications/editors/emacs-22/default.nix
blob: 17b8386bb7212177f50054e60760d739b95135ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ xawSupport ? true
, xpmSupport ? true
, xaw3dSupport ? false
, gtkGUI ? false
, stdenv, fetchurl, x11, libXaw ? null, libXpm ? null, Xaw3d ? null
, pkgconfig ? null, gtk ? null
, ncurses
}:

assert xawSupport && !xaw3dSupport -> libXaw != null;
assert xawSupport && xaw3dSupport -> Xaw3d != null;
assert xpmSupport -> libXpm != null;
assert gtkGUI -> pkgconfig != null && gtk != null;

stdenv.mkDerivation {
  name = "emacs-22.2";

  builder = ./builder.sh;
  
  src = fetchurl {
    url = mirror://gnu/emacs/emacs-22.2.tar.gz;
    md5 = "d6ee586b8752351334ebf072904c4d51";
  };
  
  buildInputs = [ncurses x11]
    ++ stdenv.lib.optional xawSupport (if xaw3dSupport then Xaw3d else libXaw)
    ++ stdenv.lib.optional xpmSupport libXpm
    ++ stdenv.lib.optionals gtkGUI [pkgconfig gtk];
  
  configureFlags =
    stdenv.lib.optional gtkGUI "--with-x-toolkit=gtk";

  meta = {
    description = "Emacs, *the* text editor";
    homepage = http://www.gnu.org/software/emacs/;
    license = "GPL";
  };
}