2021-12-06 16:07:01 +00:00
|
|
|
{ stdenv, buildPythonPackage, dlib, python, pytest, more-itertools
|
2021-03-09 03:18:52 +00:00
|
|
|
, sse4Support ? stdenv.hostPlatform.sse4_1Support
|
2020-09-25 04:45:31 +00:00
|
|
|
, avxSupport ? stdenv.hostPlatform.avxSupport
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage {
|
2022-10-06 18:32:54 +00:00
|
|
|
inherit (dlib) pname version src nativeBuildInputs buildInputs meta;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
patches = [
|
|
|
|
./build-cores.patch
|
|
|
|
];
|
2022-10-06 18:32:54 +00:00
|
|
|
|
2023-02-02 18:25:31 +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;
|
|
|
|
}
|