1{ buildPythonPackage, dlib, python, pytest, more-itertools, avxSupport ? true, lib }:
2
3buildPythonPackage {
4 inherit (dlib) name src nativeBuildInputs buildInputs meta;
5
6 # although AVX can be enabled, we never test with it. Some Hydra machines
7 # fail because of this, however their build results are probably used on hardware
8 # with AVX support.
9 checkPhase = ''
10 ${python.interpreter} nix_run_setup test --no USE_AVX_INSTRUCTIONS
11 '';
12
13 setupPyBuildFlags = lib.optional avxSupport "--no USE_AVX_INSTRUCTIONS";
14
15 patches = [ ./build-cores.patch ];
16
17 postPatch = ''
18 substituteInPlace setup.py \
19 --replace "more-itertools<6.0.0" "more-itertools" \
20 --replace "pytest==3.8" "pytest"
21 '';
22
23 checkInputs = [ pytest more-itertools ];
24
25 enableParallelBuilding = true;
26 dontUseCmakeConfigure = true;
27}