Skip to content

Commit

Permalink
pythonPackage.datatable: add missing import and fix library resolutio…
Browse files Browse the repository at this point in the history
…n for darwin
  • Loading branch information
korayal committed Oct 10, 2019
1 parent ea79aba commit 9580b8d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkgs/development/python-modules/datatable/default.nix
Expand Up @@ -19,6 +19,10 @@ buildPythonPackage rec {
sha256 = "1shwjkm9nyaj6asn57vwdd74pn13pggh14r6dzv729lzxm7nm65f";
};

postFixup = lib.optionalString stdenv.isDarwin ''
install_name_tool -change "@rpath/libc++.1.0.dylib" "${lib.getLib libcxx}/lib/libc++.1.dylib" "$out/lib/python3.7/site-packages/datatable/lib/_datatable.cpython-37m-darwin.so"
'';

patches = lib.optionals stdenv.isDarwin [
# Replace the library auto-detection with hardcoded paths.
(substituteAll {
Expand All @@ -28,6 +32,10 @@ buildPythonPackage rec {
libcxx_dylib = "${lib.getLib libcxx}/lib/libc++.1.dylib";
libcxxabi_dylib = "${lib.getLib libcxxabi}/lib/libc++abi.dylib";
})
# v0.9.0 is missing the import of shutil, which is only used for darwin
# should be removed on v0.10.0:
# https://github.com/h2oai/datatable/issues/2070
./import_shutil.patch
];

propagatedBuildInputs = [ typesentry blessed ];
Expand Down
12 changes: 12 additions & 0 deletions pkgs/development/python-modules/datatable/import_shutil.patch
@@ -0,0 +1,12 @@
diff --git a/ci/setup_utils.py b/ci/setup_utils.py
index 725aae89..73631d55 100644
--- a/ci/setup_utils.py
+++ b/ci/setup_utils.py
@@ -29,6 +29,7 @@ import sysconfig
import tempfile
from functools import lru_cache as memoize
from distutils.errors import DistutilsExecError, CompileError
+import shutil

__all__ = (
"find_linked_dynamic_libraries",

0 comments on commit 9580b8d

Please sign in to comment.