From 5f3ad37dc90bd5abfebf20f263d5fe0d6ba0efef Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Sun, 16 Jul 2023 15:52:13 +0200 Subject: [PATCH] Update `libpng` recipe and build `SDL2_ttf` vendored `freetype` with png support, so can render colored emoji (#827) * Update libpng recipe and build SDL2_ttf vendored freetype with png support, so can render colored emoji * Revert to previous link, now that we can download from sourceforge (non-mirror) --- kivy_ios/recipes/libpng/__init__.py | 12 +++++++----- kivy_ios/recipes/sdl2_ttf/__init__.py | 11 +++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/kivy_ios/recipes/libpng/__init__.py b/kivy_ios/recipes/libpng/__init__.py index 410c397e9..3d20dba96 100644 --- a/kivy_ios/recipes/libpng/__init__.py +++ b/kivy_ios/recipes/libpng/__init__.py @@ -5,24 +5,26 @@ class PngRecipe(Recipe): - version = '1.6.26' - url = 'http://downloads.sourceforge.net/sourceforge/libpng/libpng-{version}.tar.gz' - depends = ["python"] - library = '.libs/libpng16.a' + version = '1.6.40' + url = 'https://downloads.sourceforge.net/sourceforge/libpng/libpng-{version}.tar.gz' + library = 'dist/lib/libpng16.a' + include_dir = 'dist/include' def build_arch(self, arch): build_env = arch.get_env() configure = sh.Command(join(self.build_dir, "configure")) + shprint(configure, "CC={}".format(build_env["CC"]), "LD={}".format(build_env["LD"]), "CFLAGS={}".format(build_env["CFLAGS"]), "LDFLAGS={}".format(build_env["LDFLAGS"]), - "--prefix=/", + "--prefix={}".format(join(self.build_dir, "dist")), "--host={}".format(arch.triple), "--disable-shared") shprint(sh.make, "clean") shprint(sh.make, self.ctx.concurrent_make, _env=build_env) + shprint(sh.make, "install", _env=build_env) recipe = PngRecipe() diff --git a/kivy_ios/recipes/sdl2_ttf/__init__.py b/kivy_ios/recipes/sdl2_ttf/__init__.py index 144e7e1a0..16a945fa5 100644 --- a/kivy_ios/recipes/sdl2_ttf/__init__.py +++ b/kivy_ios/recipes/sdl2_ttf/__init__.py @@ -4,11 +4,11 @@ class LibSDL2TTFRecipe(Recipe): - version = "2.20.1" + version = "2.20.2" url = "https://github.com/libsdl-org/SDL_ttf/releases/download/release-{version}/SDL2_ttf-{version}.tar.gz" library = "Xcode/build/Release-{arch.sdk}/libSDL2_ttf.a" include_dir = "SDL_ttf.h" - depends = ["sdl2"] + depends = ["libpng", "sdl2"] def build_arch(self, arch): shprint(sh.xcodebuild, self.ctx.concurrent_xcodebuild, @@ -16,8 +16,11 @@ def build_arch(self, arch): "ARCHS={}".format(arch.arch), "BITCODE_GENERATION_MODE=bitcode", "GENERATE_MASTER_OBJECT_FILE=YES", - "HEADER_SEARCH_PATHS={}".format( - join(self.ctx.include_dir, "common", "sdl2")), + "HEADER_SEARCH_PATHS={sdl_include_dir} {libpng_include_dir}".format( + sdl_include_dir=join(self.ctx.include_dir, "common", "sdl2"), + libpng_include_dir=join(self.ctx.include_dir, "common", "libpng"), + ), + "GCC_PREPROCESSOR_DEFINITIONS=$(GCC_PREPROCESSOR_DEFINITIONS) FT_CONFIG_OPTION_USE_PNG=1", "-sdk", arch.sdk, "-project", "Xcode/SDL_ttf.xcodeproj", "-target", "Static Library",