@@ -1,5 +1,36 @@
1−{stdenv, fetchurl, intltool, pkgconfig, qt4, gtk2, gtk3, kdelibs4, ncurses,
2− cmake, anthy, automoc4, m17n_lib, m17n_db}:
1+{ stdenv, fetchurl, intltool, pkgconfig, cmake
2+, ncurses, m17n_lib, m17n_db, expat
3+, withAnthy ? true, anthy ? null
4+, withGtk ? true
5+, withGtk2 ? withGtk, gtk2 ? null
6+, withGtk3 ? withGtk, gtk3 ? null
7+, withQt ? true
8+, withQt4 ? withQt, qt4 ? null
9+, withKde ? withQt
10+, withKde4 ? withKde && withQt4, kdelibs4 ? null, automoc4 ? null
11+, withKNotify4 ? false
12+, withLibnotify ? !withKNotify4, libnotify ? null
13+, withSqlite ? true, sqlite ? null
14+, withNetworking ? true, curl ? null, openssl ? null
15+, withFFI ? true, libffi ? null
16+
17+# Things that are clearly an overkill to be enabled by default
18+, withMisc ? false, libeb ? null
19+}:
20+
21+with stdenv.lib;
22+
23+assert withAnthy -> anthy != null;
24+assert withGtk2 -> gtk2 != null;
25+assert withGtk3 -> gtk3 != null;
26+assert withQt4 -> qt4 != null;
27+assert withKde4 -> withQt4 && kdelibs4 != null && automoc4 != null;
28+assert withKNotify4 -> withKde4 && !withLibnotify;
29+assert withLibnotify -> !withKNotify4 && libnotify != null;
30+assert withSqlite -> sqlite != null;
31+assert withNetworking -> curl != null && openssl != null;
32+assert withFFI -> libffi != null;
33+assert withMisc -> libeb != null;
334
435stdenv.mkDerivation rec {
536 version = "1.8.6";
@@ -8,32 +39,61 @@ stdenv.mkDerivation rec {
839 buildInputs = [
940 intltool
1041 pkgconfig
11− qt4
12− gtk2
13− gtk3
14− kdelibs4
1542 ncurses
1643 cmake
17− anthy
18− automoc4
1944 m17n_lib
2045 m17n_db
21− ];
46+ expat
47+ ]
48+ ++ optional withAnthy anthy
49+ ++ optional withGtk2 gtk2
50+ ++ optional withGtk3 gtk3
51+ ++ optional withQt4 qt4
52+ ++ optionals withKde4 [
53+ kdelibs4 automoc4
54+ ]
55+ ++ optional withLibnotify libnotify
56+ ++ optional withSqlite sqlite
57+ ++ optionals withNetworking [
58+ curl openssl
59+ ]
60+ ++ optional withFFI libffi
61+ ++ optional withMisc libeb;
2262
2363 patches = [ ./data-hook.patch ];
2464
2565 configureFlags = [
26− "--with-gtk2"
27− "--with-gtk3"
28− "--enable-kde4-applet"
29− "--enable-notify=knotify4"
3066 "--enable-pref"
31− "--with-qt4"
32− "--with-qt4-immodule"
3367 "--with-skk"
3468 "--with-x"
35− "--with-anthy-utf8"
36− ];
69+ "--with-xft"
70+ "--with-expat=${expat.dev}"
71+ ]
72+ ++ optional withAnthy "--with-anthy-utf8"
73+ ++ optional withGtk2 "--with-gtk2"
74+ ++ optional withGtk3 "--with-gtk3"
75+ ++ optionals withQt4 [
76+ "--with-qt4"
77+ "--with-qt4-immodule"
78+ ]
79+ ++ optional withKde4 "--enable-kde4-applet"
80+ ++ optional withKNotify4 "--enable-notify=knotify4"
81+ ++ optional withLibnotify "--enable-notify=libnotify"
82+ ++ optional withSqlite "--with-sqlite3"
83+ ++ optionals withNetworking [
84+ "--with-curl"
85+ "--with-openssl-dir=${openssl.dev}"
86+ ]
87+ ++ optional withFFI "--with-ffi"
88+ ++ optional withMisc "--with-eb";
89+
90+ # TODO: things in `./configure --help`, but not in nixpkgs
91+ #--with-canna Use Canna [default=no]
92+ #--with-wnn Build with libwnn [default=no]
93+ #--with-mana Build a plugin for Mana [default=yes]
94+ #--with-prime Build a plugin for PRIME [default=yes]
95+ #--with-sj3 Use SJ3 [default=no]
96+ #--with-osx-dcs Build with OS X Dictionary Services [default=no]
3797
3898 dontUseCmakeConfigure = true;
3999
@@ -45,8 +105,8 @@ stdenv.mkDerivation rec {
45105 meta = with stdenv.lib; {
46106 homepage = "https://github.com/uim/uim";
47107 description = "A multilingual input method framework";
48− license = stdenv.lib.licenses.bsd3;
49− platforms = stdenv.lib.platforms.linux;
50− maintainers = with maintainers; [ ericsagnes ];
108+ license = licenses.bsd3;
109+ platforms = platforms.linux;
110+ maintainers = with maintainers; [ ericsagnes oxij ];
51111 };
52112}