From 38365fa0727943b606035622ce61afc5a86ad8fa Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 8 May 2023 09:57:03 +0200 Subject: [PATCH] python311.pkgs.dlib: fix build Failing Hydra build: https://hydra.nixos.org/build/215620971 Applying the patch that upgrades the vendored `pybind11` fixes the problem. --- .../python-modules/dlib/default.nix | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/dlib/default.nix b/pkgs/development/python-modules/dlib/default.nix index f75767811c1d..cadb85f0405e 100644 --- a/pkgs/development/python-modules/dlib/default.nix +++ b/pkgs/development/python-modules/dlib/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPythonPackage, dlib, python, pytest, more-itertools +{ stdenv, buildPythonPackage, dlib, python, pytest, more-itertools, fetchpatch , sse4Support ? stdenv.hostPlatform.sse4_1Support , avxSupport ? stdenv.hostPlatform.avxSupport }: @@ -6,7 +6,28 @@ buildPythonPackage { inherit (dlib) pname version src nativeBuildInputs buildInputs meta; - patches = [ ./build-cores.patch ]; + patches = [ + ./build-cores.patch + + # Upgrade minimum CMake & C++ requirement. Nixpkgs is sufficiently up-to-date + # so that is not a problem. Applied to make sure the pybind11 patch applies cleanly. + (fetchpatch { + url = "https://github.com/davisking/dlib/commit/29288e5d895b21f5508c15294f1303b367534a63.patch"; + sha256 = "sha256-8GsGOehTFabRf+QOZK6Ek/Xgwp8yLj8UKd7kmneBpXk="; + }) + # Removes a bunch of broken python tests. Also useful to make sure the pybind11 + # patch applies cleanly. + (fetchpatch { + url = "https://github.com/davisking/dlib/commit/a517aaa0bbb0524a1a7be3d6637aa6300c2e1dfe.patch"; + sha256 = "sha256-31/c1ViVPdJ/gQVMV22Nnr01/Yg13s9tPowfh4BedNg="; + }) + # Upgrade pybind11 to 2.4.0. Relevant to fix Python 3.11 support. + (fetchpatch { + url = "https://github.com/davisking/dlib/commit/65bce59a1512cf222dec01d3e0f29b612dd181f5.patch"; + sha256 = "sha256-04TGJdn9p9YhDVZHAU9ncgCyR1vrnRxKkTRDSwOk/fw="; + excludes = [ ".github/workflows/build_python.yml" ]; + }) + ]; nativeCheckInputs = [ pytest more-itertools ];