Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libpinyin / default.nix
blob2ae333d61ad885d8f382e7f1ae200c5bc743f367
1 { lib
2 , stdenv
3 , fetchurl
4 , fetchFromGitHub
5 , autoreconfHook
6 , glib
7 , db
8 , pkg-config
9 }:
11 let
12   modelData = fetchurl {
13     url = "mirror://sourceforge/libpinyin/models/model19.text.tar.gz";
14     sha256 = "02zml6m8sj5q97ibpvaj9s9yz3gfj0jnjrfhkn02qv4nwm72lhjn";
15   };
17 stdenv.mkDerivation rec {
18   pname = "libpinyin";
19   version = "2.8.1";
21   src = fetchFromGitHub {
22     owner = "libpinyin";
23     repo = "libpinyin";
24     rev = version;
25     hash = "sha256-3+CBbjCaY0Ubyphf0uCfYvF2rtc9fF1eEAM1doonjHg=";
26   };
28   postUnpack = ''
29     tar -xzf ${modelData} -C $sourceRoot/data
30   '';
32   strictDeps = true;
34   nativeBuildInputs = [
35     autoreconfHook
36     pkg-config
37   ];
39   buildInputs = [
40     glib
41     db
42   ];
44   meta = with lib; {
45     description = "Library for intelligent sentence-based Chinese pinyin input method";
46     homepage = "https://github.com/libpinyin/libpinyin";
47     license = licenses.gpl3Plus;
48     maintainers = with maintainers; [ linsui ericsagnes ];
49     platforms = platforms.linux;
50   };