Qt5 & VTK builds. VTK works with Qt 4 and 5.

This commit is contained in:
Todd Gamblin 2015-01-19 14:06:45 -08:00
parent 0211adbdb6
commit b7dacb427d
2 changed files with 101 additions and 15 deletions

View File

@ -3,7 +3,16 @@
class Qt(Package):
"""Qt is a comprehensive cross-platform C++ application framework."""
homepage = "http://qt.io"
list_url = 'http://download.qt-project.org/official_releases/qt/'
list_depth = 2
version('5.4.0', 'e8654e4b37dd98039ba20da7a53877e6',
url='http://download.qt-project.org/official_releases/qt/5.4/5.4.0/single/qt-everywhere-opensource-src-5.4.0.tar.gz')
version('5.3.2', 'febb001129927a70174467ecb508a682',
url='http://download.qt.io/archive/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz')
version('5.2.1', 'a78408c887c04c34ce615da690e0b4c8',
url='http://download.qt.io/archive/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.gz')
version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb',
url="http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz")
@ -20,25 +29,62 @@ class Qt(Package):
depends_on("libmng")
depends_on("jpeg")
depends_on("gperf") # Needed to build Qt with webkit.
def patch(self):
if self.spec.satisfies('@4'):
qmake_conf = 'mkspecs/common/g++-base.conf'
elif self.spec.satisfies('@5'):
qmake_conf = 'qtbase/mkspecs/common/g++-base.conf'
else:
return
# Fix qmake compilers in the default mkspec
qmake_conf = 'mkspecs/common/g++-base.conf'
filter_file(r'^QMAKE_CC *=.*$', 'QMAKE_CC = cc', qmake_conf)
filter_file(r'^QMAKE_CXX *=.*$', 'QMAKE_CXX = c++', qmake_conf)
filter_file(r'^QMAKE_COMPILER *=.*$', 'QMAKE_COMPILER = cc', qmake_conf)
filter_file(r'^QMAKE_CC *=.*$', 'QMAKE_CC = cc', qmake_conf)
filter_file(r'^QMAKE_CXX *=.*$', 'QMAKE_CXX = c++', qmake_conf)
@property
def common_config_args(self):
return [
'-prefix', self.prefix,
'-v',
'-opensource',
"-release",
'-shared',
'-confirm-license',
'-openssl-linked',
'-dbus-linked',
'-optimized-qmake',
'-no-openvg',
'-no-pch',
# For now, disable all the database drivers
"-no-sql-db2", "-no-sql-ibase", "-no-sql-mysql", "-no-sql-oci", "-no-sql-odbc",
"-no-sql-psql", "-no-sql-sqlite", "-no-sql-sqlite2", "-no-sql-tds",
# NIS is deprecated in more recent glibc
"-no-nis"]
@when('@4')
def configure(self):
configure('-no-phonon',
'-no-phonon-backend',
'-fast',
*self.common_config_args)
@when('@5')
def configure(self):
configure('-no-eglfs',
'-no-directfb',
'-qt-xcb',
# If someone wants to get a webkit build working, be my guest!
'-skip', 'qtwebkit',
*self.common_config_args)
def install(self, spec, prefix):
configure('-v',
'-confirm-license',
'-opensource',
'-prefix', prefix,
'-openssl-linked',
'-dbus-linked',
'-fast',
'-optimized-qmake',
'-no-pch',
'-no-phonon',
'-no-phonon-backend',
'-no-openvg')
self.configure()
make()
make("install")

View File

@ -0,0 +1,40 @@
from spack import *
class Vtk(Package):
"""The Visualization Toolkit (VTK) is an open-source, freely
available software system for 3D computer graphics, image
processing and visualization. """
homepage = "http://www.vtk.org"
url = "http://www.vtk.org/files/release/6.1/VTK-6.1.0.tar.gz"
version('6.1.0', '25e4dfb3bad778722dcaec80cd5dab7d')
depends_on("qt")
def install(self, spec, prefix):
with working_dir('spack-build', create=True):
cmake_args = [
"..",
"-DBUILD_SHARED_LIBS=ON",
# Disable wrappers for other languages.
"-DVTK_WRAP_PYTHON=OFF",
"-DVTK_WRAP_JAVA=OFF",
"-DVTK_WRAP_TCL=OFF"]
cmake_args.extend(std_cmake_args)
# Enable Qt support here.
cmake_args.extend([
"-DQT_QMAKE_EXECUTABLE:PATH=%s/qmake" % spec['qt'].prefix.bin,
"-DVTK_Group_Qt:BOOL=ON",
# Ignore webkit because it's hard to build w/Qt
"-DVTK_Group_Qt=OFF",
"-DModule_vtkGUISupportQt:BOOL=ON",
"-DModule_vtkGUISupportQtOpenGL:BOOL=ON"
])
if spec['qt'].satisfies('@5'):
cmake_args.append("-DVTK_QT_VERSION:STRING=5")
cmake(*cmake_args)
make()
make("install")