From a9de87367d4d3606c48303237b64d88e8abc01ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Sat, 8 Oct 2022 12:47:00 +0200 Subject: [PATCH] setup: Assume non-universal devkit build on macOS The setuptools build system typically builds a universal binary, but that requires downloading multiple devkits and combining them. The user may still elect to do that by setting _PYTHON_HOST_PLATFORM, but by default we assume that a non-universal build is desired. --- setup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.py b/setup.py index ab024d4..5030d73 100755 --- a/setup.py +++ b/setup.py @@ -63,6 +63,16 @@ else: "-Wl,-exported_symbol,_PyInit__frida", "-Wl,-dead_strip", ] + if "_PYTHON_HOST_PLATFORM" not in os.environ: + if platform.machine() == "arm64": + host_arch = "arm64" + macos_req = "11.0" + else: + host_arch = "x86_64" + macos_req = "10.9" + os.environ["_PYTHON_HOST_PLATFORM"] = f"macosx-{macos_req}-{host_arch}" + os.environ["ARCHFLAGS"] = f"-arch {host_arch}" + os.environ["MACOSX_DEPLOYMENT_TARGET"] = macos_req else: version_script = os.path.join(package_dir, "src", "_frida.version") if not os.path.exists(version_script):