2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
dlib,
|
|
|
|
python,
|
|
|
|
pytest,
|
|
|
|
more-itertools,
|
|
|
|
sse4Support ? stdenv.hostPlatform.sse4_1Support,
|
|
|
|
avxSupport ? stdenv.hostPlatform.avxSupport,
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage {
|
2024-06-05 15:53:02 +00:00
|
|
|
inherit (dlib)
|
|
|
|
pname
|
|
|
|
version
|
|
|
|
src
|
|
|
|
nativeBuildInputs
|
|
|
|
buildInputs
|
|
|
|
meta
|
|
|
|
;
|
2022-10-06 18:32:54 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [ ./build-cores.patch ];
|
2022-10-06 18:32:54 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytest
|
|
|
|
more-itertools
|
|
|
|
];
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "more-itertools<6.0.0" "more-itertools" \
|
|
|
|
--replace "pytest==3.8" "pytest"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# although AVX can be enabled, we never test with it. Some Hydra machines
|
|
|
|
# fail because of this, however their build results are probably used on hardware
|
|
|
|
# with AVX support.
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} nix_run_setup test --no USE_AVX_INSTRUCTIONS
|
|
|
|
'';
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
setupPyBuildFlags = [
|
|
|
|
"--set USE_SSE4_INSTRUCTIONS=${if sse4Support then "yes" else "no"}"
|
|
|
|
"--set USE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
}
|