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