2022-06-26 10:26:21 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, shared-mime-info
|
2021-02-05 17:12:51 +00:00
|
|
|
, autoconf, automake, intltool, libtool, pkg-config, cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
, ruby, librsvg
|
|
|
|
, ncurses, m17n_lib, m17n_db, expat
|
|
|
|
, withAnthy ? true, anthy ? null
|
|
|
|
, withGtk ? true
|
|
|
|
, withGtk2 ? withGtk, gtk2 ? null
|
|
|
|
, withGtk3 ? withGtk, gtk3 ? null
|
2023-10-09 19:29:22 +00:00
|
|
|
# Was never enabled in the history of this package and is not needed by any
|
|
|
|
# dependent package, hence disabled to save up closure size.
|
|
|
|
, withQt ? false
|
|
|
|
, withQt5 ? withQt, qt5 ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, withLibnotify ? true, 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
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert withGtk2 -> gtk2 != null;
|
|
|
|
assert withGtk3 -> gtk3 != null;
|
|
|
|
|
|
|
|
assert withAnthy -> anthy != null;
|
|
|
|
assert withLibnotify -> 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.8";
|
|
|
|
pname = "uim";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "uim";
|
|
|
|
repo = "uim";
|
|
|
|
rev = "2c0958c9c505a87e70e344c2192e2e5123c71ea5";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
sha256 = "1hkjxi5r49gcna37m3jvykny5hz9ram4y8a3q7lw4qzr52mz9pdp";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
autoconf automake intltool libtool pkg-config cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
ruby # used by sigscheme build to generate function tables
|
|
|
|
librsvg # used by uim build to generate png pixmaps from svg
|
2023-10-09 19:29:22 +00:00
|
|
|
] ++ lib.optionals withQt5 [
|
|
|
|
qt5.wrapQtAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ncurses m17n_lib m17n_db expat
|
|
|
|
]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional withAnthy anthy
|
|
|
|
++ lib.optional withGtk2 gtk2
|
|
|
|
++ lib.optional withGtk3 gtk3
|
2023-10-09 19:29:22 +00:00
|
|
|
++ lib.optionals withQt5 [ qt5.qtbase qt5.qtx11extras ]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional withLibnotify libnotify
|
|
|
|
++ lib.optional withSqlite sqlite
|
|
|
|
++ lib.optionals withNetworking [
|
2020-04-24 23:36:52 +00:00
|
|
|
curl openssl
|
|
|
|
]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional withFFI libffi
|
|
|
|
++ lib.optional withMisc libeb;
|
2020-04-24 23:36:52 +00: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
|
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
patches = [
|
|
|
|
./data-hook.patch
|
|
|
|
|
|
|
|
# Pull upstream fix for -fno-common toolchains
|
|
|
|
# https://github.com/uim/libgcroots/pull/4
|
|
|
|
(fetchpatch {
|
|
|
|
name = "libgcroots-fno-common.patch";
|
|
|
|
url = "https://github.com/uim/libgcroots/commit/7e39241344ad0663409e836560ae6b5eb231e1fc.patch";
|
|
|
|
sha256 = "0iifcl5lk8bvl0cflm47gkymg88aiwzj0gxh2aj3mqlyhvyx78nz";
|
|
|
|
# Patch comes from git submodule. Relocate as:
|
|
|
|
# a/include/private/gc_priv.h -> a/sigscheme/libgcroots/include/private/gc_priv.h
|
|
|
|
stripLen = 1;
|
|
|
|
extraPrefix = "sigscheme/libgcroots/";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
# 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"
|
|
|
|
|
|
|
|
"--enable-pref"
|
|
|
|
"--with-skk"
|
|
|
|
"--with-x"
|
|
|
|
"--with-xft"
|
|
|
|
"--with-expat=${expat.dev}"
|
|
|
|
]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional withAnthy "--with-anthy-utf8"
|
|
|
|
++ lib.optional withGtk2 "--with-gtk2"
|
|
|
|
++ lib.optional withGtk3 "--with-gtk3"
|
|
|
|
++ lib.optionals withQt5 [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-qt5"
|
|
|
|
"--with-qt5-immodule"
|
|
|
|
]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional withLibnotify "--enable-notify=libnotify"
|
|
|
|
++ lib.optional withSqlite "--with-sqlite3"
|
|
|
|
++ lib.optionals withNetworking [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-curl"
|
|
|
|
"--with-openssl-dir=${openssl.dev}"
|
|
|
|
]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional withFFI "--with-ffi"
|
|
|
|
++ lib.optional withMisc "--with-eb";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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]
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = src.meta.homepage;
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Multilingual input method framework";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ ericsagnes oxij ];
|
|
|
|
};
|
|
|
|
}
|