summary refs log tree commit diff
path: root/pkgs/tools/graphics/facedetect
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2021-12-05 22:45:19 +0100
committerRobert Helgesson <robert@rycee.net>2021-12-05 23:03:18 +0100
commitf88b90f5c329a5a4d49e142315fbcb27986a13b1 (patch)
tree3a112a1d4ddb96adad214154d631f17c5782a3a0 /pkgs/tools/graphics/facedetect
parente98afa97d3554e00661e436ba5ab5938d40bc761 (diff)
facedetect: use Python 3
Diffstat (limited to 'pkgs/tools/graphics/facedetect')
-rw-r--r--pkgs/tools/graphics/facedetect/default.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/pkgs/tools/graphics/facedetect/default.nix b/pkgs/tools/graphics/facedetect/default.nix
index 26a9b3e24bd58..d62f077e06d7d 100644
--- a/pkgs/tools/graphics/facedetect/default.nix
+++ b/pkgs/tools/graphics/facedetect/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, python2Packages }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, python3Packages }:
 
 stdenv.mkDerivation rec {
   pname = "facedetect";
@@ -11,14 +11,22 @@ stdenv.mkDerivation rec {
     sha256 = "0mddh71cjbsngpvjli406ndi2x613y39ydgb8bi4z1jp063865sd";
   };
 
-  buildInputs = [ python2Packages.python python2Packages.wrapPython ];
-  pythonPath = [ python2Packages.numpy python2Packages.opencv4 ];
+  patches = [
+    (fetchpatch {
+      name = "python3-support.patch";
+      url = "https://gitlab.com/wavexx/facedetect/-/commit/8037d4406eb76dd5c106819f72c3562f8b255b5b.patch";
+      sha256 = "1752k37pbkigiwglx99ba9360ahzzrrb65a8d77k3xs4c3bcmk2p";
+    })
+  ];
+
+  buildInputs = [ python3Packages.python python3Packages.wrapPython ];
+  pythonPath = [ python3Packages.numpy python3Packages.opencv4 ];
 
   dontConfigure = true;
 
-  patchPhase = ''
+  postPatch = ''
     substituteInPlace facedetect \
-      --replace /usr/share/opencv "${python2Packages.opencv4}/share/opencv4"
+      --replace /usr/share/opencv "${python3Packages.opencv4}/share/opencv4"
   '';
 
   installPhase = ''