2014-10-31 06:02:06 +08:00
|
|
|
from spack import *
|
2015-02-09 16:01:07 +08:00
|
|
|
import os
|
2014-10-31 06:02:06 +08:00
|
|
|
|
|
|
|
class Qt(Package):
|
|
|
|
"""Qt is a comprehensive cross-platform C++ application framework."""
|
2016-04-01 02:34:56 +08:00
|
|
|
homepage = 'http://qt.io'
|
2014-10-31 06:02:06 +08:00
|
|
|
|
2016-04-01 02:34:56 +08:00
|
|
|
version('5.5.1', '59f0216819152b77536cf660b015d784')
|
|
|
|
version('5.4.2', 'fa1c4d819b401b267eb246a543a63ea5')
|
|
|
|
version('5.4.0', 'e8654e4b37dd98039ba20da7a53877e6')
|
|
|
|
version('5.3.2', 'febb001129927a70174467ecb508a682')
|
|
|
|
version('5.2.1', 'a78408c887c04c34ce615da690e0b4c8')
|
|
|
|
version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb')
|
|
|
|
version('3.3.8b', '9f05b4125cfe477cc52c9742c3c09009')
|
2015-07-21 23:51:53 +08:00
|
|
|
|
|
|
|
# Add patch for compile issues with qt3 found with use in the OpenSpeedShop project
|
2016-04-01 02:34:56 +08:00
|
|
|
variant('krellpatch', default=False, description="Build with openspeedshop based patch.")
|
|
|
|
variant('mesa', default=False, description="Depend on mesa.")
|
|
|
|
variant('gtk', default=False, description="Build with gtkplus.")
|
|
|
|
|
2015-07-21 23:51:53 +08:00
|
|
|
patch('qt3krell.patch', when='@3.3.8b+krellpatch')
|
|
|
|
|
2014-12-26 08:09:42 +08:00
|
|
|
# Use system openssl for security.
|
|
|
|
#depends_on("openssl")
|
2014-10-31 06:02:06 +08:00
|
|
|
|
2014-12-26 08:09:42 +08:00
|
|
|
depends_on("glib")
|
2016-04-01 02:34:56 +08:00
|
|
|
depends_on("gtkplus", when='+gtk')
|
2014-12-26 08:09:42 +08:00
|
|
|
depends_on("libxml2")
|
|
|
|
depends_on("zlib")
|
2015-07-21 23:51:53 +08:00
|
|
|
depends_on("dbus", when='@4:')
|
2014-12-26 08:09:42 +08:00
|
|
|
depends_on("libtiff")
|
2016-04-14 06:00:45 +08:00
|
|
|
depends_on("libpng@1.2.56", when='@3')
|
|
|
|
depends_on("libpng", when='@4:')
|
2014-12-26 08:09:42 +08:00
|
|
|
depends_on("libmng")
|
|
|
|
depends_on("jpeg")
|
|
|
|
|
2015-02-13 02:01:58 +08:00
|
|
|
# Webkit
|
2015-02-09 16:01:07 +08:00
|
|
|
# depends_on("gperf")
|
|
|
|
# depends_on("flex")
|
|
|
|
# depends_on("bison")
|
|
|
|
# depends_on("ruby")
|
|
|
|
# depends_on("icu4c")
|
|
|
|
|
|
|
|
# OpenGL hardware acceleration
|
2016-02-10 21:58:00 +08:00
|
|
|
depends_on("mesa", when='@4:+mesa')
|
2015-02-09 16:01:07 +08:00
|
|
|
depends_on("libxcb")
|
2015-01-20 06:06:45 +08:00
|
|
|
|
2016-03-21 16:48:18 +08:00
|
|
|
|
2016-04-01 02:34:56 +08:00
|
|
|
def url_for_version(self, version):
|
|
|
|
url = "http://download.qt.io/archive/qt/"
|
|
|
|
|
|
|
|
if version >= Version('5'):
|
|
|
|
url += "%s/%s/single/qt-everywhere-opensource-src-%s.tar.gz" % \
|
|
|
|
(version.up_to(2), version, version)
|
|
|
|
elif version >= Version('4.8'):
|
|
|
|
url += "%s/%s/qt-everywhere-opensource-src-%s.tar.gz" % \
|
|
|
|
(version.up_to(2), version, version)
|
|
|
|
elif version >= Version('4.6'):
|
|
|
|
url += "%s/qt-everywhere-opensource-src-%s.tar.gz" % \
|
|
|
|
(version.up_to(2), version)
|
|
|
|
elif version >= Version('4.0'):
|
|
|
|
url += "%s/qt-x11-opensource-src-%s.tar.gz" % \
|
|
|
|
(version.up_to(2), version)
|
|
|
|
elif version >= Version('3'):
|
|
|
|
url += "%s/qt-x11-free-%s.tar.gz" % \
|
|
|
|
(version.up_to(1), version)
|
|
|
|
elif version >= Version('2.1'):
|
|
|
|
url += "%s/qt-x11-%s.tar.gz" % \
|
|
|
|
(version.up_to(1), version)
|
|
|
|
else:
|
|
|
|
url += "%s/qt-%s.tar.gz" % \
|
|
|
|
(version.up_to(1), version)
|
|
|
|
|
|
|
|
return url
|
|
|
|
|
|
|
|
|
2016-03-21 16:48:18 +08:00
|
|
|
def setup_environment(self, spack_env, env):
|
2016-03-21 17:21:31 +08:00
|
|
|
env.set('QTDIR', self.prefix)
|
2016-03-21 16:48:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
def setup_dependent_environment(self, spack_env, run_env, dspec):
|
2016-03-21 17:21:31 +08:00
|
|
|
spack_env.set('QTDIR', self.prefix)
|
2016-03-21 16:48:18 +08:00
|
|
|
|
2015-02-09 11:41:17 +08:00
|
|
|
|
2014-12-26 08:09:42 +08:00
|
|
|
def patch(self):
|
2015-01-20 06:06:45 +08:00
|
|
|
if self.spec.satisfies('@4'):
|
2015-03-28 07:56:15 +08:00
|
|
|
qmake_conf = 'mkspecs/common/g++-base.conf'
|
|
|
|
qmake_unix_conf = 'mkspecs/common/g++-unix.conf'
|
2015-01-20 06:06:45 +08:00
|
|
|
elif self.spec.satisfies('@5'):
|
2015-03-28 07:56:15 +08:00
|
|
|
qmake_conf = 'qtbase/mkspecs/common/g++-base.conf'
|
|
|
|
qmake_unix_conf = 'qtbase/mkspecs/common/g++-unix.conf'
|
2015-01-20 06:06:45 +08:00
|
|
|
else:
|
|
|
|
return
|
|
|
|
|
2014-12-26 08:09:42 +08:00
|
|
|
# Fix qmake compilers in the default mkspec
|
2015-01-20 06:06:45 +08:00
|
|
|
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)
|
2015-03-28 07:56:15 +08:00
|
|
|
filter_file(r'^QMAKE_LFLAGS_NOUNDEF *\+?=.*$', 'QMAKE_LFLAGS_NOUNDEF =', qmake_unix_conf)
|
2014-12-26 08:09:42 +08:00
|
|
|
|
2015-02-19 03:08:25 +08:00
|
|
|
|
|
|
|
@property
|
|
|
|
def common_config_args(self):
|
|
|
|
return [
|
|
|
|
'-prefix', self.prefix,
|
|
|
|
'-v',
|
|
|
|
'-opensource',
|
|
|
|
'-opengl',
|
2016-04-01 02:34:56 +08:00
|
|
|
'-release',
|
2015-02-19 03:08:25 +08:00
|
|
|
'-shared',
|
|
|
|
'-confirm-license',
|
|
|
|
'-openssl-linked',
|
|
|
|
'-dbus-linked',
|
|
|
|
'-optimized-qmake',
|
|
|
|
'-no-openvg',
|
|
|
|
'-no-pch',
|
|
|
|
# NIS is deprecated in more recent glibc
|
2016-04-01 02:34:56 +08:00
|
|
|
'-no-nis']
|
2015-02-25 02:42:35 +08:00
|
|
|
# Don't disable all the database drivers, but should
|
|
|
|
# really get them into spack at some point.
|
2015-02-19 03:08:25 +08:00
|
|
|
|
2015-07-21 23:51:53 +08:00
|
|
|
@when('@3')
|
|
|
|
def configure(self):
|
2016-04-14 06:00:45 +08:00
|
|
|
# An user report that this was necessary to link Qt3 on ubuntu
|
|
|
|
os.environ['LD_LIBRARY_PATH'] = os.getcwd()+'/lib'
|
2015-07-21 23:51:53 +08:00
|
|
|
configure('-prefix', self.prefix,
|
|
|
|
'-v',
|
|
|
|
'-thread',
|
|
|
|
'-shared',
|
|
|
|
'-release',
|
|
|
|
'-fast'
|
|
|
|
)
|
2015-02-19 03:08:25 +08:00
|
|
|
|
|
|
|
@when('@4')
|
|
|
|
def configure(self):
|
|
|
|
configure('-fast',
|
|
|
|
'-no-webkit',
|
|
|
|
*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)
|
|
|
|
|
|
|
|
|
2014-12-26 08:09:42 +08:00
|
|
|
def install(self, spec, prefix):
|
2015-02-19 03:08:25 +08:00
|
|
|
self.configure()
|
2014-10-31 06:02:06 +08:00
|
|
|
make()
|
|
|
|
make("install")
|