<commit_before>{ stdenv, fetchurl, intltool, pkgconfig, cmake
, ncurses, m17n_lib, m17n_db, expat
, withAnthy ? true, anthy ? null
, withGtk ? true
, withGtk2 ? withGtk, gtk2 ? null
, withGtk3 ? withGtk, gtk3 ? null
, withQt ? true
, withQt4 ? withQt, qt4 ? null
, withKde ? withQt
, withKde4 ? withKde && withQt4, kdelibs4 ? null, automoc4 ? null
, withKNotify4 ? withKde4
, withLibnotify ? !withKNotify4, libnotify ? null
, withSqlite ? true, sqlite ? null
, withNetworking ? true, curl ? null, openssl ? null
, withFFI ? true, libffi ? null

# Things that are clearly an overkill to be enabled by default
, withMisc ? false, libeb ? null
}:

with stdenv.lib;

assert withAnthy -> anthy != null;
assert withGtk2 -> gtk2 != null;
assert withGtk3 -> gtk3 != null;
assert withQt4 -> qt4 != null;
assert withKde4 -> withQt4 && kdelibs4 != null && automoc4 != null;
assert withKNotify4 -> withKde4 && !withLibnotify;
assert withLibnotify -> !withKNotify4 && libnotify != null;
assert withSqlite -> sqlite != null;
assert withNetworking -> curl != null && openssl != null;
assert withFFI -> libffi != null;
assert withMisc -> libeb != null;

stdenv.mkDerivation rec {
  version = "1.8.6";
  name = "uim-${version}";

  buildInputs = [
    intltool
    pkgconfig
    ncurses
    cmake
    m17n_lib
    m17n_db
    expat
  ]
  ++ optional withAnthy anthy
  ++ optional withGtk2 gtk2
  ++ optional withGtk3 gtk3
  ++ optional withQt4 qt4
  ++ optionals withKde4 [
    kdelibs4 automoc4
  ]
  ++ optional withLibnotify libnotify
  ++ optional withSqlite sqlite
  ++ optionals withNetworking [
    curl openssl
  ]
  ++ optional withFFI libffi
  ++ optional withMisc libeb;

  patches = [ ./data-hook.patch ];

  configureFlags = [
    "--enable-pref"
    "--with-skk"
    "--with-x"
    "--with-xft"
    "--with-expat=${expat.dev}"
  ]
  ++ optional withAnthy "--with-anthy-utf8"
  ++ optional withGtk2 "--with-gtk2"
  ++ optional withGtk3 "--with-gtk3"
  ++ optionals withQt4 [
    "--with-qt4"
    "--with-qt4-immodule"
  ]
  ++ optional withKde4 "--enable-kde4-applet"
  ++ optional withKNotify4 "--enable-notify=knotify4"
  ++ optional withLibnotify "--enable-notify=libnotify"
  ++ optional withSqlite "--with-sqlite3"
  ++ optionals withNetworking [
    "--with-curl"
    "--with-openssl-dir=${openssl.dev}"
  ]
  ++ optional withFFI "--with-ffi"
  ++ optional withMisc "--with-eb";

  # TODO: things in `./configure --help`, but not in nixpkgs
  #--with-canna            Use Canna [default=no]
  #--with-wnn              Build with libwnn [default=no]
  #--with-mana             Build a plugin for Mana [default=yes]
  #--with-prime            Build a plugin for PRIME [default=yes]
  #--with-sj3              Use SJ3 [default=no]
  #--with-osx-dcs          Build with OS X Dictionary Services [default=no]

  dontUseCmakeConfigure = true;

  src = fetchurl {
    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uim/uim-${version}.tar.bz2";
    sha1 = "43b9dbdead6797880e6cfc9c032ecb2d37d42777";
  };

  meta = with stdenv.lib; {
    homepage    = "https://github.com/uim/uim";
    description = "A multilingual input method framework";
    license     = stdenv.lib.licenses.bsd3;
    platforms   = stdenv.lib.platforms.linux;
    maintainers = with maintainers; [ ericsagnes ];
  };
}
<commit_msg>uim: prefer libnotify instead of knotify because it works with both GTK and QT<commit_after>{ stdenv, fetchurl, intltool, pkgconfig, cmake
, ncurses, m17n_lib, m17n_db, expat
, withAnthy ? true, anthy ? null
, withGtk ? true
, withGtk2 ? withGtk, gtk2 ? null
, withGtk3 ? withGtk, gtk3 ? null
, withQt ? true
, withQt4 ? withQt, qt4 ? null
, withKde ? withQt
, withKde4 ? withKde && withQt4, kdelibs4 ? null, automoc4 ? null
, withKNotify4 ? false
, withLibnotify ? !withKNotify4, libnotify ? null
, withSqlite ? true, sqlite ? null
, withNetworking ? true, curl ? null, openssl ? null
, withFFI ? true, libffi ? null

# Things that are clearly an overkill to be enabled by default
, withMisc ? false, libeb ? null
}:

with stdenv.lib;

assert withAnthy -> anthy != null;
assert withGtk2 -> gtk2 != null;
assert withGtk3 -> gtk3 != null;
assert withQt4 -> qt4 != null;
assert withKde4 -> withQt4 && kdelibs4 != null && automoc4 != null;
assert withKNotify4 -> withKde4 && !withLibnotify;
assert withLibnotify -> !withKNotify4 && libnotify != null;
assert withSqlite -> sqlite != null;
assert withNetworking -> curl != null && openssl != null;
assert withFFI -> libffi != null;
assert withMisc -> libeb != null;

stdenv.mkDerivation rec {
  version = "1.8.6";
  name = "uim-${version}";

  buildInputs = [
    intltool
    pkgconfig
    ncurses
    cmake
    m17n_lib
    m17n_db
    expat
  ]
  ++ optional withAnthy anthy
  ++ optional withGtk2 gtk2
  ++ optional withGtk3 gtk3
  ++ optional withQt4 qt4
  ++ optionals withKde4 [
    kdelibs4 automoc4
  ]
  ++ optional withLibnotify libnotify
  ++ optional withSqlite sqlite
  ++ optionals withNetworking [
    curl openssl
  ]
  ++ optional withFFI libffi
  ++ optional withMisc libeb;

  patches = [ ./data-hook.patch ];

  configureFlags = [
    "--enable-pref"
    "--with-skk"
    "--with-x"
    "--with-xft"
    "--with-expat=${expat.dev}"
  ]
  ++ optional withAnthy "--with-anthy-utf8"
  ++ optional withGtk2 "--with-gtk2"
  ++ optional withGtk3 "--with-gtk3"
  ++ optionals withQt4 [
    "--with-qt4"
    "--with-qt4-immodule"
  ]
  ++ optional withKde4 "--enable-kde4-applet"
  ++ optional withKNotify4 "--enable-notify=knotify4"
  ++ optional withLibnotify "--enable-notify=libnotify"
  ++ optional withSqlite "--with-sqlite3"
  ++ optionals withNetworking [
    "--with-curl"
    "--with-openssl-dir=${openssl.dev}"
  ]
  ++ optional withFFI "--with-ffi"
  ++ optional withMisc "--with-eb";

  # TODO: things in `./configure --help`, but not in nixpkgs
  #--with-canna            Use Canna [default=no]
  #--with-wnn              Build with libwnn [default=no]
  #--with-mana             Build a plugin for Mana [default=yes]
  #--with-prime            Build a plugin for PRIME [default=yes]
  #--with-sj3              Use SJ3 [default=no]
  #--with-osx-dcs          Build with OS X Dictionary Services [default=no]

  dontUseCmakeConfigure = true;

  src = fetchurl {
    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uim/uim-${version}.tar.bz2";
    sha1 = "43b9dbdead6797880e6cfc9c032ecb2d37d42777";
  };

  meta = with stdenv.lib; {
    homepage    = "https://github.com/uim/uim";
    description = "A multilingual input method framework";
    license     = stdenv.lib.licenses.bsd3;
    platforms   = stdenv.lib.platforms.linux;
    maintainers = with maintainers; [ ericsagnes ];
  };
}

{'fraction_non_alphanumeric': 0.13439263439263438, 'fraction_numerical': 0.02598752598752599, 'mean_word_length': 3.0426170468187275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4612408', 'n_tokens_mistral': 2492, 'n_tokens_neox': 2421, 'n_words': 585}