File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1
1
from os import uname
2
+ from distutils .version import LooseVersion
2
3
3
4
4
5
def check_all (* callables ):
@@ -69,3 +70,15 @@ def is_ndk(ndk):
69
70
def is_x (recipe , ** kwargs ):
70
71
return recipe .ctx .ndk == ndk
71
72
return is_x
73
+
74
+ def is_version_gt (version ):
75
+ def is_x (recipe , ** kwargs ):
76
+ return LooseVersion (recipe .version ) > version
77
+
78
+ def is_version_gt (version ):
79
+ def is_x (recipe , ** kwargs ):
80
+ return LooseVersion (recipe .version ) < version
81
+
82
+ def version_starts_with (version ):
83
+ def is_x (recipe , ** kwargs ):
84
+ return recipe .version .startswith (version )
Original file line number Diff line number Diff line change 1
1
import sh
2
2
from pythonforandroid .python import GuestPythonRecipe
3
3
from pythonforandroid .recipe import Recipe
4
+ from pythonforandroid .patching import version_starts_with
4
5
5
6
6
7
class Python3Recipe (GuestPythonRecipe ):
@@ -22,10 +23,14 @@ class Python3Recipe(GuestPythonRecipe):
22
23
url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
23
24
name = 'python3'
24
25
25
- # patches = ['patches/fix-ctypes-util-find-library.patch',
26
- # 'patches/fix-zlib-version.patch']
26
+ patches = [
27
+ # Python 3.7.1
28
+ ('patches/fix-ctypes-util-find-library.patch' , version_starts_with ("3.7" )),
29
+ ('patches/fix-zlib-version.patch' , version_starts_with ("3.7" ))
27
30
28
- patches = ['patches/py381.patch' ]
31
+ # Python 3.8.1
32
+ ('patches/py381.patch' , version_starts_with ("3.8" ))
33
+ ]
29
34
30
35
if sh .which ('lld' ) is not None :
31
36
raise RuntimeError ("!!!" )
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ def check_ndk_api(ndk_api, android_api):
187
187
188
188
189
189
MIN_PYTHON_MAJOR_VERSION = 3
190
- MIN_PYTHON_MINOR_VERSION = 4
190
+ MIN_PYTHON_MINOR_VERSION = 6
191
191
MIN_PYTHON_VERSION = LooseVersion ('{major}.{minor}' .format (major = MIN_PYTHON_MAJOR_VERSION ,
192
192
minor = MIN_PYTHON_MINOR_VERSION ))
193
193
PY2_ERROR_TEXT = (
You can’t perform that action at this time.
0 commit comments