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

Samuel Thibault sthibault at debian.org
Wed Jan 8 00:29:33 GMT 2020


Samuel Thibault, le dim. 05 janv. 2020 23:56:33 +0100, a ecrit:
> 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.

The attached version additionally drops the libopencv4.1-java from
libopencv-dev, otherwise it is uninstallable.

Samuel
-------------- next part --------------
diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -ur ../tmp/opencv-4.1.2+dfsg/debian/control debian/control
--- ../tmp/opencv-4.1.2+dfsg/debian/control	2019-11-24 07:53:15.000000000 +0100
+++ debian/control	2020-01-02 13:05:15.000000000 +0100
@@ -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,
@@ -101,7 +101,7 @@
  libopencv-videoio-dev (= ${binary:Version}),
  libopencv-videostab-dev (= ${binary:Version}),
  libopencv-viz-dev (= ${binary:Version}),
- libopencv4.1-java (= ${source:Version}),
+ libopencv4.1-java (= ${source:Version}) [!hppa !hurd-any !kfreebsd-any],
  pkg-config,
  ${misc:Depends},
  ${shlibs:Depends},
@@ -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}),
diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -ur ../tmp/opencv-4.1.2+dfsg/debian/rules debian/rules
--- ../tmp/opencv-4.1.2+dfsg/debian/rules	2019-11-24 07:53:15.000000000 +0100
+++ debian/rules	2020-01-02 13:05:15.000000000 +0100
@@ -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