Bug#948248: opencv: Doesn't build on ports without java

Samuel Thibault sthibault at debian.org
Sun Jan 5 22:56:33 GMT 2020


Source: opencv
Version: 4.1.2+dfsg-5
Severity: important
Tags: patch
User: debian-hurd at lists.debian.org
Usertags: hurd

Hello,

opencv currently doesn't build on ports without java support. The
attached patch fix that: it disables the ant, default-jdk, and
maven-repo-helper build-deps on non-java ports, they enable the
libopencv4.1-jni package only on java ports, and enable the dh java
helpers and pass -DBUILD_JAVA=ON to configure only on java ports.

Samuel

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'proposed-updates'), (500, 'oldstable-proposed-updates-debug'), (500, 'oldstable-proposed-updates'), (500, 'oldoldstable'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.4.0 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Samuel
<B> l'alim je sais où elle est, elle est juste à côté de la dame qui dort
<g> B: clairement faut revoir les priorités dans la vie
<g> B: une dame ça se retrouve, un uptime...
-------------- next part --------------
--- debian/control.original	2020-01-01 19:26:38.000000000 +0000
+++ debian/control	2020-01-02 12:53:28.000000000 +0000
@@ -7,10 +7,10 @@
  Nobuhiro Iwamatsu <iwamatsu at debian.org>,
  Mo Zhou <cdluminate at gmail.com>,
 Build-Depends:
- ant,
+ ant [!hppa !hurd-any !kfreebsd-any],
  cmake (>= 2.8.7),
  debhelper (>= 11),
- default-jdk,
+ default-jdk [!hppa !hurd-any !kfreebsd-any],
  dh-python,
  doxygen,
  javahelper,
@@ -42,7 +42,7 @@
  libvtk6-dev,
  libvtkgdcm-dev [!alpha !ppc64 !riscv64 !x32],
  libgdcm-tools,
- maven-repo-helper,
+ maven-repo-helper [!hppa !hurd-any !kfreebsd-any],
  ocl-icd-opencl-dev,
  protobuf-compiler,
  python3-dev,
@@ -1228,7 +1228,7 @@
 
 Package: libopencv4.1-jni
 Section: java
-Architecture: any
+Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32
 Depends:
  libopencv-calib3d4.1 (= ${binary:Version}),
  libopencv-highgui4.1 (= ${binary:Version}),
--- debian/rules.original	2020-01-01 19:27:07.000000000 +0000
+++ debian/rules	2020-01-05 21:45:22.000000000 +0000
@@ -40,6 +40,12 @@
 CMAKE_ARCH_FLAGS += -DWITH_1394=OFF -DWITH_V4L=OFF
 endif
 
+# Java support
+ifeq (,$(findstring $(DEB_HOST_ARCH), hppa hurd-i386 kfreebsd-i386 kfreebsd-amd64))
+DH_HELPERS = ,javahelper,jh_maven_repo_helper
+CMAKE_ARCH_FLAGS += -DBUILD_JAVA=ON
+endif
+
 # mitigate compiler OOM during build
 ifeq ($(DEB_HOST_ARCH),mipsel)
 export DEB_BUILD_OPTIONS=noopt
@@ -52,7 +58,6 @@
 	-GNinja \
 	-DANT_EXECUTABLE=/usr/bin/ant \
 	-DBUILD_EXAMPLES=ON	\
-	-DBUILD_JAVA=ON \
 	-DBUILD_PROTOBUF=OFF \
 	-DBUILD_TESTS=ON \
 	-DBUILD_PERF_TESTS=OFF \
@@ -104,7 +108,7 @@
 	$(CMAKE_ARCH_FLAGS)
 
 %:
-	dh $@ --with python3,javahelper,jh_maven_repo_helper
+	dh $@ --with python3$(DH_HELPERS)
 
 override_dh_clean:
 	rm -rvf modules/python/src2/hdr_parser.pyc


More information about the debian-science-maintainers mailing list