From dd57b58c2fa830464e426686308c85b6e089624e Mon Sep 17 00:00:00 2001 From: vucoda Date: Fri, 3 Nov 2023 05:33:18 +1030 Subject: [PATCH] py-pyside2: fix to build with newer llvm and to use spack install headers (#40544) * Fix py-pyside2 to build with newer llvm and to use spack libglx and libxcb headers where system headers are missing pyside2 needs LLVM_INSTALL_DIR to be set when using llvm 11: and expects system headers for libglx and libxcb and won't build otherwise. * Fix styling * remove raw string type * Update var/spack/repos/builtin/packages/py-pyside2/package.py Co-authored-by: Adam J. Stewart --------- Co-authored-by: Adam J. Stewart --- .../builtin/packages/py-pyside2/package.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/py-pyside2/package.py b/var/spack/repos/builtin/packages/py-pyside2/package.py index e6ee1f8cc8..b13f0c1aac 100644 --- a/var/spack/repos/builtin/packages/py-pyside2/package.py +++ b/var/spack/repos/builtin/packages/py-pyside2/package.py @@ -54,7 +54,7 @@ class PyPyside2(PythonPackage): depends_on("cmake@3.1:", type="build") # libclang versioning from sources/shiboken2/doc/gettingstarted.rst depends_on("llvm@6", type="build", when="@5.12:5.13") - depends_on("llvm@10", type="build", when="@5.15") + depends_on("llvm@10:", type="build", when="@5.15:") depends_on("py-setuptools", type="build") depends_on("py-packaging", type="build") depends_on("py-wheel", type="build") @@ -69,6 +69,23 @@ class PyPyside2(PythonPackage): depends_on("libxslt@1.1.19:", when="+doc", type="build") depends_on("py-sphinx", when="+doc", type="build") + def patch(self): + filter_file( + "=${shiboken_include_dirs}", + ":".join( + [ + "=${shiboken_include_dirs}", + self.spec["qt"]["glx"]["libglx"].prefix.include, + self.spec["qt"]["libxcb"].prefix.include, + ] + ), + "sources/pyside2/cmake/Macros/PySideModules.cmake", + string=True, + ) + + def setup_build_environment(self, env): + env.set("LLVM_INSTALL_DIR", self.spec["llvm"].prefix) + def install_options(self, spec, prefix): args = [ "--parallel={0}".format(make_jobs),