From e2f14f7eb59b8f12d7693be78c7fefa2fc808ef8 Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 09:25:17 +0530 Subject: [PATCH 01/11] Add cglm and datoviz recipes --- pythonforandroid/recipes/cglm/__init__.py | 56 +++++++++++++ pythonforandroid/recipes/datoviz/__init__.py | 82 +++++++++++++++++++ .../recipes/datoviz/android_platform.patch | 10 +++ 3 files changed, 148 insertions(+) create mode 100644 pythonforandroid/recipes/cglm/__init__.py create mode 100644 pythonforandroid/recipes/datoviz/__init__.py create mode 100644 pythonforandroid/recipes/datoviz/android_platform.patch diff --git a/pythonforandroid/recipes/cglm/__init__.py b/pythonforandroid/recipes/cglm/__init__.py new file mode 100644 index 0000000000..5aa2756b0d --- /dev/null +++ b/pythonforandroid/recipes/cglm/__init__.py @@ -0,0 +1,56 @@ +import os +import shutil +from os.path import join + +import sh +from pythonforandroid.logger import info, shprint +from pythonforandroid.recipe import Recipe +from pythonforandroid.util import ensure_dir + + +class CglmRecipe(Recipe): + """Build cglm static library and CMake package for Android.""" + + name = "cglm" + version = "0.9.6" + url = "https://github.com/recp/cglm/archive/refs/tags/v{version}.tar.gz" + depends = [] + built_libraries = { + "libcglm.so": "installation/lib", + } + + def build_arch(self, arch): + source_dir = self.get_build_dir(arch.arch) + build_dir = join(source_dir, "p4a_build") + install_dir = join(source_dir, "installation") + toolchain = join( + self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake" + ) + generator = "Ninja" if shutil.which("ninja") else "Unix Makefiles" + + ensure_dir(build_dir) + cmake_args = [ + "-S", + source_dir, + "-B", + build_dir, + "-G", + generator, + f"-DCMAKE_TOOLCHAIN_FILE={toolchain}", + f"-DANDROID_ABI={arch.arch}", + f"-DANDROID_PLATFORM=android-{self.ctx.ndk_api}", + f"-DCMAKE_INSTALL_PREFIX={install_dir}", + "-DCMAKE_BUILD_TYPE=Release", + "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", + "-DCGLM_SHARED=ON", + "-DCGLM_STATIC=OFF", + "-DCGLM_USE_C99=ON", + "-DCGLM_USE_TEST=OFF", + ] + info(f"Building cglm {self.version} for {arch.arch}") + shprint(sh.cmake, *cmake_args) + shprint(sh.cmake, "--build", build_dir, "-j", str(os.cpu_count() or 4)) + shprint(sh.cmake, "--install", build_dir) + + +recipe = CglmRecipe() diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py new file mode 100644 index 0000000000..fec23557c6 --- /dev/null +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -0,0 +1,82 @@ +import os +import shutil +from os.path import exists, join + +import sh +from pythonforandroid.logger import info, shprint +from pythonforandroid.recipe import PyProjectRecipe, Recipe + + +class DatovizRecipe(PyProjectRecipe): + """Build Datoviz (libdatoviz.so + Python ctypes bindings) for Android.""" + + name = "datoviz" + version = "main" + url = "git+https://github.com/datoviz/datoviz.git" + depends = ["python3", "numpy", "cglm"] + patches = ["android_platform.patch"] + + def _find_glslc(self): + ndk_glslc = join( + self.ctx.ndk_dir, "shader-tools", "linux-x86_64", "glslc" + ) + if exists(ndk_glslc): + return ndk_glslc + return shutil.which("glslc") + + def build_arch(self, arch): + build_dir = self.get_build_dir(arch.arch) + cmake_build_dir = join(build_dir, "p4a_cmake_build") + toolchain = join( + self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake" + ) + generator = "Ninja" if shutil.which("ninja") else "Unix Makefiles" + cglm_install_dir = join( + Recipe.get_recipe("cglm", self.ctx).get_build_dir(arch.arch), + "installation", + ) + + cmake_args = [ + "-S", + build_dir, + "-B", + cmake_build_dir, + "-G", + generator, + f"-DCMAKE_TOOLCHAIN_FILE={toolchain}", + f"-DANDROID_ABI={arch.arch}", + f"-DANDROID_PLATFORM=android-{self.ctx.ndk_api}", + f"-DCMAKE_PREFIX_PATH={cglm_install_dir}", + f"-DCMAKE_SHARED_LINKER_FLAGS=-L{join(cglm_install_dir, 'lib')}", + "-DCMAKE_BUILD_TYPE=Release", + "-DDVZ_CGLM_SOURCE=SYSTEM", + "-DDVZ_BUILD_TESTING=OFF", + "-DDVZ_BUILD_EXAMPLES=OFF", + "-DDVZ_WITH_GLFW=OFF", + "-DDVZ_BUILD_GUI=OFF", + "-DDVZ_ENABLE_CUDA=OFF", + "-DDVZ_ENABLE_QT_BRIDGE=OFF", + "-DDVZ_ENABLE_SHADERC=OFF", + "-DDVZ_WITH_FREETYPE=OFF", + "-DDVZ_WITH_MSDF_ATLAS=OFF", + "-DDVZ_KVAZAAR_SOURCE=OFF", + ] + glslc = self._find_glslc() + if glslc: + cmake_args.append(f"-DDVZ_GLSLC_EXECUTABLE={glslc}") + + info(f"Configuring datoviz CMake for {arch.arch} (android-{self.ctx.ndk_api})") + shprint(sh.cmake, *cmake_args) + + nproc = str(os.cpu_count() or 4) + info(f"Building libdatoviz.so for {arch.arch}") + shprint(sh.cmake, "--build", cmake_build_dir, "--target", "datoviz", "-j", nproc) + + built_so = join(cmake_build_dir, "src", "libdatoviz.so") + target_so = join(build_dir, "datoviz", "libdatoviz.so") + shutil.copy2(built_so, target_so) + + super().build_arch(arch) + + +recipe = DatovizRecipe() diff --git a/pythonforandroid/recipes/datoviz/android_platform.patch b/pythonforandroid/recipes/datoviz/android_platform.patch new file mode 100644 index 0000000000..cf2da25653 --- /dev/null +++ b/pythonforandroid/recipes/datoviz/android_platform.patch @@ -0,0 +1,10 @@ +--- a/datoviz/_ctypes.py ++++ b/datoviz/_ctypes.py +@@ -21,6 +21,7 @@ class CtypesEnum(IntEnum): + + _PLATFORM_LIB_NAMES = { + 'Linux': ('libdatoviz.so',), ++ 'Android': ('libdatoviz.so',), + 'Darwin': ('libdatoviz.dylib',), + 'Windows': ('datoviz.dll', 'libdatoviz.dll'), + } From fdc2fb20913f82bbbee0d5731816fee98f1f8e4b Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 10:38:46 +0530 Subject: [PATCH 02/11] datoviz: install pyyaml in hostpython and detect glslc across platforms --- pythonforandroid/recipes/datoviz/__init__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index fec23557c6..50d22efb15 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -1,6 +1,7 @@ +import glob import os import shutil -from os.path import exists, join +from os.path import join import sh from pythonforandroid.logger import info, shprint @@ -17,14 +18,15 @@ class DatovizRecipe(PyProjectRecipe): patches = ["android_platform.patch"] def _find_glslc(self): - ndk_glslc = join( - self.ctx.ndk_dir, "shader-tools", "linux-x86_64", "glslc" + candidates = glob.glob( + join(self.ctx.ndk_dir, "shader-tools", "*", "glslc*") ) - if exists(ndk_glslc): - return ndk_glslc + if candidates: + return candidates[0] return shutil.which("glslc") def build_arch(self, arch): + self.install_hostpython_prerequisites(["pyyaml"]) build_dir = self.get_build_dir(arch.arch) cmake_build_dir = join(build_dir, "p4a_cmake_build") toolchain = join( @@ -60,6 +62,7 @@ def build_arch(self, arch): "-DDVZ_WITH_FREETYPE=OFF", "-DDVZ_WITH_MSDF_ATLAS=OFF", "-DDVZ_KVAZAAR_SOURCE=OFF", + f"-DPython3_EXECUTABLE={self.real_hostpython_location}", ] glslc = self._find_glslc() if glslc: From 44200677cc8c88a25babf89e3598eaaaec62c66e Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 10:45:38 +0530 Subject: [PATCH 03/11] datoviz: declare pyyaml in hostpython_prerequisites --- pythonforandroid/recipes/datoviz/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index 50d22efb15..02d29cc200 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -16,6 +16,7 @@ class DatovizRecipe(PyProjectRecipe): url = "git+https://github.com/datoviz/datoviz.git" depends = ["python3", "numpy", "cglm"] patches = ["android_platform.patch"] + hostpython_prerequisites = ["pyyaml"] def _find_glslc(self): candidates = glob.glob( @@ -26,7 +27,7 @@ def _find_glslc(self): return shutil.which("glslc") def build_arch(self, arch): - self.install_hostpython_prerequisites(["pyyaml"]) + self.install_hostpython_prerequisites() build_dir = self.get_build_dir(arch.arch) cmake_build_dir = join(build_dir, "p4a_cmake_build") toolchain = join( From bab6aec25cf8b123f02807b9aa7cf9c166e41d5f Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 13:46:34 +0530 Subject: [PATCH 04/11] recipes(datoviz): avoid passing -m64 on Android x86 --- .../recipes/datoviz/android_platform.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pythonforandroid/recipes/datoviz/android_platform.patch b/pythonforandroid/recipes/datoviz/android_platform.patch index cf2da25653..efd62684ac 100644 --- a/pythonforandroid/recipes/datoviz/android_platform.patch +++ b/pythonforandroid/recipes/datoviz/android_platform.patch @@ -8,3 +8,14 @@ 'Darwin': ('libdatoviz.dylib',), 'Windows': ('datoviz.dll', 'libdatoviz.dll'), } +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -79,7 +79,7 @@ if(CC_GCC OR CC_CLANG) + $<$:-O0> + $<$>:-O2> + ) +- if(NOT EMSCRIPTEN AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64|i.86") ++ if(NOT EMSCRIPTEN AND NOT ANDROID AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64|i.86") + list(APPEND DVZ_COMMON_COMPILE_OPTIONS -m64) + endif() + endif() From 267ead9f548de9d78e39313edb70648b3e99df4a Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 18:28:13 +0530 Subject: [PATCH 05/11] recipes(datoviz): pin commit edd17fb and drop merged _ctypes.py patch --- pythonforandroid/recipes/datoviz/__init__.py | 2 +- .../recipes/datoviz/android_platform.patch | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index 02d29cc200..9dd39ac7ce 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -12,7 +12,7 @@ class DatovizRecipe(PyProjectRecipe): """Build Datoviz (libdatoviz.so + Python ctypes bindings) for Android.""" name = "datoviz" - version = "main" + version = "edd17fb6afd61e7fc65279efce48243050b18eec" url = "git+https://github.com/datoviz/datoviz.git" depends = ["python3", "numpy", "cglm"] patches = ["android_platform.patch"] diff --git a/pythonforandroid/recipes/datoviz/android_platform.patch b/pythonforandroid/recipes/datoviz/android_platform.patch index efd62684ac..6f0efde638 100644 --- a/pythonforandroid/recipes/datoviz/android_platform.patch +++ b/pythonforandroid/recipes/datoviz/android_platform.patch @@ -1,13 +1,3 @@ ---- a/datoviz/_ctypes.py -+++ b/datoviz/_ctypes.py -@@ -21,6 +21,7 @@ class CtypesEnum(IntEnum): - - _PLATFORM_LIB_NAMES = { - 'Linux': ('libdatoviz.so',), -+ 'Android': ('libdatoviz.so',), - 'Darwin': ('libdatoviz.dylib',), - 'Windows': ('datoviz.dll', 'libdatoviz.dll'), - } --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -79,7 +79,7 @@ if(CC_GCC OR CC_CLANG) From ba048e95f1ab35d9ed9277227bc47731820c8611 Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 19:52:31 +0530 Subject: [PATCH 06/11] recipes(datoviz): use archive tarball at 7e1ba52 and drop merged patch --- pythonforandroid/recipes/datoviz/__init__.py | 5 ++--- .../recipes/datoviz/android_platform.patch | 11 ----------- 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 pythonforandroid/recipes/datoviz/android_platform.patch diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index 9dd39ac7ce..484125e9f3 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -12,10 +12,9 @@ class DatovizRecipe(PyProjectRecipe): """Build Datoviz (libdatoviz.so + Python ctypes bindings) for Android.""" name = "datoviz" - version = "edd17fb6afd61e7fc65279efce48243050b18eec" - url = "git+https://github.com/datoviz/datoviz.git" + version = "7e1ba52513ea07f2c3a8c13b0979f1ccdb04bb11" + url = "https://github.com/datoviz/datoviz/archive/{version}.tar.gz" depends = ["python3", "numpy", "cglm"] - patches = ["android_platform.patch"] hostpython_prerequisites = ["pyyaml"] def _find_glslc(self): diff --git a/pythonforandroid/recipes/datoviz/android_platform.patch b/pythonforandroid/recipes/datoviz/android_platform.patch deleted file mode 100644 index 6f0efde638..0000000000 --- a/pythonforandroid/recipes/datoviz/android_platform.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -79,7 +79,7 @@ if(CC_GCC OR CC_CLANG) - $<$:-O0> - $<$>:-O2> - ) -- if(NOT EMSCRIPTEN AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64|i.86") -+ if(NOT EMSCRIPTEN AND NOT ANDROID AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64|i.86") - list(APPEND DVZ_COMMON_COMPILE_OPTIONS -m64) - endif() - endif() From 10497d4ddda6103ccdffb537534fb37b4f75299e Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 20:28:36 +0530 Subject: [PATCH 07/11] recipes(datoviz): pass -DDVZ_INSTALL=OFF for archive builds --- pythonforandroid/recipes/datoviz/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index 484125e9f3..f4fe7b26b6 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -54,6 +54,7 @@ def build_arch(self, arch): "-DDVZ_CGLM_SOURCE=SYSTEM", "-DDVZ_BUILD_TESTING=OFF", "-DDVZ_BUILD_EXAMPLES=OFF", + "-DDVZ_INSTALL=OFF", "-DDVZ_WITH_GLFW=OFF", "-DDVZ_BUILD_GUI=OFF", "-DDVZ_ENABLE_CUDA=OFF", From 8db1be16825e85c7ece360362d26dd3b1cb73cac Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 20:57:42 +0530 Subject: [PATCH 08/11] recipes(datoviz): fetch imstb_truetype.h for archive builds --- pythonforandroid/recipes/datoviz/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index f4fe7b26b6..bd30456e35 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -1,6 +1,7 @@ import glob import os import shutil +import urllib.request from os.path import join import sh @@ -28,6 +29,13 @@ def _find_glslc(self): def build_arch(self, arch): self.install_hostpython_prerequisites() build_dir = self.get_build_dir(arch.arch) + imstb_path = join(build_dir, "external", "cimgui", "imgui", "imstb_truetype.h") + if not os.path.exists(imstb_path): + os.makedirs(os.path.dirname(imstb_path), exist_ok=True) + urllib.request.urlretrieve( + "https://raw.githubusercontent.com/ocornut/imgui/v1.91.9/imstb_truetype.h", + imstb_path, + ) cmake_build_dir = join(build_dir, "p4a_cmake_build") toolchain = join( self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake" From 70aab1c1f051b807284a0272dd85bab0c6960ce8 Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Fri, 27 Nov 2026 20:59:47 +0530 Subject: [PATCH 09/11] recipes(datoviz): switch back to git+ URL pinned to 7e1ba52 --- pythonforandroid/recipes/datoviz/__init__.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index bd30456e35..e9f56b25b4 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -1,7 +1,6 @@ import glob import os import shutil -import urllib.request from os.path import join import sh @@ -14,7 +13,7 @@ class DatovizRecipe(PyProjectRecipe): name = "datoviz" version = "7e1ba52513ea07f2c3a8c13b0979f1ccdb04bb11" - url = "https://github.com/datoviz/datoviz/archive/{version}.tar.gz" + url = "git+https://github.com/datoviz/datoviz.git" depends = ["python3", "numpy", "cglm"] hostpython_prerequisites = ["pyyaml"] @@ -29,13 +28,6 @@ def _find_glslc(self): def build_arch(self, arch): self.install_hostpython_prerequisites() build_dir = self.get_build_dir(arch.arch) - imstb_path = join(build_dir, "external", "cimgui", "imgui", "imstb_truetype.h") - if not os.path.exists(imstb_path): - os.makedirs(os.path.dirname(imstb_path), exist_ok=True) - urllib.request.urlretrieve( - "https://raw.githubusercontent.com/ocornut/imgui/v1.91.9/imstb_truetype.h", - imstb_path, - ) cmake_build_dir = join(build_dir, "p4a_cmake_build") toolchain = join( self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake" From 991440a49435a017715df7cf38680bdd11629c21 Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Sat, 28 Nov 2026 13:00:53 +0530 Subject: [PATCH 10/11] move cglm -> libcglm --- pythonforandroid/recipes/datoviz/__init__.py | 17 ++++++----------- .../recipes/{cglm => libcglm}/__init__.py | 13 ++++--------- 2 files changed, 10 insertions(+), 20 deletions(-) rename pythonforandroid/recipes/{cglm => libcglm}/__init__.py (85%) diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index e9f56b25b4..2d621f5196 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -9,18 +9,13 @@ class DatovizRecipe(PyProjectRecipe): - """Build Datoviz (libdatoviz.so + Python ctypes bindings) for Android.""" - - name = "datoviz" version = "7e1ba52513ea07f2c3a8c13b0979f1ccdb04bb11" url = "git+https://github.com/datoviz/datoviz.git" - depends = ["python3", "numpy", "cglm"] + depends = ["python3", "numpy", "libcglm"] hostpython_prerequisites = ["pyyaml"] def _find_glslc(self): - candidates = glob.glob( - join(self.ctx.ndk_dir, "shader-tools", "*", "glslc*") - ) + candidates = glob.glob(join(self.ctx.ndk_dir, "shader-tools", "*", "glslc*")) if candidates: return candidates[0] return shutil.which("glslc") @@ -29,9 +24,7 @@ def build_arch(self, arch): self.install_hostpython_prerequisites() build_dir = self.get_build_dir(arch.arch) cmake_build_dir = join(build_dir, "p4a_cmake_build") - toolchain = join( - self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake" - ) + toolchain = join(self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake") generator = "Ninja" if shutil.which("ninja") else "Unix Makefiles" cglm_install_dir = join( Recipe.get_recipe("cglm", self.ctx).get_build_dir(arch.arch), @@ -74,7 +67,9 @@ def build_arch(self, arch): nproc = str(os.cpu_count() or 4) info(f"Building libdatoviz.so for {arch.arch}") - shprint(sh.cmake, "--build", cmake_build_dir, "--target", "datoviz", "-j", nproc) + shprint( + sh.cmake, "--build", cmake_build_dir, "--target", "datoviz", "-j", nproc + ) built_so = join(cmake_build_dir, "src", "libdatoviz.so") target_so = join(build_dir, "datoviz", "libdatoviz.so") diff --git a/pythonforandroid/recipes/cglm/__init__.py b/pythonforandroid/recipes/libcglm/__init__.py similarity index 85% rename from pythonforandroid/recipes/cglm/__init__.py rename to pythonforandroid/recipes/libcglm/__init__.py index 5aa2756b0d..ae0d432cd4 100644 --- a/pythonforandroid/recipes/cglm/__init__.py +++ b/pythonforandroid/recipes/libcglm/__init__.py @@ -3,18 +3,15 @@ from os.path import join import sh + from pythonforandroid.logger import info, shprint from pythonforandroid.recipe import Recipe from pythonforandroid.util import ensure_dir -class CglmRecipe(Recipe): - """Build cglm static library and CMake package for Android.""" - - name = "cglm" +class LibCglmRecipe(Recipe): version = "0.9.6" url = "https://github.com/recp/cglm/archive/refs/tags/v{version}.tar.gz" - depends = [] built_libraries = { "libcglm.so": "installation/lib", } @@ -23,9 +20,7 @@ def build_arch(self, arch): source_dir = self.get_build_dir(arch.arch) build_dir = join(source_dir, "p4a_build") install_dir = join(source_dir, "installation") - toolchain = join( - self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake" - ) + toolchain = join(self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake") generator = "Ninja" if shutil.which("ninja") else "Unix Makefiles" ensure_dir(build_dir) @@ -53,4 +48,4 @@ def build_arch(self, arch): shprint(sh.cmake, "--install", build_dir) -recipe = CglmRecipe() +recipe = LibCglmRecipe() From 7932a54be726c2a4e1e6078d8af4e7d92ad501c9 Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Sat, 28 Nov 2026 15:41:59 +0530 Subject: [PATCH 11/11] Fix bug in __init__.py --- pythonforandroid/recipes/datoviz/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/datoviz/__init__.py b/pythonforandroid/recipes/datoviz/__init__.py index 2d621f5196..fa5119106d 100644 --- a/pythonforandroid/recipes/datoviz/__init__.py +++ b/pythonforandroid/recipes/datoviz/__init__.py @@ -27,7 +27,7 @@ def build_arch(self, arch): toolchain = join(self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake") generator = "Ninja" if shutil.which("ninja") else "Unix Makefiles" cglm_install_dir = join( - Recipe.get_recipe("cglm", self.ctx).get_build_dir(arch.arch), + Recipe.get_recipe("libcglm", self.ctx).get_build_dir(arch.arch), "installation", )