2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, pkgs
|
|
|
|
, requests
|
|
|
|
, numpy
|
|
|
|
, graphviz
|
|
|
|
, python
|
|
|
|
, isPy3k
|
2022-04-15 01:41:22 +00:00
|
|
|
, isPy310
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage {
|
2022-04-15 01:41:22 +00:00
|
|
|
inherit (pkgs.mxnet) pname version src;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ pkgs.mxnet ];
|
|
|
|
propagatedBuildInputs = [ requests numpy graphviz ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.mxnet ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = !isPy3k;
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-08-04 22:07:22 +00:00
|
|
|
# Required to support numpy >=1.24 where np.bool is removed in favor of just bool
|
|
|
|
substituteInPlace python/mxnet/numpy/utils.py \
|
|
|
|
--replace "bool = onp.bool" "bool = bool"
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace python/setup.py \
|
2021-02-05 17:12:51 +00:00
|
|
|
--replace "graphviz<0.9.0," "graphviz"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd python
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -rf $out/mxnet
|
|
|
|
ln -s ${pkgs.mxnet}/lib/libmxnet.so $out/${python.sitePackages}/mxnet
|
|
|
|
'';
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
meta = pkgs.mxnet.meta // {
|
|
|
|
broken = (pkgs.mxnet.broken or false) || (isPy310 && pkgs.mxnet.cudaSupport);
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|