qt: Use more system dependencies and fix build with new gcc versions (#10817)
qt currently falls back to bundled versions of sqlite, harfbuzz, pcre, double-conversion and xcb. This adds the appropriate dependencies and configure arguments. A new variant adds multibyte support to pcre and pcre2, which is required by qt. Additionally, newer versions of gcc (starting with @8.3.0) cause build failures. This adds a patch to fix the problem. The changes have been tested with all versions of qt currently available in Spack. 5.2 and 5.3 do not build for reasons that seem to be unrelated to these changes, though.
This commit is contained in:
parent
a79230c832
commit
65f37746af
@ -25,6 +25,9 @@ class Pcre(AutotoolsPackage):
|
||||
variant('jit', default=False,
|
||||
description='Enable JIT support.')
|
||||
|
||||
variant('multibyte', default=True,
|
||||
description='Enable support for 16 and 32 bit characters.')
|
||||
|
||||
variant('utf', default=True,
|
||||
description='Enable support for UTF-8/16/32, '
|
||||
'incompatible with EBCDIC.')
|
||||
@ -35,6 +38,10 @@ def configure_args(self):
|
||||
if '+jit' in self.spec:
|
||||
args.append('--enable-jit')
|
||||
|
||||
if '+multibyte' in self.spec:
|
||||
args.append('--enable-pcre16')
|
||||
args.append('--enable-pcre32')
|
||||
|
||||
if '+utf' in self.spec:
|
||||
args.append('--enable-utf')
|
||||
args.append('--enable-unicode-properties')
|
||||
|
@ -16,3 +16,15 @@ class Pcre2(AutotoolsPackage):
|
||||
|
||||
version('10.31', 'e0b91c891a3c49050f7fd15de33d0ba4')
|
||||
version('10.20', 'dcd027c57ecfdc8a6c3af9d0acf5e3f7')
|
||||
|
||||
variant('multibyte', default=True,
|
||||
description='Enable support for 16 and 32 bit characters.')
|
||||
|
||||
def configure_args(self):
|
||||
args = []
|
||||
|
||||
if '+multibyte' in self.spec:
|
||||
args.append('--enable-pcre2-16')
|
||||
args.append('--enable-pcre2-32')
|
||||
|
||||
return args
|
||||
|
@ -17,6 +17,7 @@ class Qt(Package):
|
||||
list_url = 'http://download.qt.io/archive/qt/'
|
||||
list_depth = 3
|
||||
|
||||
version('5.11.3', '859417642713cee2493ee3646a7fee782c9f1db39e41d7bb1322bba0c5f0ff4d')
|
||||
version('5.11.2', 'c6104b840b6caee596fa9a35bc5f57f67ed5a99d6a36497b6fe66f990a53ca81')
|
||||
version('5.10.0', 'c5e275ab0ed7ee61d0f4b82cd471770d')
|
||||
version('5.9.1', '77b4af61c49a09833d4df824c806acaf')
|
||||
@ -78,6 +79,14 @@ class Qt(Package):
|
||||
# https://github.com/spack/spack/issues/9209
|
||||
patch('qt4-gcc-and-webkit.patch', when='@4')
|
||||
|
||||
# Fix build failure with newer versions of GCC
|
||||
# https://bugreports.qt.io/browse/QTBUG-74196
|
||||
patch('https://github.com/qt/qtscript/commit/97ec1d1882a83c23c91f0f7daea48e05858d8c32.patch',
|
||||
sha256='ae88481a3ff63ab058cf9da6f5ae4397a983903109d907fb2ce4fcf91f9ca5e6',
|
||||
working_dir='qtscript',
|
||||
when='@5.0:5.12 %gcc@8.3:')
|
||||
|
||||
depends_on("pkgconfig", type='build')
|
||||
# Use system openssl for security.
|
||||
depends_on("openssl@:1.0", when='@:5.9')
|
||||
depends_on("openssl")
|
||||
@ -94,6 +103,11 @@ class Qt(Package):
|
||||
depends_on("icu4c")
|
||||
depends_on("fontconfig", when=(sys.platform != 'darwin')) # (Unix only)
|
||||
depends_on("freetype")
|
||||
depends_on("sqlite")
|
||||
depends_on("pcre+multibyte", when='@5.0:5.8')
|
||||
depends_on("pcre2+multibyte", when='@5.9:')
|
||||
depends_on("double-conversion", when='@5.7:')
|
||||
depends_on("harfbuzz", when='@5:')
|
||||
|
||||
# Core options:
|
||||
# -doubleconversion [system/qt/no]
|
||||
@ -116,7 +130,14 @@ class Qt(Package):
|
||||
|
||||
# OpenGL hardware acceleration
|
||||
depends_on("gl@3.2:", when='@4:+opengl')
|
||||
# xcb is Linux-specific
|
||||
depends_on("libxcb", when=sys.platform != 'darwin')
|
||||
depends_on("xcb-util-image", when=sys.platform != 'darwin')
|
||||
depends_on("xcb-util-keysyms", when=sys.platform != 'darwin')
|
||||
depends_on("xcb-util-wm", when=sys.platform != 'darwin')
|
||||
depends_on("xcb-util-renderutil", when=sys.platform != 'darwin')
|
||||
depends_on("libxkbcommon", when=sys.platform != 'darwin')
|
||||
depends_on("inputproto", when='@:5.8')
|
||||
depends_on("libx11", when=sys.platform != 'darwin')
|
||||
|
||||
if sys.platform != 'darwin':
|
||||
@ -235,9 +256,17 @@ def common_config_args(self):
|
||||
'-optimized-qmake',
|
||||
'-system-freetype',
|
||||
'-I{0}/freetype2'.format(self.spec['freetype'].prefix.include),
|
||||
'-no-pch'
|
||||
'-no-pch',
|
||||
'-system-sqlite'
|
||||
]
|
||||
|
||||
if self.spec.satisfies('@5:'):
|
||||
config_args.append('-system-harfbuzz')
|
||||
config_args.append('-system-pcre')
|
||||
|
||||
if self.spec.satisfies('@5.7:'):
|
||||
config_args.append('-system-doubleconversion')
|
||||
|
||||
if sys.platform != 'darwin':
|
||||
config_args.append('-fontconfig')
|
||||
|
||||
@ -353,7 +382,7 @@ def configure(self):
|
||||
|
||||
if not sys.platform == 'darwin':
|
||||
config_args.extend([
|
||||
'-qt-xcb',
|
||||
'-system-xcb',
|
||||
])
|
||||
|
||||
if '~webkit' in self.spec:
|
||||
@ -372,6 +401,9 @@ def configure(self):
|
||||
# https://wiki.qt.io/QtWayland
|
||||
config_args.extend(['-skip', 'wayland'])
|
||||
|
||||
if self.spec.satisfies('@5.7'):
|
||||
config_args.extend(['-skip', 'virtualkeyboard'])
|
||||
|
||||
configure('-no-eglfs',
|
||||
'-no-directfb',
|
||||
'-{0}gtk'.format('' if '+gtk' in self.spec else 'no-'),
|
||||
|
Loading…
Reference in New Issue
Block a user