1{ lib
2, buildPythonPackage
3, pkgs
4, requests
5, numpy
6, graphviz
7, python
8, isPy3k
9, isPy310
10}:
11
12buildPythonPackage {
13 inherit (pkgs.mxnet) pname version src;
14
15 buildInputs = [ pkgs.mxnet ];
16 propagatedBuildInputs = [ requests numpy graphviz ];
17
18 LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.mxnet ];
19
20 doCheck = !isPy3k;
21
22 postPatch = ''
23 # Required to support numpy >=1.24 where np.bool is removed in favor of just bool
24 substituteInPlace python/mxnet/numpy/utils.py \
25 --replace "bool = onp.bool" "bool = bool"
26 substituteInPlace python/setup.py \
27 --replace "graphviz<0.9.0," "graphviz"
28 '';
29
30 preConfigure = ''
31 cd python
32 '';
33
34 postInstall = ''
35 rm -rf $out/mxnet
36 ln -s ${pkgs.mxnet}/lib/libmxnet.so $out/${python.sitePackages}/mxnet
37 '';
38
39 meta = pkgs.mxnet.meta // {
40 broken = (pkgs.mxnet.broken or false) || (isPy310 && pkgs.mxnet.cudaSupport);
41 };
42}