about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/xnd/default.nix
blob: 558e414debf830d2ebbd107ab9d15bd0c4751b53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ buildPythonPackage
, ndtypes
, libndtypes
, libxnd
, isPy27
}:

buildPythonPackage {
  pname = "xnd";
  disabled = isPy27;
  inherit (libxnd) version src meta;

  propagatedBuildInputs = [ ndtypes ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace 'include_dirs = ["libxnd", "ndtypes/python/ndtypes"] + INCLUDES' \
                'include_dirs = ["${libndtypes}/include", "${ndtypes}/include", "${libxnd}/include"]' \
      --replace 'library_dirs = ["libxnd", "ndtypes/libndtypes"] + LIBS' \
                'library_dirs = ["${libndtypes}/lib", "${libxnd}/lib"]' \
      --replace 'runtime_library_dirs = ["$ORIGIN"]' \
                'runtime_library_dirs = ["${libndtypes}/lib", "${libxnd}/lib"]' \
  '';

  postInstall = ''
    mkdir $out/include
    cp python/xnd/*.h $out/include
  '';
}