python-for-android icon indicating copy to clipboard operation
python-for-android copied to clipboard

Add a recipe for `orjson`

Open krolaper opened this issue 1 year ago • 3 comments

Versions

Python: 3.10.12
OS: Linux mint 21.3
Kivy: 2.2.1
Cython: 0.29.33
OpenJDK: 17

Description

How to use orjson library in buildozer? After packaging and running the application:

ImportError: dlopen failed: "/data/data/codeberg.org.aigodosint/files/app/_python_bundle/site-packages/orjson/orjson.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)

krolaper avatar Apr 05 '24 17:04 krolaper

It's a rust-based package. Please take reference from pydantic-core's recipe and make for orjson.

T-Dynamos avatar Apr 05 '24 17:04 T-Dynamos

@T-Dynamos I tried it and it didn't help (same error). (repeated the init file, replacing the data with orjson).

from pythonforandroid.recipe import RustCompiledComponentsRecipe


class OrjsonRecipe(RustCompiledComponentsRecipe):
    version = "3.10.0"
    url = "https://github.com/ijl/orjson/archive/refs/tags/{version}.tar.gz"
    use_maturin = True
    hostpython_prerequisites = ["typing_extensions"]
    site_packages_name = "orjson"


recipe = PydanticcoreRecipe()

krolaper avatar Apr 06 '24 05:04 krolaper

@krolaper Please do a clean build after making recipe. Maybe your recipe wasn't built.

T-Dynamos avatar Apr 06 '24 10:04 T-Dynamos