Bug#947986: vtk7: Doesn't build on ports without java

Samuel Thibault sthibault at debian.org
Fri Jan 3 01:27:04 GMT 2020


Source: vtk7
Version: 7.1.1+dfsg2-1
Severity: important
Tags: patch
User: debian-hurd at lists.debian.org
Usertags: hurd

Hello,

vtk7 currently doesn't build on ports without java support. The attached
patch fix that: it disables the default-jdk and libvtk7-java build-deps
on non-java ports, they enable the libvtk7-jni/java packages only on java
ports, pass -DVTK_WRAP_JAVA=ON to configure only on java ports, and install
java bits 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
Now, it we had this sort of thing:
  yield -a     for yield to all traffic
  yield -t     for yield to trucks
  yield -f     for yield to people walking (yield foot)
  yield -d t*  for yield on days starting with t
...you'd have a lot of dead people at intersections, and traffic jams you
wouldn't believe...
(Discussion in comp.os.linux.misc on the intuitiveness of commands.)
-------------- next part --------------
--- debian/control.original	2020-01-02 12:46:30.000000000 +0000
+++ debian/control	2020-01-02 12:47:41.000000000 +0000
@@ -7,7 +7,7 @@
 Build-Depends: chrpath,
                cmake (>= 3.2.0),
                debhelper (>= 9),
-               default-jdk,
+               default-jdk [!hppa !hurd-any !kfreebsd-any],
                default-libmysqlclient-dev,
                dh-python,
                libftgl-dev,
@@ -110,7 +110,7 @@
          libtheora-dev,
          libtiff-dev,
          libvtk7.1p (= ${binary:Version}),
-         libvtk7-java (= ${binary:Version}),
+         libvtk7-java (= ${binary:Version}) [!hppa !hurd-any !kfreebsd-any],
          libx11-dev,
          libxft-dev,
          libxml2-dev,
@@ -187,7 +187,7 @@
  that use VTK. Qt files
 
 Package: libvtk7-jni
-Architecture: any
+Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32
 Section: java
 Depends: ${java:Depends},
          ${misc:Depends},
@@ -202,7 +202,7 @@
  This package provides the VTK Java language support.
 
 Package: libvtk7-java
-Architecture: any
+Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32
 Section: java
 Depends: libvtk7-jni (= ${binary:Version}),
          ${java:Depends},
--- debian/rules.original	2020-01-02 12:47:46.000000000 +0000
+++ debian/rules	2020-01-02 12:50:59.000000000 +0000
@@ -14,21 +14,25 @@
   export DEB_CXXFLAGS_MAINT_APPEND=-ffloat-store
 endif 
 
-ifeq ($(DEB_BUILD_ARCH),$(filter $(DEB_BUILD_ARCH),hppa hurd-i386))
-        JAVA_VERSION=1.5
+extra_flags=
+
+nojava_archs=hppa hurd-i386 kfreebsd-i386 kfreebsd-amd64
+ifeq ($(DEB_BUILD_ARCH),$(filter $(DEB_BUILD_ARCH), $(nojava_archs)))
+        JAVA_VERSION=
 else
         JAVA_VERSION=1.8
+        extra_flags += -DVTK_WRAP_JAVA=ON
 endif
 
 noqt_archs="" 
 ifeq ($(DEB_BUILD_ARCH),$(filter $(DEB_BUILD_ARCH), $(noqt_archs)))
-        extra_flags=-DVTK_Group_Qt=OFF \
-                    -DMODULE_vtkParseOGLExt=ON  \
-                    -DModule_vtkWrappingTools=ON \
-                    -DModule_vtkRenderingSceneGraph=ON \
-                    -DModule_vtkIOExportOpenGL2=ON \
-                    -DModule_vtkPython=ON \
-                    -DVTK_BUILD_ALL_MODULES=OFF
+        extra_flags += -DVTK_Group_Qt=OFF \
+                       -DMODULE_vtkParseOGLExt=ON  \
+                       -DModule_vtkWrappingTools=ON \
+                       -DModule_vtkRenderingSceneGraph=ON \
+                       -DModule_vtkIOExportOpenGL2=ON \
+                       -DModule_vtkPython=ON \
+                       -DVTK_BUILD_ALL_MODULES=OFF
 else
         extra_flags += -DVTK_QT_VERSION=5 \
                        -DVTK_Group_Qt=ON \
@@ -53,7 +57,6 @@
         -DVTK_JAVA_SOURCE_VERSION=$(JAVA_VERSION) \
         -DVTK_JAVA_TARGET_VERSION=$(JAVA_VERSION) \
 	-DVTK_USE_TK=ON \
-	-DVTK_WRAP_JAVA=ON \
 	-DVTK_WRAP_PYTHON=ON \
         -DVTK_PYTHON_VERSION:STRING=3 \
 	-DVTK_WRAP_TCL=ON \
@@ -121,11 +124,13 @@
 override_dh_auto_install:
 	pwd
 	dh_auto_install -X.pyc -X.pyo
+ifneq ($(JAVA_VERSION),)
 	# Modify vtkWrapJava.cmake to properly upload JavaDependencies.cmake.in	from $VTK_DIR
 	perl -pi -e "s|{dir}/JavaDependencies.cmake.in\"|{VTK_DIR}/JavaDependencies.cmake.in\"|" debian/tmp/usr/lib/cmake/vtk-7.1/vtkWrapJava.cmake
 	# Correct headers for paraview
 	perl -pi.bak -e "s|cxx|include|g" ThirdParty/netcdf/vtk_netcdfcpp.h
 	mv $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/vtk.jar $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/vtk7.jar
+endif
 	mv $(CURDIR)/debian/build/bin/vtkpython $(CURDIR)/debian/build/bin/vtk7python
 	sed -i -e "s/FATAL_ERROR/STATUS/g" $(CURDIR)/debian/tmp/usr/lib/cmake/vtk-7.1/VTKTargets.cmake
 	chrpath -d $(CURDIR)/debian/build/bin/vtk7python


More information about the debian-science-maintainers mailing list