1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 pybind11,
7}:
8
9buildPythonPackage rec {
10 pname = "fasttext-predict";
11 version = "0.9.2.4";
12 format = "setuptools";
13
14 src = fetchPypi {
15 pname = "fasttext_predict";
16 inherit version;
17 hash = "sha256-GKb7DXTH35KA2x+Wy3XZkL/QBPqdZpST6j3T1U+E28c=";
18 };
19
20 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
21 substituteInPlace setup.py \
22 --replace-fail "-flto" ""
23 '';
24
25 nativeBuildInputs = [ pybind11 ];
26
27 # tests are removed from fork
28 doCheck = false;
29
30 pythonImportsCheck = [ "fasttext" ];
31
32 meta = with lib; {
33 description = "fasttext with wheels and no external dependency, but only the predict method (<1MB)";
34 homepage = "https://github.com/searxng/fasttext-predict/";
35 license = licenses.mit;
36 maintainers = with maintainers; [ SuperSandro2000 ];
37 };
38}