summary refs log tree commit diff
path: root/pkgs/development/libraries/libpinyin/default.nix
blob: bf516b33d02af77cd4da8a08001b418ee0503d51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ stdenv, fetchurl, fetchFromGitHub
, autoreconfHook
, glib
, db
, pkgconfig
}:

let
  modelData = fetchurl {
    url    = "mirror://sourceforge/libpinyin/models/model17.text.tar.gz";
    sha256 = "1kb2nswpsqlk2qm5jr7vqcp97f2dx7nvpk24lxjs1g12n252f5z0";
  };
in
stdenv.mkDerivation rec {
  name = "libpinyin-${version}";
  version = "2.3.0";

  src = fetchFromGitHub {
    owner  = "libpinyin";
    repo   = "libpinyin";
    rev    = version;
    sha256 = "14fkpp16s5k0pbw5wwd24pqr0qbdjgbl90n9aqwx72m03n7an40l";
  };

  postUnpack = ''
    tar -xzf ${modelData} -C $sourceRoot/data
  '';

  nativeBuildInputs = [ autoreconfHook glib db pkgconfig ];

  meta = with stdenv.lib; {
    description = "Library for intelligent sentence-based Chinese pinyin input method";
    homepage    = "https://sourceforge.net/projects/libpinyin";
    license     = licenses.gpl2;
    maintainers = with maintainers; [ ericsagnes ];
    platforms   = platforms.linux;
  };
}