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 <ajstewart426@gmail.com>

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
vucoda 2023-11-03 05:33:18 +10:30 committed by GitHub
parent 29a30963b3
commit dd57b58c2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,7 +54,7 @@ class PyPyside2(PythonPackage):
depends_on("cmake@3.1:", type="build") depends_on("cmake@3.1:", type="build")
# libclang versioning from sources/shiboken2/doc/gettingstarted.rst # libclang versioning from sources/shiboken2/doc/gettingstarted.rst
depends_on("llvm@6", type="build", when="@5.12:5.13") 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-setuptools", type="build")
depends_on("py-packaging", type="build") depends_on("py-packaging", type="build")
depends_on("py-wheel", 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("libxslt@1.1.19:", when="+doc", type="build")
depends_on("py-sphinx", 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): def install_options(self, spec, prefix):
args = [ args = [
"--parallel={0}".format(make_jobs), "--parallel={0}".format(make_jobs),