Browse Source

Fixup cxfreeze

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.1
falkTX 4 years ago
parent
commit
9817ffa521
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 59 additions and 0 deletions
  1. +9
    -0
      bootstrap-carla.sh
  2. +50
    -0
      patches/cx_Freeze/win32/01_pawpaw-setup.patch

+ 9
- 0
bootstrap-carla.sh View File

@@ -347,4 +347,13 @@ if [ "${CXFREEZE_VERSION}" = "6.4.2" ]; then
fi fi
build_python cx_Freeze "${CXFREEZE_VERSION}" build_python cx_Freeze "${CXFREEZE_VERSION}"


if [ "${WIN32}" -eq 1 ] && [ "${CROSS_COMPILING}" -eq 1 ]; then
if [ ! -e "${PAWPAW_PREFIX}/lib/python3.8/cx_Freeze" ]; then
ln -sv "${PAWPAW_PREFIX}/lib/python3.8/site-packages"/cx_Freeze-*.egg/cx_Freeze "${PAWPAW_PREFIX}/lib/python3.8/cx_Freeze"
fi
if [ ! -e "${PAWPAW_PREFIX}/lib/python3.8/cx_Freeze/util.pyd" ]; then
ln -sv "$(realpath "${PAWPAW_PREFIX}/lib/python3.8/cx_Freeze"/util.*)" "${PAWPAW_PREFIX}/lib/python3.8/cx_Freeze/util.pyd"
fi
fi

# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------

+ 50
- 0
patches/cx_Freeze/win32/01_pawpaw-setup.patch View File

@@ -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,

Loading…
Cancel
Save