nixpkgs/pkgs/tools/text/opencc/default.nix

37 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, cmake, python }:
2016-11-08 21:29:43 +03:00
2020-02-09 01:12:17 +03:00
stdenv.mkDerivation rec {
pname = "opencc";
version = "1.1.2";
2020-02-09 01:12:17 +03:00
src = fetchFromGitHub {
owner = "BYVoid";
repo = "OpenCC";
rev = "ver.${version}";
sha256 = "1a15p9idznh23b44r7rw2zjnirbxjs5pyq3k6xkz0k64cdh2zq6h";
2016-11-08 21:29:43 +03:00
};
2020-02-09 01:12:17 +03:00
nativeBuildInputs = [ cmake python ];
2016-11-08 21:29:43 +03:00
2020-02-09 01:12:17 +03:00
# let intermediate tools find intermediate library
2021-01-15 12:19:50 +03:00
preBuild = lib.optionalString stdenv.isLinux ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/src
2021-01-15 12:19:50 +03:00
'' + lib.optionalString stdenv.isDarwin ''
2020-02-09 01:12:17 +03:00
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$(pwd)/src
'';
2016-11-08 21:29:43 +03:00
meta = with lib; {
2020-02-09 01:12:17 +03:00
homepage = "https://github.com/BYVoid/OpenCC";
2016-11-08 21:29:43 +03:00
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.
'';
2020-02-09 01:12:17 +03:00
maintainers = with maintainers; [ sifmelcara ];
platforms = with platforms; linux ++ darwin;
2016-11-08 21:29:43 +03:00
};
}