summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2021-05-25 19:43:12 +0100
committerGitHub <noreply@github.com>2021-05-25 19:43:12 +0100
commitc29e090a7dc98bbc6abb607227647b6a263e3364 (patch)
tree06df1a7e8be130c88d98378bebce229ec098bb1c /pkgs
parent8c0828e4ce9828596fa7fa8dfe7f345636929c71 (diff)
parent1b7c85043775856d6b7ca664c81cee6cc6c04c45 (diff)
downloadnixpkgs-c29e090a7dc98bbc6abb607227647b6a263e3364.tar
nixpkgs-c29e090a7dc98bbc6abb607227647b6a263e3364.tar.gz
nixpkgs-c29e090a7dc98bbc6abb607227647b6a263e3364.tar.bz2
nixpkgs-c29e090a7dc98bbc6abb607227647b6a263e3364.tar.lz
nixpkgs-c29e090a7dc98bbc6abb607227647b6a263e3364.tar.xz
nixpkgs-c29e090a7dc98bbc6abb607227647b6a263e3364.tar.zst
nixpkgs-c29e090a7dc98bbc6abb607227647b6a263e3364.zip
Merge pull request #124316 from risicle/ris-lightgbm-darwin
python3Packages.lightgbm: fix for darwin
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/lightgbm/default.nix17
1 files changed, 2 insertions, 15 deletions
diff --git a/pkgs/development/python-modules/lightgbm/default.nix b/pkgs/development/python-modules/lightgbm/default.nix
index a887c3ec8af..fbe9e04b643 100644
--- a/pkgs/development/python-modules/lightgbm/default.nix
+++ b/pkgs/development/python-modules/lightgbm/default.nix
@@ -23,19 +23,7 @@ buildPythonPackage rec {
 
   dontUseCmakeConfigure = true;
 
-  # we never actually explicitly call the install command so this is the only way
-  # to inject these options to it - however, openmp-library doesn't appear to have
-  # any effect, so we have to inject it into NIX_LDFLAGS manually below
-  postPatch = lib.optionalString stdenv.cc.isClang ''
-    cat >> setup.cfg <<EOF
-
-    [install]
-    openmp-include-dir=${llvmPackages.openmp}/include
-    openmp-library=${llvmPackages.openmp}/lib/libomp.dylib
-
-    EOF
-  '';
-
+  buildInputs = lib.optional stdenv.cc.isClang [ llvmPackages.openmp ];
   propagatedBuildInputs = [
     numpy
     scipy
@@ -44,14 +32,13 @@ buildPythonPackage rec {
 
   postConfigure = ''
     export HOME=$(mktemp -d)
-  '' + lib.optionalString stdenv.cc.isClang ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -L${llvmPackages.openmp}/lib -lomp"
   '';
 
   # The pypi package doesn't distribute the tests from the GitHub
   # repository. It contains c++ tests which don't seem to wired up to
   # `make check`.
   doCheck = false;
+  pythonImportsCheck = [ "lightgbm" ];
 
   meta = with lib; {
     description = "A fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART) framework";