kivy-ios/kivy_ios/recipes/python3/dynload_shlib.patch
Andre Miras 56431b6922 Moving to dedicated kivy_ios/ package directory
- updates all imports to prefix kivy_ios
- adds basic `setup.py` file
- adds a simple `toolchain.py` to the root folder for compat

Makes it possible to install kivy-ios from PyPI:
```
pip install kivy-ios
toolchain --help
```
Note the `rebuild_updated_recipes.py` is expected to fail as we
moved all the recipes.

This is a working, but unperfect iteration that come with limitations
we would address in subsequent pull requests, such as:
- the new usage is not yet documented
- CI is not testing the source distribution creation and install
- Continuous Delivery to PyPI is not in place
- `toolchain` binary is a bit too generic name
- we're still vendoring things under `tools/`
2020-05-03 23:29:41 +02:00

25 lines
950 B
Diff

diff -Naur Python-3.8.2.orig/Python/dynload_shlib.c Python-3.8.2/Python/dynload_shlib.c
--- Python-3.8.2.orig/Python/dynload_shlib.c 2020-04-12 00:17:24.000000000 +0200
+++ Python-3.8.2/Python/dynload_shlib.c 2020-04-12 00:20:10.000000000 +0200
@@ -74,6 +74,15 @@
PyOS_snprintf(funcname, sizeof(funcname),
LEAD_UNDERSCORE "%.20s_%.200s", prefix, shortname);
+ /* On IOS, dlopen crash as soon as we try to open one of our library.
+ * Instead, we have done a redirection of linking to convert our .so into a
+ * .a. Then the main executable is linked with theses symbol. So, instead
+ * of trying to dlopen, directly do the dlsym.
+ * -- Mathieu
+ */
+ return (dl_funcptr) dlsym(RTLD_SELF, funcname);
+
+ #if 0
if (fp != NULL) {
int i;
@@ -129,4 +138,5 @@
handles[nhandles++].handle = handle;
p = (dl_funcptr) dlsym(handle, funcname);
return p;
+ #endif
}