|
@@ -1,3 +1,16 @@ |
|
|
|
|
|
diff --git a/cx_Freeze/hooks.py b/cx_Freeze/hooks.py |
|
|
|
|
|
index 3474f3e..cd04a2a 100644 |
|
|
|
|
|
--- a/cx_Freeze/hooks.py |
|
|
|
|
|
+++ b/cx_Freeze/hooks.py |
|
|
|
|
|
@@ -97,6 +97,8 @@ def load_cryptography_hazmat_bindings__padding(finder, module): |
|
|
|
|
|
def load__ctypes(finder, module): |
|
|
|
|
|
"""In Windows, the _ctypes module in Python >= 3.8 requires an additional dll |
|
|
|
|
|
libffi-7.dll to be present in the build directory.""" |
|
|
|
|
|
+ # but not for PawPaw |
|
|
|
|
|
+ return |
|
|
|
|
|
if sys.platform == "win32" and sys.version_info >= (3, 8): |
|
|
|
|
|
dll_name = "libffi-7.dll" |
|
|
|
|
|
dll_path = os.path.join(sys.base_prefix, "DLLs", dll_name) |
|
|
diff --git a/setup.py b/setup.py |
|
|
diff --git a/setup.py b/setup.py |
|
|
index af6689f..d7c84a1 100755 |
|
|
index af6689f..d7c84a1 100755 |
|
|
--- a/setup.py |
|
|
--- a/setup.py |
|
@@ -86,3 +99,40 @@ index af6689f..d7c84a1 100755 |
|
|
gui = Extension("cx_Freeze.bases.Win32GUI", ["source/bases/Win32GUI.c"], |
|
|
gui = Extension("cx_Freeze.bases.Win32GUI", ["source/bases/Win32GUI.c"], |
|
|
depends = depends, libraries = libraries + ["user32"]) |
|
|
depends = depends, libraries = libraries + ["user32"]) |
|
|
extensions.append(gui) |
|
|
extensions.append(gui) |
|
|
|
|
|
diff --git a/setup.py b/setup.py |
|
|
|
|
|
index d7c84a1..e0fdcfc 100755 |
|
|
|
|
|
--- a/setup.py |
|
|
|
|
|
+++ b/setup.py |
|
|
|
|
|
@@ -27,6 +27,7 @@ class build_ext(distutils.command.build_ext.build_ext): |
|
|
|
|
|
objects = self.compiler.compile(ext.sources, |
|
|
|
|
|
output_dir = self.build_temp, |
|
|
|
|
|
include_dirs = ext.include_dirs, |
|
|
|
|
|
+ extra_preargs = getoutput("pkg-config --cflags python3").split() + os.getenv("CFLAGS", "").split(), |
|
|
|
|
|
debug = self.debug, |
|
|
|
|
|
depends = ext.depends) |
|
|
|
|
|
fileName = os.path.splitext(self.get_ext_filename(ext.name))[0] |
|
|
|
|
|
@@ -37,13 +38,18 @@ class build_ext(distutils.command.build_ext.build_ext): |
|
|
|
|
|
libraryDirs = ext.library_dirs or [] |
|
|
|
|
|
libraries = self.get_libraries(ext) |
|
|
|
|
|
extraArgs = ext.extra_link_args or [] |
|
|
|
|
|
- compiler_type = self.compiler.compiler_type |
|
|
|
|
|
- if "Win32GUI" in ext.name: |
|
|
|
|
|
- extraArgs.append("-mwindows") |
|
|
|
|
|
+ if "bases" in ext.name: |
|
|
|
|
|
+ if "Win32GUI" in ext.name: |
|
|
|
|
|
+ extraArgs.append("-mwindows") |
|
|
|
|
|
+ else: |
|
|
|
|
|
+ extraArgs.append("-mconsole") |
|
|
|
|
|
+ if sys.version_info[0] == 3: |
|
|
|
|
|
+ extraArgs.append("-municode") |
|
|
|
|
|
+ if not os.path.exists("build/manifest.o"): |
|
|
|
|
|
+ os.system(os.getenv("WINDRES") + " source/bases/manifest.rc build/manifest.o") |
|
|
|
|
|
+ extraArgs.append("build/manifest.o") |
|
|
|
|
|
else: |
|
|
|
|
|
- extraArgs.append("-mconsole") |
|
|
|
|
|
- if sys.version_info[0] == 3: |
|
|
|
|
|
- extraArgs.append("-municode") |
|
|
|
|
|
+ extraArgs.append("-shared") |
|
|
|
|
|
extraArgs += getoutput("pkg-config --libs python3").split() |
|
|
|
|
|
extraArgs += os.getenv("LDFLAGS", "").split() |
|
|
|
|
|
self.compiler.link_executable(objects, fullName, |