From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- ...ing-setup.py-force-paths-for-zlib-freetyp.patch | 55 ++++++++++++++++++ .../allow.to.disable.some.features.patch | 65 ++++++++++++++++++++++ .../python-imaging/fix-freetype-includes.patch | 30 ++++++++++ .../python-imaging-CVE-2016-2533.patch | 38 +++++++++++++ .../python/python-imaging/remove-host-libdir.patch | 25 +++++++++ 5 files changed, 213 insertions(+) create mode 100644 meta-openembedded/meta-python/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch create mode 100644 meta-openembedded/meta-python/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch create mode 100644 meta-openembedded/meta-python/recipes-devtools/python/python-imaging/fix-freetype-includes.patch create mode 100644 meta-openembedded/meta-python/recipes-devtools/python/python-imaging/python-imaging-CVE-2016-2533.patch create mode 100644 meta-openembedded/meta-python/recipes-devtools/python/python-imaging/remove-host-libdir.patch (limited to 'meta-openembedded/meta-python/recipes-devtools/python/python-imaging') diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch new file mode 100644 index 000000000..2575306be --- /dev/null +++ b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch @@ -0,0 +1,55 @@ +From 07d4f095a9e22ae676a8d68073101131e65012dc Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Tue, 15 Nov 2011 13:16:54 +0100 +Subject: [PATCH] python imaging setup.py: force paths for zlib, freetype and jpeg and don't add host paths + +Signed-off-by: Koen Kooi + +Upstream-Status: Inappropriate [embedded specific] +--- + setup.py | 14 +++----------- + 1 files changed, 3 insertions(+), 11 deletions(-) + +diff --git a/setup.py b/setup.py +index 5d4d53a..b1a22ec 100644 +--- a/setup.py ++++ b/setup.py +@@ -34,10 +34,10 @@ def libinclude(root): + # TIFF_ROOT = libinclude("/opt/tiff") + + TCL_ROOT = None +-JPEG_ROOT = None +-ZLIB_ROOT = None ++JPEG_ROOT = os.environ['STAGING_LIBDIR'] ++ZLIB_ROOT = os.environ['STAGING_LIBDIR'] + TIFF_ROOT = None +-FREETYPE_ROOT = None ++FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR'] + LCMS_ROOT = None + + # FIXME: add mechanism to explicitly *disable* the use of a library +@@ -147,7 +147,6 @@ class pil_build_ext(build_ext): + 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") +@@ -207,13 +206,6 @@ class pil_build_ext(build_ext): + 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 +-- +1.7.2.5 + diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch new file mode 100644 index 000000000..4960ed466 --- /dev/null +++ b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch @@ -0,0 +1,65 @@ +At least lcms wasn't deterministicly detected from sysroot. + +This will allow to export LCMS_ENABLED=False when lcms isn't in PACKAGECONFIG. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Martin Jansa + +diff -uNr Imaging-1.1.7.orig/setup.py Imaging-1.1.7/setup.py +--- Imaging-1.1.7.orig/setup.py 2013-07-22 10:17:02.081457075 +0200 ++++ Imaging-1.1.7/setup.py 2013-07-22 13:10:09.029707492 +0200 +@@ -39,6 +39,12 @@ + TIFF_ROOT = None + FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR'] + LCMS_ROOT = None ++TCL_ENABLED = os.getenv('TCL_ENABLED', "True") ++JPEG_ENABLED = os.getenv('JPEG_ENABLED', "True") ++ZLIB_ENABLED = os.getenv('ZLIB_ENABLED', "True") ++TIFF_ENABLED = os.getenv('TIFF_ENABLED', "True") ++FREETYPE_ENABLED = os.getenv('FREETYPE_ENABLED', "True") ++LCMS_ENABLED = os.getenv('LCMS_ENABLED', "True") + + # FIXME: add mechanism to explicitly *disable* the use of a library + +@@ -220,22 +226,22 @@ + zlib = jpeg = tiff = freetype = tcl = tk = lcms = None + feature = feature() + +- if find_include_file(self, "zlib.h"): ++ if ZLIB_ENABLED == 'True' and find_include_file(self, "zlib.h"): + if find_library_file(self, "z"): + feature.zlib = "z" + elif sys.platform == "win32" and find_library_file(self, "zlib"): + feature.zlib = "zlib" # alternative name + +- if find_include_file(self, "jpeglib.h"): ++ if JPEG_ENABLED == 'True' and find_include_file(self, "jpeglib.h"): + if find_library_file(self, "jpeg"): + feature.jpeg = "jpeg" + elif sys.platform == "win32" and find_library_file(self, "libjpeg"): + feature.jpeg = "libjpeg" # alternative name + +- if find_library_file(self, "tiff"): ++ if TIFF_ENABLED == 'True' and find_library_file(self, "tiff"): + feature.tiff = "tiff" + +- if find_library_file(self, "freetype"): ++ if FREETYPE_ENABLED == 'True' and find_library_file(self, "freetype"): + # look for freetype2 include files + freetype_version = 0 + for dir in self.compiler.include_dirs: +@@ -256,11 +262,11 @@ + if dir: + add_directory(self.compiler.include_dirs, dir, 0) + +- if find_include_file(self, "lcms.h"): ++ if LCMS_ENABLED == 'True' and find_include_file(self, "lcms.h"): + if find_library_file(self, "lcms"): + feature.lcms = "lcms" + +- if _tkinter and find_include_file(self, "tk.h"): ++ if TCL_ENABLED == 'True' and _tkinter and find_include_file(self, "tk.h"): + # the library names may vary somewhat (e.g. tcl84 or tcl8.4) + version = TCL_VERSION[0] + TCL_VERSION[2] + if find_library_file(self, "tcl" + version): diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/fix-freetype-includes.patch b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/fix-freetype-includes.patch new file mode 100644 index 000000000..9ecc63a0d --- /dev/null +++ b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/fix-freetype-includes.patch @@ -0,0 +1,30 @@ +Upstream-Status: Backport +Signed-off-by: Ross Burton + +From c6040f618d8f2706a7b46d1cdf37d1a587f9701f Mon Sep 17 00:00:00 2001 +From: Andrew Stromnov +Date: Thu, 28 Nov 2013 16:58:43 +0400 +Subject: [PATCH] fix compiling with FreeType 2.5.1 + +--- + _imagingft.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/_imagingft.c b/_imagingft.c +index 47d50bd..f19555b 100644 +--- a/_imagingft.c ++++ b/_imagingft.c +@@ -59,7 +59,11 @@ struct { + const char* message; + } ft_errors[] = + ++#if defined(USE_FREETYPE_2_1) ++#include FT_ERRORS_H ++#else + #include ++#endif + + /* -------------------------------------------------------------------- */ + /* font objects */ +-- +1.8.5.1 diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/python-imaging-CVE-2016-2533.patch b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/python-imaging-CVE-2016-2533.patch new file mode 100644 index 000000000..b01136f9a --- /dev/null +++ b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/python-imaging-CVE-2016-2533.patch @@ -0,0 +1,38 @@ +python-imaging: CVE-2016-2533 + +the patch comes from: +https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2533 +https://github.com/python-pillow/Pillow/commit/ae453aa18b66af54e7ff716f4ccb33adca60afd4#diff-8ff6909c159597e22288ad818938fd6b + +PCD decoder overruns the shuffle buffer, Fixes #568 + +Signed-off-by: Li Wang +--- + libImaging/PcdDecode.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libImaging/PcdDecode.c b/libImaging/PcdDecode.c +index b6898e3..c02d005 100644 +--- a/libImaging/PcdDecode.c ++++ b/libImaging/PcdDecode.c +@@ -47,7 +47,7 @@ ImagingPcdDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) + out[0] = ptr[x]; + out[1] = ptr[(x+4*state->xsize)/2]; + out[2] = ptr[(x+5*state->xsize)/2]; +- out += 4; ++ out += 3; + } + + state->shuffle((UINT8*) im->image[state->y], +@@ -62,7 +62,7 @@ ImagingPcdDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) + out[0] = ptr[x+state->xsize]; + out[1] = ptr[(x+4*state->xsize)/2]; + out[2] = ptr[(x+5*state->xsize)/2]; +- out += 4; ++ out += 3; + } + + state->shuffle((UINT8*) im->image[state->y], +-- +1.7.9.5 + diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/remove-host-libdir.patch b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/remove-host-libdir.patch new file mode 100644 index 000000000..028a51ad5 --- /dev/null +++ b/meta-openembedded/meta-python/recipes-devtools/python/python-imaging/remove-host-libdir.patch @@ -0,0 +1,25 @@ +Avoid getting host sysroot paths in the library paths to fix issue like: + +| /home/andrei/work/yocto/build-rpi-master/tmp/sysroots/x86_64-linux/usr/lib/libz.so: file not recognized: File format not recognized + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Andrei Gherzan + + +Index: Imaging-1.1.7/setup.py +=================================================================== +--- Imaging-1.1.7.orig/setup.py ++++ Imaging-1.1.7/setup.py +@@ -155,11 +155,6 @@ class pil_build_ext(build_ext): + + # FIXME: check /opt/stuff directories here? + +- 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")) +- + # + # locate tkinter libraries + -- cgit v1.2.3