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(a)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(a)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(a)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}/.."
+
BBCLASSEXTEND = "native"
FILES_${PN} += "${datadir}"
--
2.7.4
Hello all,
It seems that the external-linaro-toolchain recipe (in meta-linaro/meta-linaro-toolchain) doesn't work unless TI's meta-arago/meta-arago-extras layer is also present. That layer contains, among other things:
meta-arago-extras/recipes-devtools/meta/
* external-linaro-toolchain.bbappend - seems to fix a variety of packaging errors, and relaxes the requirement that external-linaro-toolchain itself provide libc Linux headers
* external-linaro-sdk-toolchain.bb - provides the cross-canadian toolchain, for building nativesdk packages. My understanding is that part is useable when the host machine is the same as the SDK machine (e.g. both x86_64-linux), since otherwise you would need two external toolchains.
* external-linaro-toolchain-cross.bb - seems to just provides some tweaks
* external-linaro-bfd-version.inc - populates ELT_VER_BFD with the detected version
meta-arago-extras/conf/distro/include/
* tclibc-external-linaro-toolchain.inc - the TCLIBC configuration that tells Yocto you're using the external Linaro glibc, instead of having Yocto built it.
Is my understanding correct? If so, I'd be curious to know why these files are in meta-arago, as opposed to just being moved into meta-linaro-toolchain itself. If it's just due to a lack of time, then I'd be more than willing to help out. As things currently exist, I find the 'external-linaro-toolchain' recipe in meta-linaro to be a bit of a "carrot on a stick" - it looks really promising and enticing, but you can't get it to work without lots of effort. That effort ultimately amounts to implementing the changes that are present in meta-arago-extras...
Thank you,
Chris Laplante
* use SRCREV instead of tag name, so that bitbake doesn't translate tag to SRCREV
every time it's parsing this recipe
* fix QA issue:
ERROR: QA Issue: python-wand: Files/directories were installed but not shipped in any package:
/usr/share
/usr/share/README.rst
* add comment about imagemagick version needed to use python-wand-native
otherwise it will use imagemagick from host
Signed-off-by: Martin Jansa <Martin.Jansa(a)gmail.com>
---
This is needed in all 3 branches: [morty][pyro][master]
But for pyro you'll need to first backport from master (or forward port from pyro) the upgrade to 0.4.4 from:
commit 7ed523b06bde259f99b21a15e8c936af4f18c752
Author: Fathi Boudra <fathi.boudra(a)linaro.org>
Date: Thu Oct 5 22:46:48 2017 +0300
meta-optee: python-wand: upgrade to latest release 0.4.4
Latest python-wand release is from October 2016.
Update to latest release: 0.4.4.
Change-Id: I23dc1fbb817bbb26357c3ab6dcc86b251eea36e6
Signed-off-by: Fathi Boudra <fathi.boudra(a)linaro.org>
.../recipes-devtools/python/python-wand_0.4.4.bb | 24 +++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
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 1043987..9679b9c 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
@@ -6,11 +6,33 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=170eafd687d4a2b950819cd5e067e6d5"
SRCNAME = "wand"
-SRC_URI = "git://github.com/dahlia/wand.git;tag=${PV}"
+SRCREV = "c731c620c3c96c409a194dafab396ffbb97d6702"
+SRC_URI = "git://github.com/dahlia/wand.git"
S = "${WORKDIR}/git"
inherit setuptools
+# Requires imagemagick-6 while meta-oe morty and newer provides imagemagick-7 which isn't compatible with wand
+#
+# You can import imagemagick-5 from older meta-oe, before this upgrade:
+# commit ec660639ecea3fcb6e554b6f1bafc504e8f2fc78
+# Author: Randy MacLeod <randy.macleod(a)windriver.com>
+# Date: Mon Aug 8 17:41:34 2016 -0400
+# imagemagick: upgrade from 6.9.2 to 7.0.2
+# and add this commit on top of that:
+# commit dfcb67af35936a351789044039a55e3fad299c1a
+# Author: Andreas Müller <schnitzeltony(a)googlemail.com>
+# Date: Sun Sep 18 02:47:26 2016 +0200
+# imagemagick: depend on fftw not virtual/fftw
+#
+# We need this old version becase python-wand-native used here
+# depends on older imagemagick-native as discussed here:
+# https://stackoverflow.com/questions/37011291/python-wand-image-is-not-recog…
+# there still isn't newer python-wand supporting 7.* version:
+# https://github.com/dahlia/wand/blob/4fe2c6ba9cb0d4105361cea6e9e9e8311608047…
+
DEPENDS += " imagemagick-native"
BBCLASSEXTEND = "native"
+
+FILES_${PN} += "${datadir}"
--
2.7.4