On Sat, Jul 17, 2021 at 04:23:45PM +0300, Adrian Bunk wrote: > Package: release.debian.org > Severity: normal > User: release.debian....@packages.debian.org > Usertags: unblock > > Please unblock package dlib > > * Backport upstream fix for using cv_image.h with OpenCV 4, > thanks to Alexandr Podgorniy. (Closes: #990676) > > This fixes compiling code using cv_image.h with the bullseye OpenCV.
And with debdiff attached. cu Adrian
diff -Nru dlib-19.10/debian/changelog dlib-19.10/debian/changelog --- dlib-19.10/debian/changelog 2019-01-17 09:17:25.000000000 +0200 +++ dlib-19.10/debian/changelog 2021-07-15 17:19:19.000000000 +0300 @@ -1,3 +1,11 @@ +dlib (19.10-3.1) unstable; urgency=medium + + * Non-maintainer upload. + * Backport upstream fix for using cv_image.h with OpenCV 4, + thanks to Alexandr Podgorniy. (Closes: #990676) + + -- Adrian Bunk <b...@debian.org> Thu, 15 Jul 2021 17:19:19 +0300 + dlib (19.10-3) unstable; urgency=medium * Team upload. diff -Nru dlib-19.10/debian/patches/0001-Fix-opencv-version-check-to-work-on-all-opencv-versi.patch dlib-19.10/debian/patches/0001-Fix-opencv-version-check-to-work-on-all-opencv-versi.patch --- dlib-19.10/debian/patches/0001-Fix-opencv-version-check-to-work-on-all-opencv-versi.patch 1970-01-01 02:00:00.000000000 +0200 +++ dlib-19.10/debian/patches/0001-Fix-opencv-version-check-to-work-on-all-opencv-versi.patch 2021-07-15 17:02:19.000000000 +0300 @@ -0,0 +1,33 @@ +From eea91537ac73498153266984da28c202965b75de Mon Sep 17 00:00:00 2001 +From: Davis King <da...@dlib.net> +Date: Sun, 22 Dec 2019 07:52:08 -0500 +Subject: Fix opencv version check to work on all opencv versions + +--- + dlib/opencv/cv_image.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/dlib/opencv/cv_image.h b/dlib/opencv/cv_image.h +index 5f224d00..05af0551 100644 +--- a/dlib/opencv/cv_image.h ++++ b/dlib/opencv/cv_image.h +@@ -34,7 +34,16 @@ namespace dlib + << "\n\t img.channels(): " << img.channels() + << "\n\t img.pixel_traits<pixel_type>::num: " << pixel_traits<pixel_type>::num + ); ++// Note, do NOT use CV_VERSION_MAJOR because in OpenCV 2 CV_VERSION_MAJOR actually held ++// CV_VERSION_MINOR and instead they used CV_VERSION_EPOCH. So for example, in OpenCV ++// 2.4.9.1 CV_VERSION_MAJOR==4 and CV_VERSION_EPOCH==2. However, CV_MAJOR_VERSION has always ++// (seemingly) held the actual major version number, so we use that to test for the OpenCV major ++// version. ++#if CV_MAJOR_VERSION > 3 ++ IplImage temp = cvIplImage(img); ++#else + IplImage temp = img; ++#endif + init(&temp); + } + +-- +2.20.1 + diff -Nru dlib-19.10/debian/patches/series dlib-19.10/debian/patches/series --- dlib-19.10/debian/patches/series 2019-01-17 08:43:25.000000000 +0200 +++ dlib-19.10/debian/patches/series 2021-07-15 17:19:17.000000000 +0300 @@ -1 +1,2 @@ fix-soname.patch +0001-Fix-opencv-version-check-to-work-on-all-opencv-versi.patch