Skip to content

Commit a8c49d8

Browse files
authored
Merge branch 'kivy:develop' into firebase
2 parents f3b4369 + fbd5255 commit a8c49d8

File tree

15 files changed

+65
-174
lines changed

15 files changed

+65
-174
lines changed

ci/constants.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class TargetPython(Enum):
3333
'twisted',
3434
# genericndkbuild is incompatible with sdl2 (which is build by default when targeting sdl2 bootstrap)
3535
'genericndkbuild',
36-
# libmysqlclient gives a linker failure (See issue #2808)
37-
'libmysqlclient',
3836
# boost gives errors (requires numpy? syntax error in .jam?)
3937
'boost',
4038
# libtorrent gives errors (requires boost. Also, see issue #2809, to start with)
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe
1+
from pythonforandroid.recipe import PyProjectRecipe
22

33

4-
class AtomRecipe(CppCompiledComponentsPythonRecipe):
5-
site_packages_name = 'atom'
6-
version = '0.3.10'
7-
url = 'https://github.com/nucleic/atom/archive/master.zip'
8-
depends = ['setuptools']
4+
class AtomRecipe(PyProjectRecipe):
5+
site_packages_name = "atom"
6+
version = "0.11.0"
7+
url = "https://files.pythonhosted.org/packages/source/a/atom/atom-{version}.tar.gz"
8+
depends = ["setuptools"]
9+
patches = ["pyproject.toml.patch"]
910

1011

1112
recipe = AtomRecipe()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/pyproject.toml b/pyproject.toml
2+
index d41287f..c83b053 100644
3+
--- a/pyproject.toml
4+
+++ b/pyproject.toml
5+
@@ -40,6 +40,7 @@
6+
[tool.setuptools]
7+
include-package-data = false
8+
package-data = { atom = ["py.typed", "*.pyi"] }
9+
+ packages = ["atom"]
10+
11+
[tool.setuptools_scm]
12+
write_to = "atom/version.py"

pythonforandroid/recipes/gevent/__init__.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
1+
"""
2+
Note that this recipe doesn't yet build on macOS, the error is:
3+
```
4+
deps/libuv/src/unix/bsd-ifaddrs.c:31:10: fatal error: 'net/if_dl.h' file not found
5+
#include <net/if_dl.h>
6+
^~~~~~~~~~~~~
7+
1 error generated.
8+
error: command '/Users/runner/.android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang' failed with exit code 1
9+
```
10+
"""
111
import re
212
from pythonforandroid.logger import info
3-
from pythonforandroid.recipe import CythonRecipe
13+
from pythonforandroid.recipe import PyProjectRecipe
414

515

6-
class GeventRecipe(CythonRecipe):
7-
version = '1.4.0'
8-
url = 'https://pypi.python.org/packages/source/g/gevent/gevent-{version}.tar.gz'
16+
class GeventRecipe(PyProjectRecipe):
17+
version = '24.11.1'
18+
url = 'https://github.com/gevent/gevent/archive/refs/tags/{version}.tar.gz'
919
depends = ['librt', 'setuptools']
1020
patches = ["cross_compiling.patch"]
1121

12-
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
22+
def get_recipe_env(self, arch, **kwargs):
1323
"""
1424
- Moves all -I<inc> -D<macro> from CFLAGS to CPPFLAGS environment.
1525
- Moves all -l<lib> from LDFLAGS to LIBS environment.
1626
- Copies all -l<lib> from LDLIBS to LIBS environment.
17-
- Fixes linker name (use cross compiler) and flags (appends LIBS)
27+
- Fixes linker name (use cross compiler) and flags (appends LIBS).
28+
- Feds the command prefix for the configure --host flag.
1829
"""
19-
env = super().get_recipe_env(arch, with_flags_in_cc)
30+
env = super().get_recipe_env(arch, **kwargs)
2031
# CFLAGS may only be used to specify C compiler flags, for macro definitions use CPPFLAGS
2132
regex = re.compile(r'(?:\s|^)-[DI][\S]+')
2233
env['CPPFLAGS'] = ''.join(re.findall(regex, env['CFLAGS'])).strip()
@@ -28,6 +39,8 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
2839
env['LIBS'] += ' {}'.format(''.join(re.findall(regex, env['LDLIBS'])).strip())
2940
env['LDFLAGS'] = re.sub(regex, '', env['LDFLAGS'])
3041
info('Moved "{}" from LDFLAGS to LIBS.'.format(env['LIBS']))
42+
# used with the `./configure --host` flag for cross compiling, refs #2805
43+
env['COMMAND_PREFIX'] = arch.command_prefix
3144
return env
3245

3346

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
diff --git a/_setupares.py b/_setupares.py
2-
index dd184de6..bb16bebe 100644
2+
index c42fe369..cd8854df 100644
33
--- a/_setupares.py
44
+++ b/_setupares.py
5-
@@ -43,7 +43,7 @@ else:
5+
@@ -42,7 +42,7 @@ cflags = ('CFLAGS="%s"' % (cflags,)) if cflags else ''
66
ares_configure_command = ' '.join([
77
"(cd ", quoted_dep_abspath('c-ares'),
8-
" && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ",
9-
- " && sh ./configure --disable-dependency-tracking " + _m32 + "CONFIG_COMMANDS= ",
10-
+ " && sh ./configure --host={} --disable-dependency-tracking ".format(os.environ['TOOLCHAIN_PREFIX']) + _m32 + "CONFIG_COMMANDS= ",
11-
" && cp ares_config.h ares_build.h \"$OLDPWD\" ",
12-
" && cat ares_build.h ",
13-
" && if [ -r ares_build.h.orig ]; then mv ares_build.h.orig ares_build.h; fi)",
8+
" && if [ -r include/ares_build.h ]; then cp include/ares_build.h include/ares_build.h.orig; fi ",
9+
- " && sh ./configure --disable-dependency-tracking --disable-tests -C " + cflags,
10+
+ " && sh ./configure --host={} --disable-dependency-tracking --disable-tests -C ".format(os.environ['COMMAND_PREFIX']) + cflags,
11+
" && cp src/lib/ares_config.h include/ares_build.h \"$OLDPWD\" ",
12+
" && cat include/ares_build.h ",
13+
" && if [ -r include/ares_build.h.orig ]; then mv include/ares_build.h.orig include/ares_build.h; fi)",
1414
diff --git a/_setuplibev.py b/_setuplibev.py
15-
index 2a5841bf..b6433c94 100644
15+
index f05c2fe9..32f9bd81 100644
1616
--- a/_setuplibev.py
1717
+++ b/_setuplibev.py
18-
@@ -31,7 +31,7 @@ LIBEV_EMBED = should_embed('libev')
19-
# and the PyPy branch will clean it up.
18+
@@ -28,7 +28,7 @@ LIBEV_EMBED = should_embed('libev')
19+
# Configure libev in place
2020
libev_configure_command = ' '.join([
2121
"(cd ", quoted_dep_abspath('libev'),
22-
- " && sh ./configure ",
23-
+ " && sh ./configure --host={} ".format(os.environ['TOOLCHAIN_PREFIX']),
24-
" && cp config.h \"$OLDPWD\"",
22+
- " && sh ./configure -C > configure-output.txt",
23+
+ " && sh ./configure --host={} -C > configure-output.txt".format(os.environ['COMMAND_PREFIX']),
2524
")",
26-
'> configure-output.txt'
25+
])
26+

pythonforandroid/recipes/greenlet/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
1+
from pythonforandroid.recipe import PyProjectRecipe
22

33

4-
class GreenletRecipe(CompiledComponentsPythonRecipe):
5-
version = '0.4.15'
4+
class GreenletRecipe(PyProjectRecipe):
5+
version = '3.1.1'
66
url = 'https://pypi.python.org/packages/source/g/greenlet/greenlet-{version}.tar.gz'
77
depends = ['setuptools']
88
call_hostpython_via_targetpython = False

pythonforandroid/recipes/kiwisolver/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ class KiwiSolverRecipe(PyProjectRecipe):
88
depends = ['cppy']
99
need_stl_shared = True
1010

11-
# from https://github.com/kivy/python-for-android/issues/3115
1211
def get_recipe_env(self, arch, **kwargs):
12+
"""Override compile and linker flags, refs: #3115 and #3122"""
1313
env = super().get_recipe_env(arch, **kwargs)
1414
flags = " -I" + self.ctx.python_recipe.include_root(arch.arch)
15-
env["CFLAGS"] = flags
16-
env["CPPFLAGS"] = flags
15+
env["CFLAGS"] += flags
16+
env["CPPFLAGS"] += flags
17+
env["LDFLAGS"] += " -shared"
1718
return env
1819

1920

pythonforandroid/recipes/libmysqlclient/Linux.cmake

Lines changed: 0 additions & 5 deletions
This file was deleted.

pythonforandroid/recipes/libmysqlclient/__init__.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

pythonforandroid/recipes/libmysqlclient/add-custom-platform.patch

Lines changed: 0 additions & 8 deletions
This file was deleted.

pythonforandroid/recipes/libmysqlclient/disable-soname.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

pythonforandroid/recipes/libmysqlclient/disable-soversion.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

pythonforandroid/recipes/libmysqlclient/p4a.cmake

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/recipes/test_gevent.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ def test_get_recipe_env(self):
3535
'LDFLAGS': mocked_ldflags,
3636
'LDLIBS': mocked_ldlibs,
3737
}
38-
with patch('pythonforandroid.recipe.CythonRecipe.get_recipe_env') as m_get_recipe_env:
38+
with patch('pythonforandroid.recipe.PyProjectRecipe.get_recipe_env') as m_get_recipe_env:
3939
m_get_recipe_env.return_value = mocked_env
40-
env = self.recipe.get_recipe_env()
40+
env = self.recipe.get_recipe_env(self.arch)
4141
expected_cflags = (
4242
' -fomit-frame-pointer -mandroid -isystem /path/to/isystem'
4343
' -isysroot /path/to/sysroot'
@@ -57,11 +57,13 @@ def test_get_recipe_env(self):
5757
)
5858
expected_ldlibs = mocked_ldlibs
5959
expected_libs = '-lm -lpython3.7m -lm'
60+
expected_command_prefix = 'aarch64-linux-android'
6061
expected_env = {
6162
'CFLAGS': expected_cflags,
6263
'CPPFLAGS': expected_cppflags,
6364
'LDFLAGS': expected_ldflags,
6465
'LDLIBS': expected_ldlibs,
6566
'LIBS': expected_libs,
67+
'COMMAND_PREFIX': expected_command_prefix,
6668
}
6769
self.assertEqual(expected_env, env)

tests/recipes/test_libmysqlclient.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)