2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, shared-mime-info
|
2021-01-17 10:17:16 +01:00
|
|
|
, autoconf, automake, intltool, libtool, pkg-config, cmake
|
2018-05-13 03:13:58 +02:00
|
|
|
, ruby, librsvg
|
2017-12-05 12:44:30 +01:00
|
|
|
, ncurses, m17n_lib, m17n_db, expat
|
2017-12-05 12:43:58 +01:00
|
|
|
, withAnthy ? true, anthy ? null
|
|
|
|
, withGtk ? true
|
|
|
|
, withGtk2 ? withGtk, gtk2 ? null
|
|
|
|
, withGtk3 ? withGtk, gtk3 ? null
|
|
|
|
, withQt ? true
|
|
|
|
, withQt4 ? withQt, qt4 ? null
|
2018-05-13 03:13:58 +02:00
|
|
|
, withQt5 ? false, qt5 ? null
|
2017-12-22 12:57:32 +01:00
|
|
|
, withLibnotify ? true, libnotify ? null
|
2017-12-05 12:44:42 +01:00
|
|
|
, 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
|
2017-12-05 12:43:58 +01:00
|
|
|
}:
|
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
with lib;
|
2017-12-05 12:43:58 +01:00
|
|
|
|
|
|
|
assert withGtk2 -> gtk2 != null;
|
|
|
|
assert withGtk3 -> gtk3 != null;
|
2018-05-13 03:13:58 +02:00
|
|
|
|
|
|
|
# TODO(@oxij): ./configure can't find both qmakes at the same time
|
|
|
|
# this can be fixed by adding an alias qmake -> qmaka${version} in qmake derivation
|
|
|
|
assert withQt4 -> !withQt5 && qt4 != null;
|
|
|
|
assert withQt5 -> !withQt4 && qt5 != null;
|
|
|
|
|
|
|
|
assert !withQt5; # fails to build with "Makefile.qmake: No such file or directory"
|
|
|
|
|
|
|
|
assert withAnthy -> anthy != null;
|
2017-12-22 12:57:32 +01:00
|
|
|
assert withLibnotify -> libnotify != null;
|
2017-12-05 12:44:42 +01:00
|
|
|
assert withSqlite -> sqlite != null;
|
|
|
|
assert withNetworking -> curl != null && openssl != null;
|
|
|
|
assert withFFI -> libffi != null;
|
|
|
|
assert withMisc -> libeb != null;
|
2014-07-13 08:46:34 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-06-11 19:16:53 +02:00
|
|
|
version = "1.8.8";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "uim";
|
2014-07-13 08:46:34 +02:00
|
|
|
|
2018-05-13 03:13:58 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "uim";
|
|
|
|
repo = "uim";
|
2018-06-11 19:16:53 +02:00
|
|
|
rev = "2c0958c9c505a87e70e344c2192e2e5123c71ea5";
|
2018-05-13 03:13:58 +02:00
|
|
|
fetchSubmodules = true;
|
2018-06-11 19:16:53 +02:00
|
|
|
sha256 = "1hkjxi5r49gcna37m3jvykny5hz9ram4y8a3q7lw4qzr52mz9pdp";
|
2018-05-13 03:13:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-01-17 10:17:16 +01:00
|
|
|
autoconf automake intltool libtool pkg-config cmake
|
2018-05-13 03:13:58 +02:00
|
|
|
|
|
|
|
ruby # used by sigscheme build to generate function tables
|
|
|
|
librsvg # used by uim build to generate png pixmaps from svg
|
|
|
|
];
|
|
|
|
|
2014-07-13 08:46:34 +02:00
|
|
|
buildInputs = [
|
2018-05-13 03:13:58 +02:00
|
|
|
ncurses m17n_lib m17n_db expat
|
2017-12-05 12:43:58 +01:00
|
|
|
]
|
|
|
|
++ optional withAnthy anthy
|
|
|
|
++ optional withGtk2 gtk2
|
|
|
|
++ optional withGtk3 gtk3
|
|
|
|
++ optional withQt4 qt4
|
2018-05-13 03:13:58 +02:00
|
|
|
++ optionals withQt5 [ qt5.qtbase.bin qt5.qtbase.dev ]
|
2017-12-05 12:44:42 +01:00
|
|
|
++ optional withLibnotify libnotify
|
|
|
|
++ optional withSqlite sqlite
|
|
|
|
++ optionals withNetworking [
|
|
|
|
curl openssl
|
|
|
|
]
|
|
|
|
++ optional withFFI libffi
|
|
|
|
++ optional withMisc libeb;
|
2014-07-13 08:46:34 +02:00
|
|
|
|
2018-05-13 03:13:58 +02:00
|
|
|
prePatch = ''
|
|
|
|
patchShebangs *.sh */*.sh */*/*.sh
|
|
|
|
|
|
|
|
# configure sigscheme in maintainer mode or else some function tables won't get autogenerated
|
|
|
|
substituteInPlace configure.ac \
|
|
|
|
--replace "--with-master-pkg=uim --enable-conf=uim" \
|
|
|
|
"--enable-maintainer-mode --with-master-pkg=uim --enable-conf=uim"
|
|
|
|
|
|
|
|
# generate ./configure files
|
|
|
|
(cd sigscheme/libgcroots; ./autogen.sh)
|
|
|
|
(cd sigscheme; ./autogen.sh)
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
2016-02-16 14:46:17 +01:00
|
|
|
patches = [ ./data-hook.patch ];
|
2014-07-13 08:46:34 +02:00
|
|
|
|
|
|
|
configureFlags = [
|
2018-05-13 03:13:58 +02:00
|
|
|
# configure in maintainer mode or else some pixmaps won't get autogenerated
|
|
|
|
# this should imply the above `--enable-maintainer-mode`, but it does not
|
|
|
|
"--enable-maintainer-mode"
|
|
|
|
|
2014-07-13 08:46:34 +02:00
|
|
|
"--enable-pref"
|
|
|
|
"--with-skk"
|
|
|
|
"--with-x"
|
2017-12-05 12:43:58 +01:00
|
|
|
"--with-xft"
|
2017-12-05 12:44:30 +01:00
|
|
|
"--with-expat=${expat.dev}"
|
2017-12-05 12:43:58 +01:00
|
|
|
]
|
|
|
|
++ optional withAnthy "--with-anthy-utf8"
|
|
|
|
++ optional withGtk2 "--with-gtk2"
|
|
|
|
++ optional withGtk3 "--with-gtk3"
|
|
|
|
++ optionals withQt4 [
|
|
|
|
"--with-qt4"
|
|
|
|
"--with-qt4-immodule"
|
2017-12-05 12:44:42 +01:00
|
|
|
]
|
2018-05-13 03:13:58 +02:00
|
|
|
++ optionals withQt5 [
|
|
|
|
"--with-qt5"
|
|
|
|
"--with-qt5-immodule"
|
|
|
|
]
|
2017-12-05 12:44:42 +01:00
|
|
|
++ 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]
|
2014-07-13 08:46:34 +02:00
|
|
|
|
2019-03-25 23:18:19 +01:00
|
|
|
# TODO: fix this in librsvg/glib later
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/57027#issuecomment-475461733
|
|
|
|
preBuild = ''
|
|
|
|
export XDG_DATA_DIRS="${shared-mime-info}/share"
|
|
|
|
'';
|
|
|
|
|
2014-07-13 08:46:34 +02:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-05-13 03:13:58 +02:00
|
|
|
homepage = src.meta.homepage;
|
2014-07-13 08:46:34 +02:00
|
|
|
description = "A multilingual input method framework";
|
2017-12-05 12:45:11 +01:00
|
|
|
license = licenses.bsd3;
|
2018-05-13 03:13:58 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
broken = stdenv.hostPlatform.isAarch64; # fails to build libgcroots (not supported on aarch64)
|
2017-12-05 12:45:11 +01:00
|
|
|
maintainers = with maintainers; [ ericsagnes oxij ];
|
2014-07-13 08:46:34 +02:00
|
|
|
};
|
|
|
|
}
|