#1147683#5
Date:
2026-09-14 11:18:58 UTC
From:
To:
Dear maintainer,

Your package fails to build from source against opencv 5.0.0+dfsg-1~exp1,
currently in experimental.

OpenCV 5.0 renames its entire install tree from opencv4 to opencv5 and ships
no compatibility shims:

  * pkg-config: only /usr/lib/<triplet>/pkgconfig/opencv5.pc.  There is no
                opencv4.pc and no opencv.pc.
  * headers:    /usr/include/opencv5/opencv2/..., no /usr/include/opencv4.
  * cmake:      /usr/lib/<triplet>/cmake/opencv5/OpenCVConfig.cmake.  A bare
                find_package(OpenCV) still resolves, but a pinned version
                such as find_package(OpenCV 4.7) no longer matches.
  * modules:    libopencv-calib3d-dev is split into libopencv-calib-dev,
                libopencv-geometry-dev, libopencv-stereo-dev and
                libopencv-ptcloud-dev; libopencv-features2d-dev becomes
                libopencv-features-dev.  The CMake component names change
                with them (features2d -> features).
  * geometry:   the new geometry module is not only a piece of calib3d.  It
                also absorbs shape and contour functions that used to live
                in imgproc -- contourArea, arcLength, approxPolyDP,
                boundingRect, minAreaRect, convexHull and
                getPerspectiveTransform among them -- and opencv2/opencv.hpp
                does not pull in opencv2/geometry.hpp, so code that reached
                those through the umbrella header now needs an explicit
                include of opencv2/geometry.hpp.

In r-cran-opencv's case, the configure script's anticonf check queries
pkg-config for the module name "opencv4" (see "Configuration failed to
find opencv4 library" and the "opencv4.pc file" hint just above the
failure). That pkg-config lookup fails, so PKG_CFLAGS stays empty
("Using PKG_CFLAGS="), and the subsequent compiler probe for the
header aborts with "<stdin>:1:10: fatal error: opencv2/opencv.hpp: No
such file or directory", which is what makes R CMD INSTALL exit 1 and
take down debian/rules binary (Error 25). The configure script should
also probe for the opencv5 pkg-config module (falling back to opencv4)
so the resulting include path reaches the compiler and
opencv2/opencv.hpp is found again.

The same source builds fine in the same chroot against the OpenCV 4.10
packages currently in unstable, so this is specific to OpenCV 5.

The relevant part of the build log follows; the full log is attached.


  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
  SHELL=/bin/sh
  USER=sbuild

  dpkg-buildpackage
  -----------------

  Command: dpkg-buildpackage --sanitize-env -us -uc -b -j40
  dpkg-buildpackage: info: source package r-cran-opencv
  dpkg-buildpackage: info: source version 0.5.2-1
  dpkg-buildpackage: info: source distribution unstable
  dpkg-buildpackage: info: source changed by Andrius Merkys <merkys@debian.org>
   dpkg-source --before-build .
  dpkg-buildpackage: info: host architecture amd64
   debian/rules clean
  dh clean --buildsystem R
     dh_auto_clean -O--buildsystem=R
     dh_autoreconf_clean -O--buildsystem=R
     dh_clean -O--buildsystem=R
   debian/rules binary
  dh binary --buildsystem R
     dh_update_autotools_config -O--buildsystem=R
     dh_autoreconf -O--buildsystem=R
     dh_auto_configure -O--buildsystem=R
     dh_auto_build -O--buildsystem=R
     dh_auto_test -O--buildsystem=R
     create-stamp debian/debhelper-build-stamp
     dh_testroot -O--buildsystem=R
     dh_prep -O--buildsystem=R
     dh_auto_install --destdir=debian/r-cran-opencv/ -O--buildsystem=R
  I: R Package: opencv Version: 0.5.2
  I: Building using R version 4.6.1-6
  I: R API version: r-api-4.0
  I: Using built-time from d/changelog: Wed, 25 Feb 2026 02:40:36 -0500
  mkdir -p /build/reproducible-path/r-cran-opencv-0.5.2/debian/r-cran-opencv/usr/lib/R/site-library
  R CMD INSTALL -l
/build/reproducible-path/r-cran-opencv-0.5.2/debian/r-cran-opencv/usr/lib/R/site-library
--clean . --built-timestamp="'Wed, 25 Feb 2026 02:40:36 -0500'"
  * installing *source* package ‘opencv’ ...
  ** this is package ‘opencv’ version ‘0.5.2’
  ** package ‘opencv’ successfully unpacked and MD5 sums checked
  ** using staged installation
  This is pkg-config 2.5.1
  Using PKG_CFLAGS=
  Found C++17 compiler: x86_64-linux-gnu-g++
  -----------------------------[ ANTICONF ]-------------------------------
  Configuration failed to find opencv4 library. Try installing:
   * deb: libopencv-dev (Debian, Ubuntu, etc)
   * rpm: opencv-devel (Fedora, CentOS, RHEL)
   * brew: opencv (Mac OSX)
  If opencv4 is already installed, check that 'pkg-config' is in your
  PATH and PKG_CONFIG_PATH contains a opencv4.pc file.
  ---------------------------[ ERROR MESSAGE ]----------------------------
  <stdin>:1:10: fatal error: opencv2/opencv.hpp: No such file or directory
  compilation terminated.
  ------------------------------------------------------------------------
  ERROR: configuration failed for package ‘opencv’
  * removing ‘/build/reproducible-path/r-cran-opencv-0.5.2/debian/r-cran-opencv/usr/lib/R/site-library/opencv’
  make: *** [debian/rules:4: binary] Error 25
  dpkg-buildpackage: error: debian/rules binary subprocess failed with
exit status 2
  --------------------------------------------------------------------------------

Please close this bug if it turns out to be a collision with another ongoing
transition rather than an OpenCV 5 problem.

Thanks,
Aron