btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / op / opencc / package.nix
blob54360185cd8f9c58aa2cf32adc247a848b93b56c
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   python3,
7   opencc,
8   rapidjson,
9   gitUpdater,
12 stdenv.mkDerivation rec {
13   pname = "opencc";
14   version = "1.1.9";
16   src = fetchFromGitHub {
17     owner = "BYVoid";
18     repo = "OpenCC";
19     rev = "ver.${version}";
20     sha256 = "sha256-JBTegQs9ALp4LdKKYMNp9GYEgqR9O8IkX6LqatvaTic=";
21   };
23   nativeBuildInputs =
24     [
25       cmake
26       python3
27     ]
28     ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
29       opencc # opencc_dict
30     ];
32   buildInputs = [
33     rapidjson
34   ];
36   # TODO use more system dependencies
37   cmakeFlags = [
38     (lib.cmakeBool "USE_SYSTEM_RAPIDJSON" true)
39   ];
41   passthru = {
42     updateScript = gitUpdater { rev-prefix = "ver."; };
43   };
45   meta = with lib; {
46     homepage = "https://github.com/BYVoid/OpenCC";
47     license = licenses.asl20;
48     description = "Project for conversion between Traditional and Simplified Chinese";
49     longDescription = ''
50       Open Chinese Convert (OpenCC) is an opensource project for conversion between
51       Traditional Chinese and Simplified Chinese, supporting character-level conversion,
52       phrase-level conversion, variant conversion and regional idioms among Mainland China,
53       Taiwan and Hong kong.
54     '';
55     maintainers = with maintainers; [ sifmelcara ];
56     platforms = with platforms; linux ++ darwin;
57   };