Skip to content

Commit 8fe5d01

Browse files
committed
fix build
1 parent c48a766 commit 8fe5d01

File tree

6 files changed

+47
-72
lines changed

6 files changed

+47
-72
lines changed

pythonforandroid/recipes/apsw/__init__.py

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
1-
from pythonforandroid.recipe import PythonRecipe
2-
from pythonforandroid.toolchain import current_directory, shprint
3-
import sh
1+
from pythonforandroid.recipe import PyProjectRecipe
42

53

6-
class ApswRecipe(PythonRecipe):
7-
version = '3.15.0'
8-
url = ('https://files.pythonhosted.org/packages/02/ea/'
9-
'7469e89d75a07972255aac4c1b98675bfbc74df32a19dd5dc8ba87aa552b/'
10-
'apsw-{version}.tar.gz')
11-
depends = ['sqlite3', 'setuptools']
12-
call_hostpython_via_targetpython = False
4+
class ApswRecipe(PyProjectRecipe):
5+
version = '3.50.4.0'
6+
url = 'https://github.com/rogerbinns/apsw/releases/download/{version}/apsw-{version}.tar.gz'
7+
depends = ['sqlite3']
138
site_packages_name = 'apsw'
149

15-
def build_arch(self, arch):
16-
env = self.get_recipe_env(arch)
17-
with current_directory(self.get_build_dir(arch.arch)):
18-
# Build python bindings
19-
hostpython = sh.Command(self.hostpython_location)
20-
shprint(hostpython,
21-
'setup.py',
22-
'build_ext',
23-
'--enable=fts4', _env=env)
24-
# Install python bindings
25-
super().build_arch(arch)
26-
27-
def get_recipe_env(self, arch):
28-
env = super().get_recipe_env(arch)
10+
def get_recipe_env(self, arch, **kwargs):
11+
env = super().get_recipe_env(arch, **kwargs)
2912
sqlite_recipe = self.get_recipe('sqlite3', self.ctx)
3013
env['CFLAGS'] += ' -I' + sqlite_recipe.get_build_dir(arch.arch)
31-
env['LDFLAGS'] += ' -L' + sqlite_recipe.get_lib_dir(arch)
3214
env['LIBS'] = env.get('LIBS', '') + ' -lsqlite3'
3315
return env
3416

pythonforandroid/recipes/freetype-py/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
class FreetypePyRecipe(PyProjectRecipe):
55
version = '2.5.1'
6-
url = ('https://files.pythonhosted.org/packages/d0/9c/'
7-
'61ba17f846b922c2d6d101cc886b0e8fb597c109cedfcb39b8c5d2304b54/'
8-
'freetype-py-{version}.zip')
6+
url = 'https://github.com/rougier/freetype-py/archive/refs/tags/v{version}.tar.gz'
7+
patches = ["fix_import.patch"]
98
depends = ['freetype']
109
site_packages_name = 'freetype'
1110

11+
def get_recipe_env(self, arch, **kwargs):
12+
env = super().get_recipe_env(arch, **kwargs)
13+
env["SETUPTOOLS_SCM_PRETEND_VERSION_FOR_freetype_py"] = self.version
14+
return env
15+
1216

1317
recipe = FreetypePyRecipe()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
diff '--color=auto' -uNr freetype-py-2.5.1/MANIFEST.in freetype-py-2.5.1.mod/MANIFEST.in
2+
--- freetype-py-2.5.1/MANIFEST.in 2024-08-29 23:12:30.000000000 +0530
3+
+++ freetype-py-2.5.1.mod/MANIFEST.in 2025-10-26 11:54:45.052025521 +0530
4+
@@ -9,3 +9,4 @@
5+
include LICENSE.txt
6+
include README.rst
7+
include setup-build-freetype.py
8+
+recursive-include _custom_build *.py

pythonforandroid/recipes/freetype/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def build_arch(self, arch, with_harfbuzz=False):
7777
'--host={}'.format(arch.command_prefix),
7878
'--prefix={}'.format(prefix_path),
7979
'--without-bzip2',
80+
'--without-brotli',
8081
'--with-png=no',
8182
}
8283
if not harfbuzz_in_recipes:

pythonforandroid/recipes/sqlite3/Android.mk

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,27 @@
1-
from os.path import join
2-
import shutil
3-
4-
from pythonforandroid.recipe import NDKRecipe
5-
from pythonforandroid.util import ensure_dir
6-
7-
8-
class Sqlite3Recipe(NDKRecipe):
9-
version = '3.35.5'
10-
# Don't forget to change the URL when changing the version
11-
url = 'https://www.sqlite.org/2021/sqlite-amalgamation-3350500.zip'
12-
generated_libraries = ['sqlite3']
13-
14-
def should_build(self, arch):
15-
return not self.has_libs(arch, 'libsqlite3.so')
16-
17-
def prebuild_arch(self, arch):
18-
super().prebuild_arch(arch)
19-
# Copy the Android make file
20-
ensure_dir(join(self.get_build_dir(arch.arch), 'jni'))
21-
shutil.copyfile(join(self.get_recipe_dir(), 'Android.mk'),
22-
join(self.get_build_dir(arch.arch), 'jni/Android.mk'))
23-
24-
def build_arch(self, arch, *extra_args):
25-
super().build_arch(arch)
26-
# Copy the shared library
27-
shutil.copyfile(join(self.get_build_dir(arch.arch), 'libs', arch.arch, 'libsqlite3.so'),
28-
join(self.ctx.get_libs_dir(arch.arch), 'libsqlite3.so'))
29-
30-
def get_recipe_env(self, arch):
31-
env = super().get_recipe_env(arch)
32-
env['NDK_PROJECT_PATH'] = self.get_build_dir(arch.arch)
33-
return env
1+
import sh
2+
from pythonforandroid.logger import shprint
3+
from pythonforandroid.util import current_directory
4+
from pythonforandroid.recipe import Recipe
5+
from multiprocessing import cpu_count
6+
7+
8+
class Sqlite3Recipe(Recipe):
9+
version = '3.50.4'
10+
url = 'https://github.com/sqlite/sqlite/archive/refs/tags/version-{version}.tar.gz'
11+
built_libraries = {'libsqlite3.so': '.'}
12+
13+
def build_arch(self, arch):
14+
env = self.get_recipe_env(arch)
15+
build_dir = self.get_build_dir(arch.arch)
16+
config_args = {
17+
'--host={}'.format(arch.command_prefix),
18+
'--prefix={}'.format(build_dir),
19+
'--disable-tcl',
20+
}
21+
with current_directory(build_dir):
22+
configure = sh.Command('./configure')
23+
shprint(configure, *config_args, _env=env)
24+
shprint(sh.make, '-j', str(cpu_count()), _env=env)
3425

3526

3627
recipe = Sqlite3Recipe()

0 commit comments

Comments
 (0)