1{ lib
2, buildPythonPackage
3, isPyPy
4, isPy3k
5, cython
6, numpy
7, pkgs
8}:
9
10buildPythonPackage rec {
11 version = "0.7.2";
12 pname = "dynd";
13 disabled = isPyPy || !isPy3k; # tests fail on python2, 2018-04-11
14
15 src = pkgs.fetchFromGitHub {
16 owner = "libdynd";
17 repo = "dynd-python";
18 rev = "v${version}";
19 sha256 = "19igd6ibf9araqhq9bxmzbzdz05vp089zxvddkiik3b5gb7l17nh";
20 };
21
22 # setup.py invokes git on build but we're fetching a tarball, so
23 # can't retrieve git version. We hardcode:
24 preConfigure = ''
25 substituteInPlace setup.py --replace "ver = check_output(['git', 'describe', '--dirty'," "ver = '${version}'"
26 substituteInPlace setup.py --replace "'--always', '--match', 'v*']).decode('ascii').strip('\n')" ""
27 '';
28
29 dontUseCmakeConfigure = true;
30
31 # Python 3 works but has a broken import test that I couldn't
32 # figure out.
33 doCheck = !isPy3k;
34 nativeBuildInputs = [ pkgs.cmake ];
35 buildInputs = [ pkgs.libdynd.dev cython ];
36 propagatedBuildInputs = [ numpy pkgs.libdynd ];
37
38 meta = with lib; {
39 homepage = "http://libdynd.org";
40 license = licenses.bsd2;
41 description = "Python exposure of dynd";
42 maintainers = with maintainers; [ teh ];
43 };
44
45}