nixpkgs/pkgs/development/python-modules/pyside2/nix_compile_cflags.patch
Mitchell Pleune b65dfc3161 Update pyside2/shiboken2 and sip4 to Python 3.12
These are both Python QT 5 modules, which have issues with Python 3.12
that are fixed in never versions, yet many packages depend on them.

Sip4 was as simple as installing and switching over to setuptools (to
replace the now removed distutils).

pyside/shiboken was much more involved. I ended up pulling the required
patches from the Ubuntu release repositories. The existing patch to fix
clang's include headers needed an update as well, but was still
required.

There is some unsightly find-and-replace going on to replace distutils
with setuptools. This is because, although setuptools now creates the
"distutils" import module, it has to be itself imported first before
that can happen. I Used this widespread find-and-replace as it does
function properly, and should be extremly flexable for future versions
(no needing to update patches on each release).
2024-08-07 11:06:13 -04:00

24 lines
1.1 KiB
Diff

diff --git a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
index add278a..2626eb6 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
+++ b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
@@ -349,11 +349,15 @@ QByteArrayList emulatedCompilerOptions()
// Append the c++ include paths since Clang is unable to find
// <type_traits> etc (g++ 11.3).
- const HeaderPaths gppPaths = gppInternalIncludePaths(compilerFromCMake(QStringLiteral("g++")));
+ const HeaderPaths gppPaths = gppInternalIncludePaths(QStringLiteral("g++"));
for (const HeaderPath &h : gppPaths) {
- if (h.path.contains("c++")
- || h.path.contains("sysroot")) { // centOS
+ // PySide2 requires that Qt headers are not -isystem
+ // https://bugreports.qt.io/browse/PYSIDE-787
+ if (!h.path.contains("-qt")) {
+ // add using -isystem
headerPaths.append(h);
+ } else {
+ headerPaths.append({h.path, HeaderType::Standard});
}
}
#else