diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index 5e0ddef22..60ecaf926 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -105,6 +105,12 @@ def install_pypy(version: str, url: str) -> str: download(url, os.path.join("/tmp", pypy_tar_bz2)) call(['tar', '-C', '/tmp', '-xf', os.path.join("/tmp", pypy_tar_bz2)]) + # fix PyPy 7.2.0 bug resulting in wrong macOS platform tag + if "-v7.2.0-" in url: + patch_file = os.path.abspath(os.path.join(os.path.dirname(__file__), 'resources', 'pypy3.6-7.2.0.patch')) + sysconfigdata_file = os.path.join(installation_path, 'lib_pypy', '_sysconfigdata.py') + call(['patch', sysconfigdata_file, patch_file, '-N']) # Always has nonzero return code + installation_bin_path = os.path.join(installation_path, 'bin') python_executable = 'pypy3' if version[0] == '3' else 'pypy' pip_executable = 'pip3' if version[0] == '3' else 'pip' diff --git a/cibuildwheel/resources/pypy3.6-7.2.0.patch b/cibuildwheel/resources/pypy3.6-7.2.0.patch new file mode 100644 index 000000000..512cbd5e9 --- /dev/null +++ b/cibuildwheel/resources/pypy3.6-7.2.0.patch @@ -0,0 +1,7 @@ +--- a/lib_pypy/_sysconfigdata.py Tue Jan 28 22:54:59 2020 +0200 ++++ b/lib_pypy/_sysconfigdata.py Wed Jan 29 19:21:23 2020 +0200 +@@ -47,3 +47,4 @@ + build_time_vars['CC'] += ' -arch %s' % (arch,) + if "CXX" in build_time_vars: + build_time_vars['CXX'] += ' -arch %s' % (arch,) ++ build_time_vars['MACOSX_DEPLOYMENT_TARGET'] = '10.7'