-
Notifications
You must be signed in to change notification settings - Fork 2k
Fixed Python version support. #3283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f4f08e6
bf4737a
c787f27
4f7e6a6
a870db2
285c0a8
bdb5e05
4325bb8
02e65ae
81f185e
c681ef9
89bb823
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,6 @@ class Python3Recipe(TargetPythonRecipe): | |
| ''' | ||
|
|
||
| version = '3.14.2' | ||
| _p_version = Version(version) | ||
| url = 'https://github.com/python/cpython/archive/refs/tags/v{version}.tar.gz' | ||
| name = 'python3' | ||
|
|
||
|
|
@@ -64,28 +63,6 @@ class Python3Recipe(TargetPythonRecipe): | |
| 'patches/reproducible-buildinfo.diff', | ||
| ] | ||
|
|
||
| if _p_version.major == 3 and _p_version.minor == 7: | ||
| patches += [ | ||
| 'patches/py3.7.1_fix-ctypes-util-find-library.patch', | ||
| 'patches/py3.7.1_fix-zlib-version.patch', | ||
| ] | ||
|
|
||
| if 8 <= _p_version.minor <= 10: | ||
| patches.append('patches/py3.8.1.patch') | ||
|
|
||
| if _p_version.minor >= 11: | ||
| patches.append('patches/cpython-311-ctypes-find-library.patch') | ||
|
|
||
| if _p_version.minor >= 14: | ||
| patches.append('patches/3.14_armv7l_fix.patch') | ||
| patches.append('patches/3.14_fix_remote_debug.patch') | ||
|
|
||
| if shutil.which('lld') is not None: | ||
| if _p_version.minor == 7: | ||
| patches.append("patches/py3.7.1_fix_cortex_a8.patch") | ||
| elif _p_version.minor >= 8: | ||
| patches.append("patches/py3.8.1_fix_cortex_a8.patch") | ||
|
|
||
| depends = ['hostpython3', 'sqlite3', 'openssl', 'libffi'] | ||
| # those optional depends allow us to build python compression modules: | ||
| # - _bz2.so | ||
|
|
@@ -116,11 +93,6 @@ class Python3Recipe(TargetPythonRecipe): | |
| 'ac_cv_header_bzlib_h=no', | ||
| ] | ||
|
|
||
| if _p_version.minor >= 11: | ||
| configure_args.extend([ | ||
| '--with-build-python={python_host_bin}', | ||
| ]) | ||
|
|
||
| '''The configure arguments needed to build the python recipe. Those are | ||
| used in method :meth:`build_arch` (if not overwritten like python3's | ||
| recipe does). | ||
|
|
@@ -210,6 +182,34 @@ def link_version(self): | |
| flags=flags | ||
| ) | ||
|
|
||
| def apply_patches(self, arch, build_dir=None): | ||
|
|
||
| _p_version = Version(self.version) | ||
| if _p_version.major == 3 and _p_version.minor == 7: | ||
| self.patches += [ | ||
| 'patches/py3.7.1_fix-ctypes-util-find-library.patch', | ||
| 'patches/py3.7.1_fix-zlib-version.patch', | ||
| ] | ||
GvozdevLeonid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if 8 <= _p_version.minor <= 10: | ||
| self.patches.append('patches/py3.8.1.patch') | ||
|
|
||
| if _p_version.minor >= 11: | ||
| self.patches.append('patches/cpython-311-ctypes-find-library.patch') | ||
|
|
||
| if _p_version.minor >= 14: | ||
| self.patches.append('patches/3.14_armv7l_fix.patch') | ||
| self.patches.append('patches/3.14_fix_remote_debug.patch') | ||
|
|
||
| if shutil.which('lld') is not None: | ||
| if _p_version.minor == 7: | ||
| self.patches.append("patches/py3.7.1_fix_cortex_a8.patch") | ||
|
Comment on lines
+205
to
+206
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: probably not needed anymore since we dropped that version |
||
| elif _p_version.minor >= 8: | ||
| self.patches.append("patches/py3.8.1_fix_cortex_a8.patch") | ||
|
|
||
| self.patches = list(set(self.patches)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Patching order is no longer preserved with the set, just something to have in mind in case patch depend on one another (which I'm not sure would be a good idea anyway)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| super().apply_patches(arch, build_dir) | ||
|
|
||
| def include_root(self, arch_name): | ||
| return join(self.get_build_dir(arch_name), 'Include') | ||
|
|
||
|
|
@@ -317,9 +317,15 @@ def add_flags(include_flags, link_dirs, link_libs): | |
| env['ZLIB_VERSION'] = line.replace('#define ZLIB_VERSION ', '') | ||
| add_flags(' -I' + zlib_includes, ' -L' + zlib_lib_path, ' -lz') | ||
|
|
||
| if self._p_version.minor >= 13 and self.disable_gil: | ||
| _p_version = Version(self.version) | ||
| if _p_version.minor >= 11: | ||
| self.configure_args.append('--with-build-python={python_host_bin}') | ||
|
|
||
| if _p_version.minor >= 13 and self.disable_gil: | ||
| self.configure_args.append("--disable-gil") | ||
|
|
||
| self.configure_args = list(set(self.configure_args)) | ||
|
|
||
| return env | ||
|
|
||
| def build_arch(self, arch): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.