2020-08-05 04:32:41 +02:00
|
|
|
{ buildPythonPackage, stdenv, lib, dlib, python, pytest, more-itertools
|
2021-02-24 21:56:27 +01:00
|
|
|
, sse4Support ? stdenv.hostPlatform.sse4_1Support
|
2020-08-05 04:32:41 +02:00
|
|
|
, avxSupport ? stdenv.hostPlatform.avxSupport
|
2019-05-06 01:40:20 +02:00
|
|
|
}:
|
2018-10-29 18:57:19 +01:00
|
|
|
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit (dlib) name src nativeBuildInputs buildInputs meta;
|
|
|
|
|
2019-03-03 14:21:04 +01: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.
|
2018-10-29 18:57:19 +01:00
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} nix_run_setup test --no USE_AVX_INSTRUCTIONS
|
|
|
|
'';
|
|
|
|
|
2021-02-24 21:56:27 +01:00
|
|
|
setupPyBuildFlags = [
|
|
|
|
"--set USE_SSE4_INSTRUCTIONS=${if sse4Support then "yes" else "no"}"
|
|
|
|
"--set USE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}"
|
|
|
|
];
|
2019-03-03 14:21:04 +01:00
|
|
|
|
2018-10-29 18:57:19 +01:00
|
|
|
patches = [ ./build-cores.patch ];
|
|
|
|
|
2019-08-22 19:53:49 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "more-itertools<6.0.0" "more-itertools" \
|
|
|
|
--replace "pytest==3.8" "pytest"
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ pytest more-itertools ];
|
2019-09-14 13:42:06 +02:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
2018-10-29 18:57:19 +01:00
|
|
|
}
|