Skip to content

Commit d891395

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 0284511 + 83af823 commit d891395

File tree

7 files changed

+72
-9
lines changed

7 files changed

+72
-9
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ branch.
4141

4242
# Documentation
4343

44-
This toolchain is documented (temporarily)
45-
[here](http://inclem.net/files/p4a_revamp_doc/). Follow the
46-
[quickstart instructions](http://inclem.net/files/p4a_revamp_doc/quickstart.html#quickstart)
44+
Follow the
45+
[quickstart instructions](https://python-for-android.readthedocs.org/en/latest/quickstart/)
4746
to install and begin creating APK.
4847

4948
Quick instructions to start would be:
@@ -90,8 +89,7 @@ the reference commit that the revamp is based on:
9089

9190
# Current status
9291

93-
The tool works, testing is welcomed. Doc is available
94-
[here](http://inclem.net/files/p4a_revamp_doc/).
92+
The tool works, testing is welcomed.
9593

9694
# Development notes
9795

pythonforandroid/recipes/python3/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,27 @@ def prebuild_armeabi(self):
1919
print('Python3 already patched, skipping.')
2020
return
2121

22+
# # self.apply_patch(join('patches_inclement',
23+
# # 'python-{version}-define_macro.patch'.format(version=self.version)))
24+
# # self.apply_patch(join('patches_inclement',
25+
# # 'python-{version}-android-locale.patch'.format(version=self.version)))
26+
# # self.apply_patch(join('patches_inclement',
27+
# # 'python-{version}-android-misc.patch'.format(version=self.version)))
28+
29+
# self.apply_patch(join('patches_inclement',
30+
# 'python-{version}-locale_and_android_misc.patch'.format(version=self.version)))
31+
32+
2233
self.apply_patch(join('patches', 'python-{version}-android-libmpdec.patch'.format(version=self.version)))
2334
self.apply_patch(join('patches', 'python-{version}-android-locale.patch'.format(version=self.version)))
2435
self.apply_patch(join('patches', 'python-{version}-android-misc.patch'.format(version=self.version)))
2536
# self.apply_patch(join('patches', 'python-{version}-android-missing-getdents64-definition.patch'.format(version=self.version)))
2637
self.apply_patch(join('patches', 'python-{version}-cross-compile.patch'.format(version=self.version)))
2738
self.apply_patch(join('patches', 'python-{version}-python-misc.patch'.format(version=self.version)))
2839

40+
self.apply_patch(join('patches', 'python-{version}-libpymodules_loader.patch'.format(version=self.version)))
41+
42+
2943
shprint(sh.touch, join(build_dir, '.patched'))
3044

3145
def build_armeabi(self):

pythonforandroid/recipes/python3/patches/python-3.4.2-android-misc.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ diff -ru Python-3.3.5/Lib/platform.py Python-3.3.5-android/Lib/platform.py
66
full_distribution_name=0)
77

88
+_android_environment_vars = (
9-
+ 'ANDROID_ROOT', 'ANDROID_ASSETS', 'ANDROID_STORAGE', 'ANDROID_DATA',
9+
+ 'ANDROID_PRIVATE', 'ANDROID_ARGUMENT', 'ANDROID_APP_PATH', 'ANDROID_DATA',
1010
+ 'ANDROID_PROPERTY_WORKSPACE', 'ANDROID_BOOTLOGO')
1111
+_android_version_property = 'ro.build.version.release'
1212
+_android_buildstr_property = 'ro.build.version.full'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
2+
index 7f8f134..bba560f 100644
3+
--- a/Python/dynload_shlib.c
4+
+++ b/Python/dynload_shlib.c
5+
@@ -62,6 +62,20 @@ _PyImport_FindSharedFuncptr(const char *prefix,
6+
char pathbuf[260];
7+
int dlopenflags=0;
8+
9+
+ static void *libpymodules = NULL;
10+
+ void *rv = NULL;
11+
+
12+
+ /* Ensure we have access to libpymodules. */
13+
+ if (libpymodules == NULL) {
14+
+ printf("ANDROID_PRIVATE = %s\n", getenv("ANDROID_PRIVATE"));
15+
+ PyOS_snprintf(pathbuf, sizeof(pathbuf), "%s/libpymodules.so", getenv("ANDROID_PRIVATE"));
16+
+ libpymodules = dlopen(pathbuf, RTLD_NOW);
17+
+
18+
+ if (libpymodules == NULL) {
19+
+ //abort();
20+
+ }
21+
+ }
22+
+
23+
if (strchr(pathname, '/') == NULL) {
24+
/* Prefix bare filename with "./" */
25+
PyOS_snprintf(pathbuf, sizeof(pathbuf), "./%-.255s", pathname);
26+
@@ -71,6 +85,16 @@ _PyImport_FindSharedFuncptr(const char *prefix,
27+
PyOS_snprintf(funcname, sizeof(funcname),
28+
LEAD_UNDERSCORE "%.20s_%.200s", prefix, shortname);
29+
30+
+
31+
+ /* Read symbols that have been linked into the main binary. */
32+
+
33+
+ if (libpymodules) {
34+
+ rv = dlsym(libpymodules, funcname);
35+
+ if (rv != NULL) {
36+
+ return rv;
37+
+ }
38+
+ }
39+
+
40+
if (fp != NULL) {
41+
int i;
42+
struct _Py_stat_struct status;

pythonforandroid/recipes/vispy/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77

88
class VispyRecipe(PythonRecipe):
9-
version = '0.4.0'
10-
url = 'https://github.com/vispy/vispy/archive/v{version}.tar.gz'
9+
# version = 'v0.4.0'
10+
version = 'master'
11+
url = 'https://github.com/vispy/vispy/archive/{version}.tar.gz'
1112
# version = 'campagnola-scenegraph-update'
1213
# url = 'https://github.com/campagnola/vispy/archive/scenegraph-update.zip'
1314
# version = '???'
@@ -25,6 +26,10 @@ def prebuild_arch(self, arch):
2526
self.apply_patch('disable_font_triage.patch')
2627
self.apply_patch('use_es2.patch')
2728
self.apply_patch('remove_ati_check.patch')
29+
30+
self.apply_patch('make_shader_es2_compliant.patch')
31+
self.apply_patch('detect_finger_events.patch')
32+
2833
shprint(sh.touch, join(build_dir, '.patched'))
2934

3035
recipe = VispyRecipe()

pythonforandroid/toolchain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ def clean_build(self, arch=None):
19141914
if exists(dir):
19151915
shutil.rmtree(dir)
19161916
else:
1917-
warning(('Attempted to clean build for {} but build'
1917+
warning(('Attempted to clean build for {} but build '
19181918
'did not exist').format(self.name))
19191919

19201920

tests/vispy_testapp/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
print('imported util')
1212
print(ctypes.util.find_library)
1313

14+
import vispy
15+
# vispy.set_log_level('debug')
16+
1417
import sys
1518
from vispy import scene
1619
from vispy.geometry.torusknot import TorusKnot
@@ -19,6 +22,7 @@
1922
import numpy as np
2023

2124
canvas = scene.SceneCanvas(keys='interactive', bgcolor='white')
25+
canvas.unfreeze()
2226
canvas.view = canvas.central_widget.add_view()
2327

2428
points1 = TorusKnot(5, 3).first_component[:-1]

0 commit comments

Comments
 (0)