26 # Was never enabled in the history of this package and is not needed by any
27 # dependent package, hence disabled to save up closure size.
35 withNetworking ? true,
41 # Things that are clearly an overkill to be enabled by default
46 assert withGtk2 -> gtk2 != null;
47 assert withGtk3 -> gtk3 != null;
49 assert withAnthy -> anthy != null;
50 assert withLibnotify -> libnotify != null;
51 assert withSqlite -> sqlite != null;
52 assert withNetworking -> curl != null && openssl != null;
53 assert withFFI -> libffi != null;
54 assert withMisc -> libeb != null;
56 stdenv.mkDerivation rec {
60 src = fetchFromGitHub {
63 rev = "2c0958c9c505a87e70e344c2192e2e5123c71ea5";
64 fetchSubmodules = true;
65 sha256 = "1hkjxi5r49gcna37m3jvykny5hz9ram4y8a3q7lw4qzr52mz9pdp";
77 ruby # used by sigscheme build to generate function tables
78 librsvg # used by uim build to generate png pixmaps from svg
80 ++ lib.optionals withQt5 [
91 ++ lib.optional withAnthy anthy
92 ++ lib.optional withGtk2 gtk2
93 ++ lib.optional withGtk3 gtk3
94 ++ lib.optionals withQt5 [
98 ++ lib.optional withLibnotify libnotify
99 ++ lib.optional withSqlite sqlite
100 ++ lib.optionals withNetworking [
104 ++ lib.optional withFFI libffi
105 ++ lib.optional withMisc libeb;
108 patchShebangs *.sh */*.sh */*/*.sh
110 # configure sigscheme in maintainer mode or else some function tables won't get autogenerated
111 substituteInPlace configure.ac \
112 --replace "--with-master-pkg=uim --enable-conf=uim" \
113 "--enable-maintainer-mode --with-master-pkg=uim --enable-conf=uim"
115 # generate ./configure files
116 (cd sigscheme/libgcroots; ./autogen.sh)
117 (cd sigscheme; ./autogen.sh)
124 # Pull upstream fix for -fno-common toolchains
125 # https://github.com/uim/libgcroots/pull/4
127 name = "libgcroots-fno-common.patch";
128 url = "https://github.com/uim/libgcroots/commit/7e39241344ad0663409e836560ae6b5eb231e1fc.patch";
129 sha256 = "0iifcl5lk8bvl0cflm47gkymg88aiwzj0gxh2aj3mqlyhvyx78nz";
130 # Patch comes from git submodule. Relocate as:
131 # a/include/private/gc_priv.h -> a/sigscheme/libgcroots/include/private/gc_priv.h
133 extraPrefix = "sigscheme/libgcroots/";
139 # configure in maintainer mode or else some pixmaps won't get autogenerated
140 # this should imply the above `--enable-maintainer-mode`, but it does not
141 "--enable-maintainer-mode"
147 "--with-expat=${expat.dev}"
149 ++ lib.optional withAnthy "--with-anthy-utf8"
150 ++ lib.optional withGtk2 "--with-gtk2"
151 ++ lib.optional withGtk3 "--with-gtk3"
152 ++ lib.optionals withQt5 [
154 "--with-qt5-immodule"
156 ++ lib.optional withLibnotify "--enable-notify=libnotify"
157 ++ lib.optional withSqlite "--with-sqlite3"
158 ++ lib.optionals withNetworking [
160 "--with-openssl-dir=${openssl.dev}"
162 ++ lib.optional withFFI "--with-ffi"
163 ++ lib.optional withMisc "--with-eb";
165 # TODO: things in `./configure --help`, but not in nixpkgs
166 #--with-canna Use Canna [default=no]
167 #--with-wnn Build with libwnn [default=no]
168 #--with-mana Build a plugin for Mana [default=yes]
169 #--with-prime Build a plugin for PRIME [default=yes]
170 #--with-sj3 Use SJ3 [default=no]
171 #--with-osx-dcs Build with OS X Dictionary Services [default=no]
173 # TODO: fix this in librsvg/glib later
174 # https://github.com/NixOS/nixpkgs/pull/57027#issuecomment-475461733
176 export XDG_DATA_DIRS="${shared-mime-info}/share"
179 dontUseCmakeConfigure = true;
182 homepage = src.meta.homepage;
183 description = "Multilingual input method framework";
184 license = licenses.bsd3;
185 platforms = platforms.unix;
186 maintainers = with maintainers; [