mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 23:23:07 +00:00
27d0c5a07e
I am using sentencepiece in a downstream application where I want to minimize the resulting closures. This commit makes changes to make sentencepiece a leaner dependency: - Split the outputs, so that the binaries/headers do not end up in the transitive closure in a library dependency. - Add the `withGPerfTools` option, which is enabled by default, to make it possible to disable the gperftools dependency. According to the sentencepiece README, this dependency gives a 10-40% performance improvement. But in many cases this is overshadowed by the neural networks that use piece identifiers as input anyway.
19 lines
380 B
Nix
19 lines
380 B
Nix
{ buildPythonPackage
|
|
, stdenv
|
|
, sentencepiece
|
|
, pkgconfig
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "sentencepiece";
|
|
inherit (sentencepiece) version src;
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
buildInputs = [ sentencepiece.dev ];
|
|
|
|
sourceRoot = "source/python";
|
|
|
|
# sentencepiece installs 'bin' output.
|
|
meta = builtins.removeAttrs sentencepiece.meta [ "outputsToInstall" ];
|
|
}
|