1{ stdenv, fetchurl, fetchFromGitHub, autoreconfHook, glib, db, pkgconfig }:
2
3let
4 modelData = fetchurl {
5 url = "mirror://sourceforge/libpinyin/models/model14.text.tar.gz";
6 sha256 = "0qqk30nflj07zjhs231c95ln4yj4ipzwxxiwrxazrg4hb8bhypqq";
7 };
8in
9stdenv.mkDerivation rec {
10 name = "libpinyin-${version}";
11 version = "2.1.91";
12
13 nativeBuildInputs = [ autoreconfHook glib db pkgconfig ];
14
15 postUnpack = ''
16 tar -xzf ${modelData} -C $sourceRoot/data
17 '';
18
19 src = fetchFromGitHub {
20 owner = "libpinyin";
21 repo = "libpinyin";
22 rev = version;
23 sha256 = "0jbvn65p3zh0573hh27aasd3qly5anyfi8jnps2dxi0my09wbrq3";
24 };
25
26 meta = with stdenv.lib; {
27 description = "Library for intelligent sentence-based Chinese pinyin input method";
28 homepage = https://sourceforge.net/projects/libpinyin;
29 license = licenses.gpl2;
30 maintainers = with maintainers; [ ericsagnes ];
31 platforms = platforms.linux;
32 };
33}