2019-08-12 05:00:17 +00:00
|
|
|
{ stdenv, fetchurl, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, glib
|
|
|
|
, db
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2019-08-12 05:00:17 +00:00
|
|
|
}:
|
2016-03-26 17:08:53 +00:00
|
|
|
|
2016-10-01 01:52:01 +00:00
|
|
|
let
|
|
|
|
modelData = fetchurl {
|
2019-08-12 05:00:17 +00:00
|
|
|
url = "mirror://sourceforge/libpinyin/models/model17.text.tar.gz";
|
|
|
|
sha256 = "1kb2nswpsqlk2qm5jr7vqcp97f2dx7nvpk24lxjs1g12n252f5z0";
|
2016-10-01 01:52:01 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "libpinyin";
|
2019-08-12 05:00:17 +00:00
|
|
|
version = "2.3.0";
|
2016-10-01 01:52:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libpinyin";
|
|
|
|
repo = "libpinyin";
|
|
|
|
rev = version;
|
2019-08-12 05:00:17 +00:00
|
|
|
sha256 = "14fkpp16s5k0pbw5wwd24pqr0qbdjgbl90n9aqwx72m03n7an40l";
|
2016-10-01 01:52:01 +00:00
|
|
|
};
|
2016-03-26 17:08:53 +00:00
|
|
|
|
2019-08-12 05:00:17 +00:00
|
|
|
postUnpack = ''
|
|
|
|
tar -xzf ${modelData} -C $sourceRoot/data
|
|
|
|
'';
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook glib db pkg-config ];
|
2019-08-12 05:00:17 +00:00
|
|
|
|
2016-03-26 17:08:53 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Library for intelligent sentence-based Chinese pinyin input method";
|
2019-08-12 05:00:17 +00:00
|
|
|
homepage = "https://sourceforge.net/projects/libpinyin";
|
2016-03-26 17:08:53 +00:00
|
|
|
license = licenses.gpl2;
|
2016-10-01 01:52:01 +00:00
|
|
|
maintainers = with maintainers; [ ericsagnes ];
|
2016-03-26 17:08:53 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|