2020-08-05 03:32:41 +01:00
|
|
|
{ buildPythonPackage, stdenv, lib, dlib, python, pytest, more-itertools
|
|
|
|
, avxSupport ? stdenv.hostPlatform.avxSupport
|
2019-05-06 00:40:20 +01:00
|
|
|
}:
|
2018-10-29 17:57:19 +00:00
|
|
|
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit (dlib) name src nativeBuildInputs buildInputs meta;
|
|
|
|
|
2019-03-03 13:21:04 +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.
|
2018-10-29 17:57:19 +00:00
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} nix_run_setup test --no USE_AVX_INSTRUCTIONS
|
|
|
|
'';
|
|
|
|
|
2019-08-22 18:53:49 +01:00
|
|
|
setupPyBuildFlags = lib.optional avxSupport "--no USE_AVX_INSTRUCTIONS";
|
2019-03-03 13:21:04 +00:00
|
|
|
|
2018-10-29 17:57:19 +00:00
|
|
|
patches = [ ./build-cores.patch ];
|
|
|
|
|
2019-08-22 18:53:49 +01: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 12:42:06 +01:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
2018-10-29 17:57:19 +00:00
|
|
|
}
|