2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, python }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opencc";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "1.1.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "BYVoid";
|
|
|
|
repo = "OpenCC";
|
|
|
|
rev = "ver.${version}";
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-q/y4tRov/BYCAiE4i7fT6ysTerxxOHMZUWT2Jlo/0rI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake python ];
|
|
|
|
|
|
|
|
# let intermediate tools find intermediate library
|
2021-01-15 22:18:51 +00:00
|
|
|
preBuild = lib.optionalString stdenv.isLinux ''
|
2020-04-24 23:36:52 +00:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/src
|
2021-01-15 22:18:51 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$(pwd)/src
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/BYVoid/OpenCC";
|
|
|
|
license = licenses.asl20;
|
|
|
|
description = "A 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.
|
|
|
|
'';
|
|
|
|
maintainers = with maintainers; [ sifmelcara ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
};
|
|
|
|
}
|