From 9936182f601dbb0a6f818144d1a57e09e92e736a Mon Sep 17 00:00:00 2001 From: "Seth R. Johnson" Date: Sat, 29 May 2021 14:53:25 -0400 Subject: qt: skip multimedia when ~opengl (#23989) * qt: skip multimedia when ~opengl On 5.9 on macOS the multimedia option causes build errors; on other platforms and versions it should probably be assumed inoperative anyway. * qt: Omit flags when disabling multimedia ``` ERROR: Unknown command line option '-no-pulseaudio'. ``` * Work around another qt@5.9 error * qt: Fix build error on darwin --- var/spack/repos/builtin/packages/qt/package.py | 29 ++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 59082fa3de..26b205f253 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -199,7 +199,7 @@ class Qt(Package): conflicts('+framework', msg="QT cannot be built as a framework except on macOS.") else: - conflicts('platform=darwin', when='@4.8.6', + conflicts('platform=darwin', when='@:4.8.6', msg="QT 4 for macOS is only patched for 4.8.7") use_xcode = True @@ -413,6 +413,13 @@ class Qt(Package): with open(conf_file, 'a') as f: f.write("QMAKE_CXXFLAGS += -std=gnu++98\n") + @when('@5.9 platform=darwin') + def patch(self): + # 'javascriptcore' is in the include path, so its file named 'version' + # interferes with the standard library + os.unlink(join_path(self.stage.source_path, + 'qtscript/src/3rdparty/javascriptcore/version')) + @property def common_config_args(self): spec = self.spec @@ -575,13 +582,14 @@ class Qt(Package): ]) if MACOS_VERSION: - config_args.extend([ - '-no-xcb-xlib', - '-no-pulseaudio', - '-no-alsa', - ]) + if version < Version('5.9'): + config_args.append('-no-xcb-xlib') if version < Version('5.12'): config_args.append('-no-xinput2') + if spec.satisfies('@5.9'): + # Errors on bluetooth even when bluetooth is disabled... + # at least on apple-clang%12 + config_args.extend(['-skip', 'connectivity']) elif version < Version('5.15') and '+gui' in spec: # Linux-only QT5 dependencies config_args.append('-system-xcb') @@ -602,6 +610,7 @@ class Qt(Package): config_args.extend(['-skip', 'wayland']) if '~opengl' in spec: + config_args.extend(['-skip', 'multimedia']) if version >= Version('5.10'): config_args.extend([ '-skip', 'webglplugin', @@ -613,6 +622,14 @@ class Qt(Package): if version >= Version('5.15'): config_args.extend(['-skip', 'qtlocation']) + elif MACOS_VERSION: + # These options are only valid if 'multimedia' is enabled, i.e. + # +opengl is selected. Force them to be off on macOS, but let other + # platforms decide for themselves. + config_args.extend([ + '-no-pulseaudio', + '-no-alsa', + ]) configure(*config_args) -- cgit v1.2.3-60-g2f50