Blob Blame History Raw
From: Dmitry Shachnev <mitya57@debian.org>
Date: Thu, 17 Jun 2021 17:12:27 +0300
Subject: Add support for building with SIP v6

Forwarded: https://github.com/wxWidgets/Phoenix/pull/1916
---
 buildtools/wxpysip.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/buildtools/wxpysip.py b/buildtools/wxpysip.py
index c58102b..be66e19 100644
--- a/buildtools/wxpysip.py
+++ b/buildtools/wxpysip.py
@@ -62,8 +62,12 @@ def sip_runner(
         abi_major, abi_minor = resolve_abi_version(abi_version).split('.')
 
         # Set the globals.
-        set_globals(SIP_VERSION, SIP_VERSION_STR, int(abi_major), int(abi_minor),
-                UserException, include_dirs)
+        if (SIP_VERSION >> 16) >= 6:
+            set_globals(SIP_VERSION, SIP_VERSION_STR, int(abi_major), int(abi_minor),
+                    sip_module, UserException, include_dirs)
+        else:
+            set_globals(SIP_VERSION, SIP_VERSION_STR, int(abi_major), int(abi_minor),
+                    UserException, include_dirs)
 
         # Parse the input file.
         pt, _, _, _, tags, disabled_features = parse(specification,
@@ -72,9 +76,14 @@ def sip_runner(
 
         # Generate the bindings.
         if sources_dir is not None:
-            generated_files = generateCode(pt, sources_dir, source_suffix,
-                    exceptions, tracing, release_gil, parts, tags,
-                    disabled_features, docstrings, py_debug, sip_module)
+            if (SIP_VERSION >> 16) >= 6:
+                generated_files = generateCode(pt, sources_dir, source_suffix,
+                        exceptions, tracing, release_gil, parts, tags,
+                        disabled_features, docstrings, py_debug)
+            else:
+                generated_files = generateCode(pt, sources_dir, source_suffix,
+                        exceptions, tracing, release_gil, parts, tags,
+                        disabled_features, docstrings, py_debug, sip_module)
 
         if sbf_file is not None:
             generateBuildFile(sbf_file, generated_files)