@@ -0,0 +1,73 @@
1+{ lib
2+, python
3+, buildPythonPackage
4+, fetchFromGitHub
5+, cython
6+, tiledb
7+, numpy
8+, wheel
9+, isPy3k
10+, setuptools_scm
11+, psutil
12+}:
13+
14+buildPythonPackage rec {
15+ pname = "tiledb";
16+ version = "0.5.0";
17+ format = "setuptools";
18+
19+ src = fetchFromGitHub {
20+ owner = "TileDB-Inc";
21+ repo = "TileDB-Py";
22+ rev = version;
23+ sha256 = "1c9wl207c8jz0695gy8p6bxywyd1k7wmczcfl7s0hlbknliamvyx";
24+ };
25+
26+ nativeBuildInputs = [
27+ cython
28+ setuptools_scm
29+ ];
30+
31+ buildInputs = [
32+ tiledb
33+ ];
34+
35+ propagatedBuildInputs = [
36+ numpy
37+ wheel # No idea why but it is listed
38+ ];
39+
40+ checkInputs = [
41+ psutil
42+ ];
43+
44+ TILEDB_PATH = tiledb;
45+
46+ SETUPTOOLS_SCM_PRETEND_VERSION = version;
47+
48+ disabled = !isPy3k; # Not bothering with python2 anymore
49+
50+ postPatch = ''
51+ # Hardcode path to shared object
52+ substituteInPlace tiledb/__init__.py --replace \
53+ 'os.path.join(lib_dir, lib_name)' 'os.path.join("${tiledb}/lib", lib_name)'
54+
55+ # Disable failing test
56+ substituteInPlace tiledb/tests/test_examples.py --replace \
57+ "test_docs" "dont_test_docs"
58+ '';
59+
60+ checkPhase = ''
61+ pushd "$out"
62+ ${python.interpreter} -m unittest tiledb.tests.all.suite_test
63+ popd
64+ '';
65+
66+ meta = with lib; {
67+ description = "Python interface to the TileDB storage manager";
68+ homepage = https://github.com/TileDB-Inc/TileDB-Py;
69+ license = licenses.mit;
70+ maintainers = with maintainers; [ fridh ];
71+ };
72+
73+}