From af7ee7d3814d247aa11dc15e3ad4632bdd6a3aa5 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Sat, 25 May 2019 19:08:45 +0100 Subject: [PATCH] Deleted PIL recipe --- pythonforandroid/recipes/pil/__init__.py | 79 ----------------- pythonforandroid/recipes/pil/disable-tk.patch | 12 --- .../recipes/pil/fix-directories.patch | 85 ------------------- 3 files changed, 176 deletions(-) delete mode 100644 pythonforandroid/recipes/pil/__init__.py delete mode 100644 pythonforandroid/recipes/pil/disable-tk.patch delete mode 100644 pythonforandroid/recipes/pil/fix-directories.patch diff --git a/pythonforandroid/recipes/pil/__init__.py b/pythonforandroid/recipes/pil/__init__.py deleted file mode 100644 index f3ad2f42ef..0000000000 --- a/pythonforandroid/recipes/pil/__init__.py +++ /dev/null @@ -1,79 +0,0 @@ -from os.path import join, exists -from pythonforandroid.recipe import CompiledComponentsPythonRecipe -from pythonforandroid.toolchain import shprint -import sh - - -class PILRecipe(CompiledComponentsPythonRecipe): - name = 'pil' - version = '1.1.7' - url = 'http://effbot.org/downloads/Imaging-{version}.tar.gz' - depends = ['png', 'jpeg', 'setuptools'] - opt_depends = ['freetype'] - site_packages_name = 'PIL' - - patches = ['disable-tk.patch', - 'fix-directories.patch'] - - def get_recipe_env(self, arch=None, with_flags_in_cc=True): - env = super(PILRecipe, self).get_recipe_env(arch, with_flags_in_cc) - - env['PYTHON_INCLUDE_ROOT'] = self.ctx.python_recipe.include_root(arch.arch) - env['PYTHON_LINK_ROOT'] = self.ctx.python_recipe.link_root(arch.arch) - - ndk_lib_dir = join(self.ctx.ndk_platform, 'usr', 'lib') - ndk_include_dir = join(self.ctx.ndk_dir, 'sysroot', 'usr', 'include') - - png = self.get_recipe('png', self.ctx) - png_lib_dir = png.get_lib_dir(arch) - png_jni_dir = png.get_jni_dir(arch) - - jpeg = self.get_recipe('jpeg', self.ctx) - jpeg_inc_dir = jpeg_lib_dir = jpeg.get_build_dir(arch.arch) - - if 'freetype' in self.ctx.recipe_build_order: - freetype = self.get_recipe('freetype', self.ctx) - free_lib_dir = join(freetype.get_build_dir(arch.arch), 'objs', '.libs') - free_inc_dir = join(freetype.get_build_dir(arch.arch), 'include') - # hack freetype to be found by pil - freetype_link = join(free_inc_dir, 'freetype') - if not exists(freetype_link): - shprint(sh.ln, '-s', join(free_inc_dir), freetype_link) - - harfbuzz = self.get_recipe('harfbuzz', self.ctx) - harf_lib_dir = join(harfbuzz.get_build_dir(arch.arch), 'src', '.libs') - harf_inc_dir = harfbuzz.get_build_dir(arch.arch) - - env['FREETYPE_ROOT'] = '{}|{}'.format(free_lib_dir, free_inc_dir) - - env['JPEG_ROOT'] = '{}|{}'.format(jpeg_lib_dir, jpeg_inc_dir) - env['ZLIB_ROOT'] = '{}|{}'.format(ndk_lib_dir, ndk_include_dir) - - cflags = ' -std=c99' - cflags += ' -I{}'.format(png_jni_dir) - if 'freetype' in self.ctx.recipe_build_order: - cflags += ' -I{} -I{}'.format(harf_inc_dir, join(harf_inc_dir, 'src')) - cflags += ' -I{}'.format(free_inc_dir) - cflags += ' -I{}'.format(jpeg_inc_dir) - cflags += ' -I{}'.format(ndk_include_dir) - - py_v = self.ctx.python_recipe.major_minor_version_string - if py_v[0] == '3': - py_v += 'm' - - env['LIBS'] = ' -lpython{version} -lpng'.format(version=py_v) - if 'freetype' in self.ctx.recipe_build_order: - env['LIBS'] += ' -lfreetype -lharfbuzz' - env['LIBS'] += ' -ljpeg -lturbojpeg' - - env['LDFLAGS'] += ' -L{} -L{}'.format(env['PYTHON_LINK_ROOT'], png_lib_dir) - if 'freetype' in self.ctx.recipe_build_order: - env['LDFLAGS'] += ' -L{} -L{}'.format(harf_lib_dir, free_lib_dir) - env['LDFLAGS'] += ' -L{} -L{}'.format(jpeg_lib_dir, ndk_lib_dir) - - if cflags not in env['CFLAGS']: - env['CFLAGS'] += cflags - return env - - -recipe = PILRecipe() diff --git a/pythonforandroid/recipes/pil/disable-tk.patch b/pythonforandroid/recipes/pil/disable-tk.patch deleted file mode 100644 index c6934c9fdd..0000000000 --- a/pythonforandroid/recipes/pil/disable-tk.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- Imaging-1.1.7/setup.py.orig 2012-08-31 12:52:25.000000000 +0200 -+++ Imaging-1.1.7/setup.py 2012-08-31 12:53:04.000000000 +0200 -@@ -322,7 +322,7 @@ - "_imagingcms", ["_imagingcms.c"], libraries=["lcms"] + extra - )) - -- if sys.platform == "darwin": -+ if False: #sys.platform == "darwin": - # locate Tcl/Tk frameworks - frameworks = [] - framework_roots = [ - diff --git a/pythonforandroid/recipes/pil/fix-directories.patch b/pythonforandroid/recipes/pil/fix-directories.patch deleted file mode 100644 index b9daee3a1a..0000000000 --- a/pythonforandroid/recipes/pil/fix-directories.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- pil/setup.py.orig 2009-11-15 17:06:10.000000000 +0100 -+++ pil/setup.py 2019-01-04 11:08:47.302974315 +0100 -@@ -34,10 +34,10 @@ def libinclude(root): - # TIFF_ROOT = libinclude("/opt/tiff") - - TCL_ROOT = None --JPEG_ROOT = None --ZLIB_ROOT = None -+JPEG_ROOT = tuple(os.environ['JPEG_ROOT'].split('|')) if 'JPEG_ROOT' in os.environ else None -+ZLIB_ROOT = tuple(os.environ['ZLIB_ROOT'].split('|')) if 'ZLIB_ROOT' in os.environ else None - TIFF_ROOT = None --FREETYPE_ROOT = None -+FREETYPE_ROOT = tuple(os.environ['FREETYPE_ROOT'].split('|')) if 'FREETYPE_ROOT' in os.environ else None - LCMS_ROOT = None - - # FIXME: add mechanism to explicitly *disable* the use of a library -@@ -127,33 +127,10 @@ class pil_build_ext(build_ext): - - add_directory(include_dirs, "libImaging") - -- # -- # add platform directories -- -- if sys.platform == "cygwin": -- # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory -- add_directory(library_dirs, os.path.join( -- "/usr/lib", "python%s" % sys.version[:3], "config" -- )) -- -- elif sys.platform == "darwin": -- # attempt to make sure we pick freetype2 over other versions -- add_directory(include_dirs, "/sw/include/freetype2") -- add_directory(include_dirs, "/sw/lib/freetype2/include") -- # fink installation directories -- add_directory(library_dirs, "/sw/lib") -- add_directory(include_dirs, "/sw/include") -- # darwin ports installation directories -- add_directory(library_dirs, "/opt/local/lib") -- add_directory(include_dirs, "/opt/local/include") -- -- add_directory(library_dirs, "/usr/local/lib") -- # FIXME: check /opt/stuff directories here? -- -- prefix = sysconfig.get_config_var("prefix") -+ prefix = os.environ.get('PYTHON_LINK_ROOT') - if prefix: -- add_directory(library_dirs, os.path.join(prefix, "lib")) -- add_directory(include_dirs, os.path.join(prefix, "include")) -+ add_directory(library_dirs, os.environ.get('PYTHON_LINK_ROOT')) -+ add_directory(include_dirs, os.environ.get('PYTHON_INCLUDE_ROOT')) - - # - # locate tkinter libraries -@@ -199,22 +176,6 @@ class pil_build_ext(build_ext): - add_directory(include_dirs, include_root) - - # -- # add standard directories -- -- # look for tcl specific subdirectory (e.g debian) -- if _tkinter: -- tcl_dir = "/usr/include/tcl" + TCL_VERSION -- if os.path.isfile(os.path.join(tcl_dir, "tk.h")): -- add_directory(include_dirs, tcl_dir) -- -- # standard locations -- add_directory(library_dirs, "/usr/local/lib") -- add_directory(include_dirs, "/usr/local/include") -- -- add_directory(library_dirs, "/usr/lib") -- add_directory(include_dirs, "/usr/include") -- -- # - # insert new dirs *before* default libs, to avoid conflicts - # between Python PYD stub libs and real libraries - -@@ -299,8 +260,6 @@ class pil_build_ext(build_ext): - defs.append(("HAVE_LIBZ", None)) - if sys.platform == "win32": - libs.extend(["kernel32", "user32", "gdi32"]) -- if struct.unpack("h", "\0\1")[0] == 1: -- defs.append(("WORDS_BIGENDIAN", None)) - - exts = [(Extension( - "_imaging", files, libraries=libs, define_macros=defs