diff --git a/pkgs/applications/editors/emacs-23/default.nix b/pkgs/applications/editors/emacs-23/default.nix index a0ff68a76bf..4bdb4f132c2 100644 --- a/pkgs/applications/editors/emacs-23/default.nix +++ b/pkgs/applications/editors/emacs-23/default.nix @@ -1,22 +1,11 @@ -{ xawSupport ? true -, xpmSupport ? true -, dbusSupport ? true -, xaw3dSupport ? false -, gtkGUI ? false -, xftSupport ? false -, stdenv, fetchurl, ncurses, x11, libXaw ? null, libXpm ? null, Xaw3d ? null -, pkgconfig ? null, gtk ? null, libXft ? null, dbus ? null -, libpng, libjpeg, libungif, libtiff, librsvg, texinfo -, gconf ? null +{ stdenv, fetchurl, ncurses, x11, libXaw, libXpm, Xaw3d +, pkgconfig, gtk, libXft, dbus, libpng, libjpeg, libungif +, libtiff, librsvg, texinfo, gconf }: -assert xawSupport -> libXaw != null; -assert xpmSupport -> libXpm != null; -assert dbusSupport -> dbus != null; -assert xaw3dSupport -> Xaw3d != null; -assert gtkGUI -> pkgconfig != null && gtk != null; -assert xftSupport -> libXft != null && libpng != null; # libpng = probably a bug -assert stdenv.isDarwin -> xawSupport; # fails to link otherwise +assert (gtk != null) -> (pkgconfig != null); +assert (libXft != null) -> libpng != null; # probably a bug +assert stdenv.isDarwin -> libXaw != null; # fails to link otherwise stdenv.mkDerivation rec { name = "emacs-23.2"; @@ -29,19 +18,12 @@ stdenv.mkDerivation rec { }; buildInputs = [ - ncurses x11 texinfo - (if xawSupport then libXaw else null) - (if xpmSupport then libXpm else null) - (if dbusSupport then dbus else null) - (if xaw3dSupport then Xaw3d else null) - libpng libjpeg libungif libtiff librsvg - ] - ++ (if gtkGUI then [pkgconfig gtk] else []) - ++ (if xftSupport then [libXft] else []) - ++ stdenv.lib.optional (gconf != null) gconf; + ncurses x11 texinfo libXaw Xaw3d libXpm dbus libpng libjpeg libungif + libtiff librsvg gtk (if gtk != null then pkgconfig else null) libXft gconf + ]; configureFlags = - stdenv.lib.optionals gtkGUI [ "--with-x-toolkit=gtk" "--with-xft" ]; + stdenv.lib.optionals (gtk != null) [ "--with-x-toolkit=gtk" "--with-xft" ]; doCheck = true; @@ -68,7 +50,7 @@ stdenv.mkDerivation rec { homepage = http://www.gnu.org/software/emacs/; license = "GPLv3+"; - maintainers = [ stdenv.lib.maintainers.ludo ]; + maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ]; platforms = stdenv.lib.platforms.all; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5df2685fbf7..c199824c789 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7451,17 +7451,17 @@ let gtkGUI = getPkgConfig "emacs" "gtkSupport" true; }; - emacs23 = import ../applications/editors/emacs-23 { - inherit fetchurl stdenv ncurses pkgconfig x11 Xaw3d - libpng libjpeg libungif libtiff librsvg texinfo dbus; - inherit (xlibs) libXaw libXpm libXft; - inherit (gtkLibs) gtk; - gconf = gnome.GConf; # optional GConf support. - xawSupport = stdenv.isDarwin || getPkgConfig "emacs" "xawSupport" false; - xaw3dSupport = getPkgConfig "emacs" "xaw3dSupport" false; - gtkGUI = getPkgConfig "emacs" "gtkSupport" true; - xftSupport = getPkgConfig "emacs" "xftSupport" true; - dbusSupport = getPkgConfig "emacs" "dbusSupport" true; + emacs23 = makeOverridable (import ../applications/editors/emacs-23) { + inherit fetchurl stdenv ncurses pkgconfig x11 libpng libjpeg + libungif libtiff texinfo dbus; + inherit (xlibs) libXpm libXft; + # use override to select the appropriate gui toolkit + libXaw = if stdenv.isDarwin then xlibs.libXaw else null; + Xaw3d = null; + gtk = if stdenv.isDarwin then gtkLibs.gtk else null; + # TODO: these packages don't build on Darwin. + gconf = if stdenv.isDarwin then null else gnome.GConf; + librsvg = if stdenv.isDarwin then null else librsvg; }; emacsSnapshot = lowPrio (import ../applications/editors/emacs-snapshot {