[oe] [meta-python][PATCH 2/2] python3-pillow: add 5.4.1
Khem Raj
raj.khem at gmail.com
Fri Mar 15 16:16:52 UTC 2019
Fails to build on rpi3
https://errors.yoctoproject.org/Errors/Details/232969/
On Thu, Mar 14, 2019 at 2:26 AM Hongxu Jia <hongxu.jia at windriver.com> wrote:
>
> Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
> ---
> .../0001-support-cross-compiling.patch | 61 ++++++++++++++++++++++
> .../python/python3-pillow_5.4.1.bb | 44 ++++++++++++++++
> 2 files changed, 105 insertions(+)
> create mode 100644 meta-python/recipes-devtools/python/python3-pillow/0001-support-cross-compiling.patch
> create mode 100644 meta-python/recipes-devtools/python/python3-pillow_5.4.1.bb
>
> diff --git a/meta-python/recipes-devtools/python/python3-pillow/0001-support-cross-compiling.patch b/meta-python/recipes-devtools/python/python3-pillow/0001-support-cross-compiling.patch
> new file mode 100644
> index 0000000..e862934
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-pillow/0001-support-cross-compiling.patch
> @@ -0,0 +1,61 @@
> +From a78411402c824668283beb94db4bf7e206a4cf60 Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia at windriver.com>
> +Date: Thu, 14 Mar 2019 03:48:10 -0400
> +Subject: [PATCH] support cross compiling
> +
> +Upstream-Status: Inappropriate [oe specific]
> +
> +Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
> +---
> + setup.py | 13 +++----------
> + 1 file changed, 3 insertions(+), 10 deletions(-)
> +
> +diff --git a/setup.py b/setup.py
> +index 79f912b..37e5827 100755
> +--- a/setup.py
> ++++ b/setup.py
> +@@ -50,7 +50,7 @@ _LIB_IMAGING = (
> + "ZipEncode", "TiffDecode", "Jpeg2KDecode", "Jpeg2KEncode", "BoxBlur",
> + "QuantPngQuant", "codec_fd")
> +
> +-DEBUG = False
> ++DEBUG = True
> +
> +
> + class DependencyException(Exception):
> +@@ -345,21 +345,16 @@ class pil_build_ext(build_ext):
> + _add_directory(library_dirs, match.group(1))
> +
> + # include, rpath, if set as environment variables:
> +- for k in ('C_INCLUDE_PATH', 'CPATH', 'INCLUDE'):
> ++ for k in ('C_INCLUDE_PATH', 'CPATH', 'INCLUDE', 'STAGING_INCDIR'):
> + if k in os.environ:
> + for d in os.environ[k].split(os.path.pathsep):
> + _add_directory(include_dirs, d)
> +
> +- for k in ('LD_RUN_PATH', 'LIBRARY_PATH', 'LIB'):
> ++ for k in ('LD_RUN_PATH', 'LIBRARY_PATH', 'LIB', 'STAGING_LIBDIR'):
> + if k in os.environ:
> + for d in os.environ[k].split(os.path.pathsep):
> + _add_directory(library_dirs, d)
> +
> +- prefix = sysconfig.get_config_var("prefix")
> +- if prefix:
> +- _add_directory(library_dirs, os.path.join(prefix, "lib"))
> +- _add_directory(include_dirs, os.path.join(prefix, "include"))
> +-
> + #
> + # add platform directories
> +
> +@@ -413,8 +408,6 @@ class pil_build_ext(build_ext):
> + elif sys.platform.startswith("linux") or \
> + sys.platform.startswith("gnu") or \
> + sys.platform.startswith("freebsd"):
> +- for dirname in _find_library_dirs_ldconfig():
> +- _add_directory(library_dirs, dirname)
> + if sys.platform.startswith("linux") and \
> + os.environ.get('ANDROID_ROOT', None):
> + # termux support for android.
> +--
> +2.8.1
> +
> diff --git a/meta-python/recipes-devtools/python/python3-pillow_5.4.1.bb b/meta-python/recipes-devtools/python/python3-pillow_5.4.1.bb
> new file mode 100644
> index 0000000..db656e0
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-pillow_5.4.1.bb
> @@ -0,0 +1,44 @@
> +SUMMARY = "Python Imaging Library (Fork). Pillow is the friendly PIL fork by Alex \
> +Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and \
> +Contributors."
> +HOMEPAGE = "https://pillow.readthedocs.io"
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=c6379001ecb47e2a0420c40177fc1125"
> +
> +SRC_URI = "git://github.com/python-pillow/Pillow.git;branch=5.4.x \
> + file://0001-support-cross-compiling.patch \
> +"
> +SRCREV ?= "f38f01bbe3a0a9f49ce592c86ff20c01c9655133"
> +
> +
> +inherit setuptools3
> +do_compile() {
> + NO_FETCH_BUILD=1 \
> + STAGING_INCDIR=${STAGING_INCDIR} \
> + STAGING_LIBDIR=${STAGING_LIBDIR} \
> + ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \
> + build_ext --disable-platform-guessing \
> + --enable-zlib \
> + --enable-jpeg \
> + --enable-tiff \
> + --enable-freetype \
> + --enable-lcms \
> + --enable-jpeg2000 \
> + --disable-webp \
> + --disable-webpmux \
> + --disable-imagequant || \
> + bbfatal_log "'${PYTHON_PN} setup.py build_ext' execution failed."
> +}
> +
> +DEPENDS += " \
> + zlib \
> + jpeg \
> + tiff \
> + freetype \
> + lcms \
> + openjpeg \
> +"
> +
> +S = "${WORKDIR}/git"
> +
> +BBCLASSEXTEND = "native"
> --
> 2.7.4
>
More information about the Openembedded-devel
mailing list