nixpkgs/pkgs/by-name/se/sentencepiece/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.0 KiB
Nix
Raw Normal View History

{ lib
2019-12-07 01:15:09 +00:00
, fetchFromGitHub
, stdenv
, cmake
, gperftools
, withGPerfTools ? true
2019-12-07 01:15:09 +00:00
}:
stdenv.mkDerivation rec {
pname = "sentencepiece";
2024-02-19 21:21:20 +00:00
version = "0.2.0";
2019-12-07 01:15:09 +00:00
src = fetchFromGitHub {
owner = "google";
repo = pname;
rev = "refs/tags/v${version}";
2024-02-19 21:21:20 +00:00
sha256 = "sha256-tMt6UBDqpdjAhxAJlVOFFlE3RC36/t8K0gBAzbesnsg=";
2019-12-07 01:15:09 +00:00
};
nativeBuildInputs = [ cmake ];
buildInputs = lib.optionals withGPerfTools [ gperftools ];
outputs = [ "bin" "dev" "out" ];
2019-12-07 01:15:09 +00:00
# https://github.com/google/sentencepiece/issues/754
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
--replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
'';
meta = with lib; {
homepage = "https://github.com/google/sentencepiece";
2019-12-07 01:15:09 +00:00
description = "Unsupervised text tokenizer for Neural Network-based text generation";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ pashashocky ];
2019-12-07 01:15:09 +00:00
};
}