Skip to content

Commit

Permalink
Update libpng recipe and build SDL2_ttf vendored freetype with …
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
misl6 authored Jul 16, 2023
1 parent f10918c commit 5f3ad37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
12 changes: 7 additions & 5 deletions kivy_ios/recipes/libpng/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
11 changes: 7 additions & 4 deletions kivy_ios/recipes/sdl2_ttf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@


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,
"ONLY_ACTIVE_ARCH=NO",
"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",
Expand Down

0 comments on commit 5f3ad37

Please sign in to comment.