<commit_before>{ stdenv, fetchurl, ncurses, x11, libXaw, libXpm, Xaw3d
, pkgconfig, gtk, libXft, dbus, libpng, libjpeg, libungif
, libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, openssl
, alsaLib, cairo
, withX ? !stdenv.isDarwin, withGTK ? true
}:

assert (libXft != null) -> libpng != null;	# probably a bug
assert stdenv.isDarwin -> libXaw != null;	# fails to link otherwise

stdenv.mkDerivation rec {
  name = "emacs-24.3";

  builder = ./builder.sh;

  src = fetchurl {
    url    = "mirror://gnu/emacs/${name}.tar.xz";
    sha256 = "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh";
  };

  patches = [ ./darwin-new-sections.patch ];

  buildInputs =
    [ ncurses gconf libxml2 openssl 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 gconf ]
    ++ stdenv.lib.optional (stdenv.isDarwin && withX) cairo;

  configureFlags =
    ( if withX && withGTK then
        [ "--with-x-toolkit=gtk" "--with-xft"]<commit_msg>Emacs: Use gnutls instead of OpenSSL.<commit_after>{ stdenv, fetchurl, ncurses, x11, libXaw, libXpm, Xaw3d
, pkgconfig, gtk, libXft, dbus, libpng, libjpeg, libungif
, libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls
, alsaLib, cairo
, withX ? !stdenv.isDarwin, withGTK ? true
}:

assert (libXft != null) -> libpng != null;	# probably a bug
assert stdenv.isDarwin -> libXaw != null;	# fails to link otherwise

stdenv.mkDerivation rec {
  name = "emacs-24.3";

  builder = ./builder.sh;

  src = fetchurl {
    url    = "mirror://gnu/emacs/${name}.tar.xz";
    sha256 = "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh";
  };

  patches = [ ./darwin-new-sections.patch ];

  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 gconf ]
    ++ stdenv.lib.optional (stdenv.isDarwin && withX) cairo;

  configureFlags =
    ( if withX && withGTK then
        [ "--with-x-toolkit=gtk" "--with-xft"]
{'fraction_non_alphanumeric': 0.12454873646209386, 'fraction_numerical': 0.02527075812274368, 'mean_word_length': 3.515274949083503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1207293', 'n_tokens_mistral': 931, 'n_tokens_neox': 882, 'n_words': 194}