2024-04-27 02:00:24 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
python3,
|
2024-04-27 02:03:27 +00:00
|
|
|
opencc,
|
2024-09-23 16:43:05 +00:00
|
|
|
rapidjson,
|
2024-09-23 16:51:36 +00:00
|
|
|
gitUpdater,
|
2024-04-27 02:00:24 +00:00
|
|
|
}:
|
2016-11-08 18:29:43 +00:00
|
|
|
|
2020-02-08 22:12:17 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opencc";
|
2024-10-17 07:02:25 +00:00
|
|
|
version = "1.1.9";
|
2020-02-08 22:12:17 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "BYVoid";
|
|
|
|
repo = "OpenCC";
|
|
|
|
rev = "ver.${version}";
|
2024-10-17 07:02:25 +00:00
|
|
|
sha256 = "sha256-JBTegQs9ALp4LdKKYMNp9GYEgqR9O8IkX6LqatvaTic=";
|
2016-11-08 18:29:43 +00:00
|
|
|
};
|
|
|
|
|
2024-04-27 02:03:27 +00:00
|
|
|
nativeBuildInputs =
|
|
|
|
[
|
|
|
|
cmake
|
|
|
|
python3
|
|
|
|
]
|
|
|
|
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
opencc # opencc_dict
|
|
|
|
];
|
2016-11-08 18:29:43 +00:00
|
|
|
|
2024-09-23 16:43:05 +00:00
|
|
|
buildInputs = [
|
|
|
|
rapidjson
|
|
|
|
];
|
|
|
|
|
|
|
|
# TODO use more system dependencies
|
|
|
|
cmakeFlags = [
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_RAPIDJSON" true)
|
|
|
|
];
|
|
|
|
|
2024-09-23 16:51:36 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gitUpdater { rev-prefix = "ver."; };
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-02-08 22:12:17 +00:00
|
|
|
homepage = "https://github.com/BYVoid/OpenCC";
|
2016-11-08 18:29:43 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
description = "Project for conversion between Traditional and Simplified Chinese";
|
|
|
|
longDescription = ''
|
|
|
|
Open Chinese Convert (OpenCC) is an opensource project for conversion between
|
|
|
|
Traditional Chinese and Simplified Chinese, supporting character-level conversion,
|
|
|
|
phrase-level conversion, variant conversion and regional idioms among Mainland China,
|
|
|
|
Taiwan and Hong kong.
|
|
|
|
'';
|
2020-02-08 22:12:17 +00:00
|
|
|
maintainers = with maintainers; [ sifmelcara ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2016-11-08 18:29:43 +00:00
|
|
|
};
|
|
|
|
}
|