blob: b42ba43501fe6759a0d37cf024e2fb799e31de22 (
plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
{
lib,
buildPythonPackage,
distutils,
graphviz,
numpy,
pkgs,
python,
requests,
setuptools,
}:
buildPythonPackage {
inherit (pkgs.mxnet) pname version src;
pyproject = true;
build-system = [ setuptools ];
buildInputs = [ pkgs.mxnet ];
dependencies = [
distutils
graphviz
numpy
requests
];
pythonRelaxDeps = [
"graphviz"
"numpy"
];
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.mxnet ];
postPatch = ''
# Required to support numpy >=1.24 where np.bool is removed in favor of just bool
substituteInPlace python/mxnet/numpy/utils.py \
--replace-fail "bool = onp.bool" "bool = bool"
'';
preConfigure = ''
cd python
'';
postInstall = ''
rm -rf $out/mxnet
ln -s ${pkgs.mxnet}/lib/libmxnet.so $out/${python.sitePackages}/mxnet
'';
meta = pkgs.mxnet.meta;
}
|