@@ -1,5 +1,22 @@
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
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+}:
12+
13+with stdenv.lib;
14+
15+assert withAnthy -> anthy != null;
16+assert withGtk2 -> gtk2 != null;
17+assert withGtk3 -> gtk3 != null;
18+assert withQt4 -> qt4 != null;
19+assert withKde4 -> withQt4 && kdelibs4 != null && automoc4 != null;
320
421stdenv.mkDerivation rec {
522 version = "1.8.6";
@@ -8,31 +25,36 @@ stdenv.mkDerivation rec {
825 buildInputs = [
926 intltool
1027 pkgconfig
11− qt4
12− gtk2
13− gtk3
14− kdelibs4
1528 ncurses
1629 cmake
17− anthy
18− automoc4
1930 m17n_lib
2031 m17n_db
32+ ]
33+ ++ optional withAnthy anthy
34+ ++ optional withGtk2 gtk2
35+ ++ optional withGtk3 gtk3
36+ ++ optional withQt4 qt4
37+ ++ optionals withKde4 [
38+ kdelibs4 automoc4
2139 ];
2240
2341 patches = [ ./data-hook.patch ];
2442
2543 configureFlags = [
26− "--with-gtk2"
27− "--with-gtk3"
28− "--enable-kde4-applet"
29− "--enable-notify=knotify4"
3044 "--enable-pref"
31− "--with-qt4"
32− "--with-qt4-immodule"
3345 "--with-skk"
3446 "--with-x"
35− "--with-anthy-utf8"
47+ "--with-xft"
48+ ]
49+ ++ optional withAnthy "--with-anthy-utf8"
50+ ++ optional withGtk2 "--with-gtk2"
51+ ++ optional withGtk3 "--with-gtk3"
52+ ++ optionals withQt4 [
53+ "--with-qt4"
54+ "--with-qt4-immodule"
55+ ] ++ optionals withKde4 [
56+ "--enable-kde4-applet"
57+ "--enable-notify=knotify4"
3658 ];
3759
3860 dontUseCmakeConfigure = true;