2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
cmake,
|
|
|
|
numpy,
|
|
|
|
scipy,
|
|
|
|
hatchling,
|
|
|
|
stdenv,
|
|
|
|
xgboost,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage {
|
|
|
|
pname = "xgboost";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (xgboost) version src meta;
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
hatchling
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [ xgboost ];
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# Override existing logic for locating libxgboost.so which is not appropriate for Nix
|
2024-06-05 15:53:02 +00:00
|
|
|
prePatch =
|
|
|
|
let
|
|
|
|
libPath = "${xgboost}/lib/libxgboost${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
in
|
|
|
|
''
|
|
|
|
echo 'find_lib_path = lambda: ["${libPath}"]' > python-package/xgboost/libpath.py
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
cd python-package
|
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
# test setup tries to download test data with no option to disable
|
2023-02-02 18:25:31 +00:00
|
|
|
# (removing sklearn from nativeCheckInputs causes all previously enabled tests to be skipped)
|
2022-12-17 10:02:37 +00:00
|
|
|
# and are extremely cpu intensive anyway
|
|
|
|
doCheck = false;
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "xgboost" ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|