aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/dlib/default.nix
blob: 027500ff2abfa1d723e1c2d9a5296e86dc545022 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ buildPythonPackage, stdenv, lib, dlib, python, pytest, more-itertools
, avxSupport ? stdenv.hostPlatform.avxSupport
}:

buildPythonPackage {
  inherit (dlib) name src nativeBuildInputs buildInputs meta;

  # 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
  '';

  setupPyBuildFlags = lib.optional avxSupport "--no USE_AVX_INSTRUCTIONS";

  patches = [ ./build-cores.patch ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "more-itertools<6.0.0" "more-itertools" \
      --replace "pytest==3.8" "pytest"
  '';

  checkInputs = [ pytest more-itertools ];

  enableParallelBuilding = true;
  dontUseCmakeConfigure = true;
}