From 2d6c56e457b59b160e40c8dd8efb8bca675655e0 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 5 Dec 2017 11:43:58 +0000 Subject: [PATCH 1/5] uim: make most things optional --- pkgs/tools/inputmethods/uim/default.nix | 52 ++++++++++++++++++------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/pkgs/tools/inputmethods/uim/default.nix b/pkgs/tools/inputmethods/uim/default.nix index 3f37c1a2ab0c..5a13eccb9779 100644 --- a/pkgs/tools/inputmethods/uim/default.nix +++ b/pkgs/tools/inputmethods/uim/default.nix @@ -1,5 +1,22 @@ -{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 +, 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 +}: + +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; stdenv.mkDerivation rec { version = "1.8.6"; @@ -8,31 +25,36 @@ stdenv.mkDerivation rec { buildInputs = [ intltool pkgconfig - qt4 - gtk2 - gtk3 - kdelibs4 ncurses cmake - anthy - automoc4 m17n_lib m17n_db + ] + ++ optional withAnthy anthy + ++ optional withGtk2 gtk2 + ++ optional withGtk3 gtk3 + ++ optional withQt4 qt4 + ++ optionals withKde4 [ + kdelibs4 automoc4 ]; 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" + ] + ++ optional withAnthy "--with-anthy-utf8" + ++ optional withGtk2 "--with-gtk2" + ++ optional withGtk3 "--with-gtk3" + ++ optionals withQt4 [ + "--with-qt4" + "--with-qt4-immodule" + ] ++ optionals withKde4 [ + "--enable-kde4-applet" + "--enable-notify=knotify4" ]; dontUseCmakeConfigure = true; From 8c877804e3d5c07a82f1e913162af3eeaf309508 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 5 Dec 2017 11:44:30 +0000 Subject: [PATCH 2/5] uim: use system expat --- pkgs/tools/inputmethods/uim/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/inputmethods/uim/default.nix b/pkgs/tools/inputmethods/uim/default.nix index 5a13eccb9779..b383b4739076 100644 --- a/pkgs/tools/inputmethods/uim/default.nix +++ b/pkgs/tools/inputmethods/uim/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, intltool, pkgconfig, cmake -, ncurses, m17n_lib, m17n_db +, ncurses, m17n_lib, m17n_db, expat , withAnthy ? true, anthy ? null , withGtk ? true , withGtk2 ? withGtk, gtk2 ? null @@ -29,6 +29,7 @@ stdenv.mkDerivation rec { cmake m17n_lib m17n_db + expat ] ++ optional withAnthy anthy ++ optional withGtk2 gtk2 @@ -45,6 +46,7 @@ stdenv.mkDerivation rec { "--with-skk" "--with-x" "--with-xft" + "--with-expat=${expat.dev}" ] ++ optional withAnthy "--with-anthy-utf8" ++ optional withGtk2 "--with-gtk2" From b1186bcb4722fa42af4736fe8fc254948d20d3c9 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 5 Dec 2017 11:44:42 +0000 Subject: [PATCH 3/5] uim: add even more options --- pkgs/tools/inputmethods/uim/default.nix | 46 ++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/inputmethods/uim/default.nix b/pkgs/tools/inputmethods/uim/default.nix index b383b4739076..22f6a761c6a1 100644 --- a/pkgs/tools/inputmethods/uim/default.nix +++ b/pkgs/tools/inputmethods/uim/default.nix @@ -8,6 +8,14 @@ , 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; @@ -17,6 +25,12 @@ 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"; @@ -37,7 +51,14 @@ stdenv.mkDerivation rec { ++ 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 ]; @@ -54,10 +75,25 @@ stdenv.mkDerivation rec { ++ optionals withQt4 [ "--with-qt4" "--with-qt4-immodule" - ] ++ optionals withKde4 [ - "--enable-kde4-applet" - "--enable-notify=knotify4" - ]; + ] + ++ 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; From 83713d4277c41140178f7a56ea06249fc8ef80f0 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 5 Dec 2017 11:44:55 +0000 Subject: [PATCH 4/5] uim: prefer libnotify instead of knotify because it works with both GTK and QT --- pkgs/tools/inputmethods/uim/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/inputmethods/uim/default.nix b/pkgs/tools/inputmethods/uim/default.nix index 22f6a761c6a1..58c3a8a58e60 100644 --- a/pkgs/tools/inputmethods/uim/default.nix +++ b/pkgs/tools/inputmethods/uim/default.nix @@ -8,7 +8,7 @@ , withQt4 ? withQt, qt4 ? null , withKde ? withQt , withKde4 ? withKde && withQt4, kdelibs4 ? null, automoc4 ? null -, withKNotify4 ? withKde4 +, withKNotify4 ? false , withLibnotify ? !withKNotify4, libnotify ? null , withSqlite ? true, sqlite ? null , withNetworking ? true, curl ? null, openssl ? null From ceb46d5f9df59f84a880c4b6154466517744d7b1 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 5 Dec 2017 11:45:11 +0000 Subject: [PATCH 5/5] uim: cleanup meta, add me to maintainers --- pkgs/tools/inputmethods/uim/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/inputmethods/uim/default.nix b/pkgs/tools/inputmethods/uim/default.nix index 58c3a8a58e60..bba55acc0608 100644 --- a/pkgs/tools/inputmethods/uim/default.nix +++ b/pkgs/tools/inputmethods/uim/default.nix @@ -105,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 ]; }; }