On Fri, Oct 27, 2017 at 11:09:41AM -0700, Khem Raj wrote:
On Wed, Oct 25, 2017 at 5:12 AM, Tom Rini trini@konsulko.com wrote:
It can be slightly tricky to build a copy of python-wand that will also function. A problem is that without additional logic (MAGICK_HOME), the python code will not look outside of system paths for a copy of the imagemagick library. However, even with this path added to the search list, the code will still try a 'naked' load of the library it wants. This can result in a visible failure if you have a new enough imagemagic-6 installed (such as 6.9.7) as the date string checking logic will fail. Work around these problems by setting MAGICK_HOME globally to the correct location and patch the api code to look for the form of imagemagick that we build first, rather than last, so that we are going to first search for what we know we built.
Signed-off-by: Tom Rini trini@konsulko.com
This patch should be applied to at least master, pyro and rocko. Arguably this should also be applied further back as without MAGICK_HOME it will never be looking in our sysroot.
.../0001-wand-api.py-Change-search-order.patch | 32 ++++++++++++++++++++++ .../recipes-devtools/python/python-wand_0.4.4.bb | 7 ++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 meta-optee/recipes-devtools/python/python-wand/0001-wand-api.py-Change-search-order.patch
diff --git a/meta-optee/recipes-devtools/python/python-wand/0001-wand-api.py-Change-search-order.patch b/meta-optee/recipes-devtools/python/python-wand/0001-wand-api.py-Change-search-order.patch new file mode 100644 index 000000000000..ac2c0b0622c0 --- /dev/null +++ b/meta-optee/recipes-devtools/python/python-wand/0001-wand-api.py-Change-search-order.patch @@ -0,0 +1,32 @@ +From 7691ebcf38c59332eb819f909250a22ba5e8e50b Mon Sep 17 00:00:00 2001 +From: Tom Rini trini@konsulko.com +Date: Tue, 24 Oct 2017 12:01:51 -0400 +Subject: [PATCH 1/1] wand/api.py: Change search order
+In addition to specifying MAGICK_HOME to ensure that we will even look +within our desired paths, we need to also check for the type of library +that we know we have. Otherwise we may find a different form of the +library in one of the system paths before we try ours.
+Upstream-Status: Inappropriate [configuration] +Signed-off-by: Tom Rini trini@konsulko.com +---
- wand/api.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+diff --git a/wand/api.py b/wand/api.py +index 19cf6d2..dde9c5e 100644 +--- a/wand/api.py ++++ b/wand/api.py +@@ -55,7 +55,7 @@ def library_paths():
"""
libwand = None
libmagick = None
+- versions = '', '-6', '-Q16', '-Q8', '-6.Q16' ++ versions = '-6.Q16', '-6', '-Q16', '-Q8', ''
options = '', 'HDRI', 'HDRI-2'
system = platform.system()
magick_home = os.environ.get('MAGICK_HOME')
+-- +2.11.0
diff --git a/meta-optee/recipes-devtools/python/python-wand_0.4.4.bb b/meta-optee/recipes-devtools/python/python-wand_0.4.4.bb index 9679b9c9f658..605bc59e2707 100644 --- a/meta-optee/recipes-devtools/python/python-wand_0.4.4.bb +++ b/meta-optee/recipes-devtools/python/python-wand_0.4.4.bb @@ -7,7 +7,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=170eafd687d4a2b950819cd5e067e6d5" SRCNAME = "wand"
SRCREV = "c731c620c3c96c409a194dafab396ffbb97d6702" -SRC_URI = "git://github.com/dahlia/wand.git" +SRC_URI = "git://github.com/dahlia/wand.git \
file://0001-wand-api.py-Change-search-order.patch"
S = "${WORKDIR}/git"
inherit setuptools @@ -33,6 +34,10 @@ inherit setuptools
DEPENDS += " imagemagick-native"
+# Tell python-wand where to look for our imagemagick and it must be +# one level up from where 'lib' resides. +export MAGICK_HOME="${STAGING_LIBDIR_NATIVE}/.."
peeking into nativesysroot seems a bit suspicious. should this be STAGING_DIR_TARGET
Nope, this is only used for "I need to run ..." right now stuff. Is this package badly behaved? Yes. Do I look forward to the ability for it to be dropped in the future (Koen told me today optee has moved to not need this so at some point newer versions mean we can drop this)? Yes. :) Thanks!