0

I want to prepare a debian package with dependency to OpenCV 3.4.1. In debian/control I specify:

Build-Depends: ...
               libopencv-dev (=3.4.1-xenial1.3),

The problem is, that in our apt repository there is also OpenCV 3.4.10. Now, my package is built and linked to OpenCV 3.4.1, but a package building tool specifies the package dependencies on the level of .so number (3.4), so the latest OpenCV is installed automatically. And unfortunately, the shared objects contain symbols that have changed between 3.4.1 and 3.4.10 (that concerns libopencv_dnn.so). In the end, my application cannot find the symbols from libopencv_dnn.so.3.4.1 in libopencv_dnn.so.3.4.10, and I can't make it install version 3.4.1 as the dependency.

Piotr G
  • 121
  • Xenial is not a Debian release. – Ipor Sircer Sep 08 '20 at 16:28
  • But it is Ubuntu release. – Piotr G Sep 08 '20 at 16:29
  • It sounds like you’re being hit by two problems: hosting multiple versions in a single repository (strictly speaking, in a single suite) doesn’t work well and isn’t supported AFAIK, and if libopencv_dnn.so’s symbols changed but not its soname, you’re going to run into issues anyway... – Stephen Kitt Sep 08 '20 at 16:49
  • Even if I had them in separate repositories, the newest of the 3.4 version would still be installed anyway. – Piotr G Sep 08 '20 at 17:16
  • Yes, and that’s the soname problem. – Stephen Kitt Sep 08 '20 at 17:19
  • Issues like this is why I really started to dislike the apt package manager. yum/dnf handles multiple available versions significantly better. – jordanm Sep 08 '20 at 18:42
  • @jordanm using an RPM wouldn’t help in this case either, because the soname is 3.4 in both cases, so the program would still end up running using 3.4.10 if it was installed alongside 3.4.1. The problem in this instance comes from the library (or its package), not the package manager... – Stephen Kitt Sep 08 '20 at 19:02
  • I was hoping for some clever way to make my package dependent on 3.4.1 exactly. For building, it is possible to specify the dependency version in control file up to the patch number. But the resulting package dependencies are automatically determined by dh_shlibs. What would happen if I explicitely specify libopencv 3.4.1 as the package dependency? – Piotr G Sep 08 '20 at 19:30
  • You can override dh_shlibdeps, see this answer. I’m not sure how well a strict dependency on 3.4.1 will work though. – Stephen Kitt Sep 09 '20 at 07:04

0 Answers0