Skip to content
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

WIP: Api level 28, NDK 17c - Recipe Updates and Fixes #1381

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
c1659b8
load `ssl` and `crypto` libs before loading python, for (4.1.2 or ear…
akshayaurora Oct 9, 2016
ce6417b
dynamically load libcrypto ans libel if they exist
akshayaurora Nov 3, 2016
7a5e657
Merge branch '866' of https://github.com/kivy/python-for-android
rnixx Dec 8, 2016
248ab32
customize kivy download URL
rnixx Dec 8, 2016
667e06f
Also load cffi lib
rnixx Dec 8, 2016
4aea97f
Load cffi extensions
rnixx Dec 8, 2016
1bf8d8f
Another adoption of lib loading
rnixx Dec 8, 2016
bba8377
add TODO note
rnixx Dec 8, 2016
ca9edac
Merge branch 'master' of github.com:rnixx/python-for-android
rnixx Dec 8, 2016
3c17132
Try cflag as described in https://github.com/kivy/python-for-android/…
rnixx Dec 8, 2016
a28d6d8
comment added cflag in python2 recipe, lets try a newer ndk first
rnixx Dec 8, 2016
87cd3ee
comment python3.5m for debugging purposes
rnixx Dec 9, 2016
212bd9f
...
rnixx Dec 9, 2016
8b28857
Add ``screenSize`` to ``android:configChanges`` AndroidManifest.xml t…
rnixx Dec 13, 2016
8272dae
Merge branch 'master' of https://github.com/kivy/python-for-android
rnixx Feb 2, 2017
a39e132
resolve
rnixx Apr 7, 2017
8ab51e7
Merge branch 'master' of https://github.com/kivy/python-for-android
rnixx Apr 20, 2017
44c83b9
merge p4a master
rnixx Oct 10, 2017
ac29df7
resolve conflicts
rnixx Sep 24, 2018
ec9529f
Merge branch 'master' of github.com:rnixx/python-for-android
rnixx Sep 24, 2018
7b4b100
try https://github.com/kivy/python-for-android/commit/f017eb9254c4dc1…
rnixx Sep 24, 2018
4a7cd2d
Add patches to disable ctermid and getpwall
rnixx Sep 24, 2018
381103d
Add asn1crypto recipe
rnixx Sep 25, 2018
dbba5bb
Add attrs recipe
rnixx Sep 25, 2018
eb90f78
Add pyasn1_modules recipe
rnixx Sep 25, 2018
47efdf9
Add service_identity recipe
rnixx Sep 25, 2018
4b273ff
Update cffi recipe version to 1.11.5
rnixx Sep 25, 2018
0744f91
Update cryptography version to 2.3.1. Document cryptography dependenc…
rnixx Sep 25, 2018
521922f
Update enum34 recipe version to 1.1.6
rnixx Sep 25, 2018
5e50de1
Update idna recipe version to 2.7
rnixx Sep 25, 2018
e87746b
Update ipaddress recipe version to 1.0.22
rnixx Sep 25, 2018
adf3dd6
Update openssl version to 1.0.2p
rnixx Sep 25, 2018
0774af4
Update pyasn1 recipe version to 0.4.4
rnixx Sep 25, 2018
2347a86
Update pycparser recipe version to 2.18
rnixx Sep 25, 2018
64f57b4
Update pyopenssl recipe version to 18.0.0
rnixx Sep 25, 2018
c9c596b
Document dependency option for TLS in twisted recipe
rnixx Sep 25, 2018
99db618
remove commented line
rnixx Sep 25, 2018
81a0e1a
Use kivy release download in kivy recipe
rnixx Sep 25, 2018
b8aae67
Remove superfluous recipes
rnixx Oct 1, 2018
bee84ed
Merge branch 'ctermid_getpwall_patches' into api_level_27
rnixx Oct 1, 2018
6854a46
Merge branch 'master' of https://github.com/kivy/python-for-android
rnixx Oct 1, 2018
1c865a6
Add patches to disable ctermid and getpwall
rnixx Sep 24, 2018
94d1a06
Update cffi recipe version to 1.11.5
rnixx Sep 25, 2018
81b326f
Merge branch 'api_level_27' of github.com:rnixx/python-for-android in…
rnixx Oct 1, 2018
8bb8d4f
Merge pull request #1386 from AndreMiras/feature/linter_fixes
inclement Sep 30, 2018
de148f4
try https://github.com/kivy/python-for-android/commit/f017eb9254c4dc1…
rnixx Sep 24, 2018
cf68676
Add patches to disable ctermid and getpwall
rnixx Sep 24, 2018
061b153
Update cffi recipe version to 1.11.5
rnixx Sep 25, 2018
a37d43d
Merge branch 'api_level_27' of github.com:rnixx/python-for-android in…
rnixx Oct 1, 2018
b56357f
remove pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/Py…
rnixx Oct 1, 2018
09fd642
# Das ist eine Kombination aus 2 Commits.
rnixx Sep 24, 2018
fbd78ce
Merge branch 'api_level_27' of github.com:rnixx/python-for-android in…
rnixx Oct 1, 2018
61a10a0
try https://github.com/kivy/python-for-android/commit/f017eb9254c4dc1…
rnixx Sep 24, 2018
65b2266
Add patches to disable ctermid and getpwall
rnixx Sep 24, 2018
100dd4e
Add asn1crypto recipe
rnixx Sep 25, 2018
231ac0a
Add attrs recipe
rnixx Sep 25, 2018
7ecd66f
Add pyasn1_modules recipe
rnixx Sep 25, 2018
b24a7ed
Add service_identity recipe
rnixx Sep 25, 2018
5cbc9f9
Update cffi recipe version to 1.11.5
rnixx Sep 25, 2018
3bb7359
Update cryptography version to 2.3.1. Document cryptography dependenc…
rnixx Sep 25, 2018
79b5547
Update enum34 recipe version to 1.1.6
rnixx Sep 25, 2018
0da6f72
Update idna recipe version to 2.7
rnixx Sep 25, 2018
c9dbd7a
Update ipaddress recipe version to 1.0.22
rnixx Sep 25, 2018
9f444e1
Update openssl version to 1.0.2p
rnixx Sep 25, 2018
c46492f
Update pyasn1 recipe version to 0.4.4
rnixx Sep 25, 2018
8e5258a
Update pycparser recipe version to 2.18
rnixx Sep 25, 2018
68763c4
Update pyopenssl recipe version to 18.0.0
rnixx Sep 25, 2018
f98e834
Document dependency option for TLS in twisted recipe
rnixx Sep 25, 2018
288a93c
Remove superfluous recipes
rnixx Oct 1, 2018
aa3beeb
Merge branch 'api_level_27' of github.com:rnixx/python-for-android in…
rnixx Oct 1, 2018
a8ab01a
Add patches to disable ctermid and getpwall in python2 recipe. Fix cr…
rnixx Oct 2, 2018
dc01ae7
Merge branch 'api_level_27' of github.com:rnixx/python-for-android in…
rnixx Oct 3, 2018
f7cbb20
Merge kivy master
rnixx Oct 20, 2018
23452ac
adopt jnius recipe
rnixx Nov 7, 2018
87fd595
Revert "adopt jnius recipe"
rnixx Nov 7, 2018
3822d8b
merge kivy master
rnixx Nov 7, 2018
33671a0
Add patch for disabling large file support when compiling python2
rnixx Nov 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pythonforandroid/bootstraps/sdl2/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def make_package(args):

def parse_args(args=None):
global BLACKLIST_PATTERNS, WHITELIST_PATTERNS, PYTHON
default_android_api = 12
default_android_api = 19
import argparse
ap = argparse.ArgumentParser(description='''\
Package a Python application for Android.
Expand Down
1 change: 1 addition & 0 deletions pythonforandroid/bootstraps/sdl2/build/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

# APP_ABI := armeabi armeabi-v7a x86
APP_ABI := $(ARCH)
APP_PLATFORM := android-19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting this to a fixed value for everyone could possibly have some surprising consequences, and there is the problem that it probably also acts as a minimum supported api. It might be better to leave this change until a more robust implementation is complete. Alternatively, if targeting a very old api works (like 12) that could be okay, I'd still be wary of surprising consequences.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just taken this from your branch. Not yet in state where I tried to upload to playstore. Once it works with this changes, I'll try to upload an apk without this change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will need to do either this, or the create-dist-with-api-19-then-delete-and-rebuild-with-api-27 method suggested in the other thread. However, the problem is that hardcoding it to a single value will probably cause some problems itself - it didn't matter in my branch or for individual testing, but it's the kind of thing that causes issues when dispersed across the wide range of configurations people use.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to get a working apk without hacks like delete-and-rebuild. Let's see what playstore tells me for an apk build like it's done now, and think about generalization afterwards

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one still needs to be tested

2 changes: 1 addition & 1 deletion pythonforandroid/recipes/cffi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class CffiRecipe(CompiledComponentsPythonRecipe):
name = 'cffi'
version = '1.4.2'
version = '1.11.5'
url = 'https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz'

depends = [('python2', 'python3crystax'), 'setuptools', 'pycparser', 'libffi']
Expand Down
15 changes: 13 additions & 2 deletions pythonforandroid/recipes/cryptography/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@

class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '1.3'
version = '2.3.1'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = [('python2', 'python3crystax'), 'openssl', 'idna', 'pyasn1', 'six', 'setuptools', 'enum34', 'ipaddress', 'cffi']

# install requires
# * six
# * cffi
# * idna
# * asn1crypto
# py 2 additional install requires, define manually if you want to install in python 2
# * enum34
# * ipaddress
depends = [('python2', 'python3crystax'), 'openssl', 'setuptools', 'six', 'cffi', 'idna', 'asn1crypto']

call_hostpython_via_targetpython = False

def get_recipe_env(self, arch):
Expand All @@ -17,6 +27,7 @@ def get_recipe_env(self, arch):
env['LDFLAGS'] += ' -L' + openssl_dir + \
' -lssl' + r.version + \
' -lcrypto' + r.version
env['CFLAGS'] += ' -I{}/include'.format(openssl_dir)
return env


Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/enum34/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class Enum34Recipe(PythonRecipe):
version = '1.1.3'
version = '1.1.6'
url = 'https://pypi.python.org/packages/source/e/enum34/enum34-{version}.tar.gz'
depends = [('python2', 'python3crystax'), 'setuptools']
site_packages_name = 'enum'
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/idna/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class IdnaRecipe(PythonRecipe):
name = 'idna'
version = '2.6'
version = '2.7'
url = 'https://github.com/kjd/idna/archive/v{version}.tar.gz'

depends = [('python2', 'python3crystax'), 'setuptools']
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/ipaddress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class IpaddressRecipe(PythonRecipe):
name = 'ipaddress'
version = '1.0.16'
version = '1.0.22'
url = 'https://pypi.python.org/packages/source/i/ipaddress/ipaddress-{version}.tar.gz'

depends = [('python2', 'python3crystax')]
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/openssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class OpenSSLRecipe(Recipe):
version = '1.0.2h'
version = '1.0.2p'
url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'

def should_build(self, arch):
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/pyasn1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class PyASN1Recipe(PythonRecipe):
version = '0.1.8'
version = '0.4.4'
url = 'https://pypi.python.org/packages/source/p/pyasn1/pyasn1-{version}.tar.gz'
depends = [('python2', 'python3crystax')]

Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/pycparser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class PycparserRecipe(PythonRecipe):
name = 'pycparser'
version = '2.14'
version = '2.18'
url = 'https://pypi.python.org/packages/source/p/pycparser/pycparser-{version}.tar.gz'

depends = [('python2', 'python3crystax'), 'setuptools']
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/pyopenssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class PyOpenSSLRecipe(PythonRecipe):
version = '0.14'
version = '18.0.0'
url = 'https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-{version}.tar.gz'
depends = [('python2', 'python3crystax'), 'openssl', 'setuptools']
site_packages_name = 'OpenSSL'
Expand Down
2 changes: 2 additions & 0 deletions pythonforandroid/recipes/python2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Python2Recipe(TargetPythonRecipe):
'patches/fix-dlfcn.patch',
'patches/parsetuple.patch',
'patches/ctypes-find-library-updated.patch',
'patches/disable-ctermid.patch',
'patches/disable-getpwall.patch',
('patches/fix-configure-darwin.patch', is_darwin),
('patches/fix-distutils-darwin.patch', is_darwin),
('patches/fix-ftime-removal.patch', is_api_gt(19)),
Expand Down
22 changes: 22 additions & 0 deletions pythonforandroid/recipes/python2/patches/disable-ctermid.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- Python-2.7.2.orig/Modules/posixmodule.c 2018-09-24 15:49:14.041368116 +0200
+++ Python-2.7.2/Modules/posixmodule.c 2018-09-24 16:15:02.537201532 +0200
@@ -1615,17 +1615,8 @@
static PyObject *
posix_ctermid(PyObject *self, PyObject *noargs)
{
- char *ret;
- char buffer[L_ctermid];
-
-#ifdef USE_CTERMID_R
- ret = ctermid_r(buffer);
-#else
- ret = ctermid(buffer);
-#endif
- if (ret == NULL)
- return posix_error();
- return PyString_FromString(buffer);
+ PyErr_SetString(PyExc_NotImplementedError, "ctermid not implemented for this build");
+ return NULL;
}
#endif

32 changes: 32 additions & 0 deletions pythonforandroid/recipes/python2/patches/disable-getpwall.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--- Python-2.7.2.orig/Modules/pwdmodule.c 2018-09-24 15:49:14.053368267 +0200
+++ Python-2.7.2/Modules/pwdmodule.c 2018-09-24 16:28:09.083420986 +0200
@@ -146,27 +146,8 @@
static PyObject *
pwd_getpwall(PyObject *self)
{
- PyObject *d;
- struct passwd *p;
- if ((d = PyList_New(0)) == NULL)
- return NULL;
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
- if ((p = getpwuid(0)) != NULL) {
-#else
- setpwent();
- while ((p = getpwent()) != NULL) {
-#endif
- PyObject *v = mkpwent(p);
- if (v == NULL || PyList_Append(d, v) != 0) {
- Py_XDECREF(v);
- Py_DECREF(d);
- endpwent();
- return NULL;
- }
- Py_DECREF(v);
- }
- endpwent();
- return d;
+ PyErr_SetString(PyExc_NotImplementedError, "getpwall not implemented for this build");
+ return NULL;
}
#endif

1 change: 1 addition & 0 deletions pythonforandroid/recipes/twisted/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class TwistedRecipe(CythonRecipe):
version = '17.9.0'
url = 'https://github.com/twisted/twisted/archive/twisted-{version}.tar.gz'

# in order to use TLS in twisted, you need to depend on service_identity
depends = ['setuptools', 'zope_interface', 'incremental', 'constantly']

call_hostpython_via_targetpython = False
Expand Down