evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / se / sentencepiece / package.nix
blob0c40f67c21ee503bb4da604af5779205f7feab08
1 { lib
2 , fetchFromGitHub
3 , stdenv
4 , cmake
5 , gperftools
7 , withGPerfTools ? true
8 }:
10 stdenv.mkDerivation rec {
11   pname = "sentencepiece";
12   version = "0.2.0";
14   src = fetchFromGitHub {
15     owner = "google";
16     repo = pname;
17     rev = "refs/tags/v${version}";
18     sha256 = "sha256-tMt6UBDqpdjAhxAJlVOFFlE3RC36/t8K0gBAzbesnsg=";
19   };
21   nativeBuildInputs = [ cmake ];
23   buildInputs = lib.optionals withGPerfTools [ gperftools ];
25   outputs = [ "bin" "dev" "out" ];
27   # https://github.com/google/sentencepiece/issues/754
28   postPatch = ''
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}
32   '';
34   meta = with lib; {
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 ];
40   };