Opened 9 years ago

Closed 21 months ago

#46853 closed enhancement (fixed)

VTK @6.1.0 +qt4 variant added

Reported by: joelfred@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: stromnov (Andrey Stromnov), joelfred@…, RJVB (René Bertin)
Port: vtk

Description

Added the option to build VTK with QT4, which is needed by VisIt, a port I am in the process of creating and submitting.

For discussion: should qt4 or qt5 be a default variant?

Also: I have not tested the qt5 variant, but it doesn't look like it should work, since VTK needs configuration environment variables when configuring it to work with qt5. See: http://www.vtk.org/Wiki/VTK/Configure_and_Build#Qt5..2A

Attachments (2)

Portfile-vtk.diff (727 bytes) - added by joelfred@… 9 years ago.
Updates to create qt4 variant in vtk
vtk.diff (2.4 KB) - added by RJVB (René Bertin) 9 years ago.
diff taking into account most of my remarks

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by joelfred@…

Attachment: Portfile-vtk.diff added

Updates to create qt4 variant in vtk

comment:1 Changed 9 years ago by joelfred@…

Cc: joelfred@… added

Cc Me!

comment:2 Changed 9 years ago by joelfred@…

It does warn about vtk violating /opt/local/plugins, but I'm very not sure what that means. I think that's where the plugins are supposed to go, but Macports doesn't know about the ${prefix}/plugins convention so it complains?

comment:3 Changed 9 years ago by RJVB (René Bertin)

If you add Qt support via variants, they typically need to be mutually exclusive, and this port is no exception from what I can see.

I haven't looked at the source code layout, but if you would like to offer both Qt4 and Qt5 support (plugins or however VTK integrates this; something I would encourage you to investigate based on my own work on co-installable Qt ports), you could try making Qt subports that depend on the main VTK port. This *might* work like follows:

  • the main port takes care not to include Qt support.
  • Qt4 subport calls cmake with the appropriate flags in the TLD, and then invokes make in the qt4 (or qt-specific) subdirectory. Installing will be done from that same directory.
  • Qt5 subport calls cmake with the appropriate flags in the TLD, and then invokes make in the qt5 (or qt-specific) subdirectory. Installing will be done from that same directory.

Given how cmake usually works, this will cause anything that the Qt4 or Qt5 support needs to be built, but not the whole VTK tree, which would take way too much time. And it'd only install the files that contain the Qt specific stuff.

Last edited 9 years ago by RJVB (René Bertin) (previous) (diff)

comment:4 in reply to:  2 Changed 9 years ago by RJVB (René Bertin)

Replying to joelfred@…:

It does warn about vtk violating /opt/local/plugins, but I'm very not sure what that means. I think that's where the plugins are supposed to go, but Macports doesn't know about the ${prefix}/plugins convention so it complains?

That plugin directory contains the QVTKWidgetPlugin designer plugin. To be installed correctly, -DVTK_INSTALL_QT_DIR:PATH=${qt_plugins_dir}/designer must be added to the configure arguments.

Edit: that must be a relative path, sadly, so it must be -DVTK_INSTALL_QT_DIR:PATH=share/qtN/plugins/designer (with qtN either qt4 or qt5).

Last edited 9 years ago by RJVB (René Bertin) (previous) (diff)

Changed 9 years ago by RJVB (René Bertin)

Attachment: vtk.diff added

diff taking into account most of my remarks

comment:5 Changed 9 years ago by RJVB (René Bertin)

Promised, I'll be stopping now :)

The last patch version replaces the Qt variants with Qt subports. For now all subports (vtk, vtk-qt4 and vtk-qt5) are all mutually exclusive, I don't know if it can even be otherwise. The advantage of using Qt subports is that dependents can specify the Qt version they require. With variants that would not be possible.

comment:6 Changed 9 years ago by RJVB (René Bertin)

Cc: rjvbertin@… added

Cc Me!

comment:7 Changed 21 months ago by chrstphrchvz (Christopher Chavez)

Resolution: fixed
Status: newclosed

In 4c1551a8c52c6c16584ff6c56e5b8339e8a44661/macports-ports (master):

vtk: drop qt4 variant

VTK 8.2.0 removed support for Qt4.

Closes: #46853
Closes: #53444

Note: See TracTickets for help on using tickets.