about summary refs log tree commit diff
path: root/pkgs/development/python-modules/fasttext-predict/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/fasttext-predict/default.nix')
-rw-r--r--pkgs/development/python-modules/fasttext-predict/default.nix22
1 files changed, 12 insertions, 10 deletions
diff --git a/pkgs/development/python-modules/fasttext-predict/default.nix b/pkgs/development/python-modules/fasttext-predict/default.nix
index f1d56ef7185f..bdd19640609e 100644
--- a/pkgs/development/python-modules/fasttext-predict/default.nix
+++ b/pkgs/development/python-modules/fasttext-predict/default.nix
@@ -1,8 +1,9 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, fetchPypi
-, pybind11
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  fetchPypi,
+  pybind11,
 }:
 
 buildPythonPackage rec {
@@ -15,9 +16,12 @@ buildPythonPackage rec {
     hash = "sha256-rMbf09pCHvVYI9g/aq74+PcsuU2LezpmDz4b/w9vRyc=";
   };
 
-  nativeBuildInputs = [
-    pybind11
-  ];
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    substituteInPlace setup.py \
+      --replace-fail "-flto" ""
+  '';
+
+  nativeBuildInputs = [ pybind11 ];
 
   # tests are removed from fork
   doCheck = false;
@@ -29,7 +33,5 @@ buildPythonPackage rec {
     homepage = "https://github.com/searxng/fasttext-predict/";
     license = licenses.mit;
     maintainers = with maintainers; [ SuperSandro2000 ];
-    # ImportError: dynamic module does not define module export function (PyInit_fasttext_pybind)
-    broken = stdenv.isDarwin;
   };
 }