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