about summary refs log tree commit diff
path: root/pkgs/tools/inputmethods
diff options
context:
space:
mode:
authorJoachim F <joachifm@users.noreply.github.com>2017-12-07 21:33:08 +0000
committerGitHub <noreply@github.com>2017-12-07 21:33:08 +0000
commite91f5f91447be9d5132abda11aed69f70a02bd10 (patch)
treec6d848a44379449e5c651e6d4f5ed6d2e52334f2 /pkgs/tools/inputmethods
parent1541211c31672a70de67dcb1b0b56bdb5e857e70 (diff)
parentceb46d5f9df59f84a880c4b6154466517744d7b1 (diff)
downloadnixlib-e91f5f91447be9d5132abda11aed69f70a02bd10.tar
nixlib-e91f5f91447be9d5132abda11aed69f70a02bd10.tar.gz
nixlib-e91f5f91447be9d5132abda11aed69f70a02bd10.tar.bz2
nixlib-e91f5f91447be9d5132abda11aed69f70a02bd10.tar.lz
nixlib-e91f5f91447be9d5132abda11aed69f70a02bd10.tar.xz
nixlib-e91f5f91447be9d5132abda11aed69f70a02bd10.tar.zst
nixlib-e91f5f91447be9d5132abda11aed69f70a02bd10.zip
Merge pull request #32339 from oxij/pkg/uim
uim: more options
Diffstat (limited to 'pkgs/tools/inputmethods')
-rw-r--r--pkgs/tools/inputmethods/uim/default.nix100
1 files changed, 80 insertions, 20 deletions
diff --git a/pkgs/tools/inputmethods/uim/default.nix b/pkgs/tools/inputmethods/uim/default.nix
index 3f37c1a2ab0c..bba55acc0608 100644
--- a/pkgs/tools/inputmethods/uim/default.nix
+++ b/pkgs/tools/inputmethods/uim/default.nix
@@ -1,5 +1,36 @@
-{stdenv, fetchurl, intltool, pkgconfig, qt4, gtk2, gtk3, kdelibs4, ncurses,
- cmake, anthy, automoc4, m17n_lib, m17n_db}:
+{ 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";
@@ -8,32 +39,61 @@ stdenv.mkDerivation rec {
   buildInputs = [
     intltool
     pkgconfig
-    qt4
-    gtk2
-    gtk3
-    kdelibs4
     ncurses
     cmake
-    anthy
-    automoc4
     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 = [
-    "--with-gtk2"
-    "--with-gtk3"
-    "--enable-kde4-applet"
-    "--enable-notify=knotify4"
     "--enable-pref"
-    "--with-qt4"
-    "--with-qt4-immodule"
     "--with-skk"
     "--with-x"
-    "--with-anthy-utf8"
-  ];
+    "--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;
 
@@ -45,8 +105,8 @@ stdenv.mkDerivation rec {
   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 ];
+    license     = licenses.bsd3;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ ericsagnes oxij ];
   };
 }