7 , withGPerfTools ? true
10 stdenv.mkDerivation rec {
11 pname = "sentencepiece";
14 src = fetchFromGitHub {
17 rev = "refs/tags/v${version}";
18 sha256 = "sha256-tMt6UBDqpdjAhxAJlVOFFlE3RC36/t8K0gBAzbesnsg=";
21 nativeBuildInputs = [ cmake ];
23 buildInputs = lib.optionals withGPerfTools [ gperftools ];
25 outputs = [ "bin" "dev" "out" ];
27 # https://github.com/google/sentencepiece/issues/754
29 substituteInPlace CMakeLists.txt \
30 --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
31 --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
35 homepage = "https://github.com/google/sentencepiece";
36 description = "Unsupervised text tokenizer for Neural Network-based text generation";
37 license = licenses.asl20;
38 platforms = platforms.unix;
39 maintainers = with maintainers; [ pashashocky ];