--- /dev/null
+diff -Naur a/setup.py b/setup.py
+--- a/setup.py 2019-01-06 12:12:16.000000000 +0000
++++ b/setup.py 2019-01-08 23:04:45.574698210 +0000
+@@ -197,12 +197,13 @@
+
+ def _pkg_config(name):
+ try:
++ command = os.environ.get('PKG_CONFIG', 'pkg-config')
+ command_libs = [
+- 'pkg-config',
++ command,
+ '--libs-only-L', name,
+ ]
+ command_cflags = [
+- 'pkg-config',
++ command,
+ '--cflags-only-I', name,
+ ]
+ if not DEBUG:
+@@ -298,7 +299,7 @@
+ _add_directory(include_dirs, "src/libImaging")
+
+ pkg_config = None
+- if _cmd_exists('pkg-config'):
++ if _cmd_exists(os.environ.get('PKG_CONFIG', 'pkg-config')):
+ pkg_config = _pkg_config
+
+ #
--- /dev/null
+diff -Naur a/setup.py b/setup.py
+--- a/setup.py 2019-01-08 23:06:33.082873069 +0000
++++ b/setup.py 2019-01-08 23:06:47.707165225 +0000
+@@ -356,7 +356,7 @@
+ for d in os.environ[k].split(os.path.pathsep):
+ _add_directory(library_dirs, d)
+
+- prefix = sysconfig.get_config_var("prefix")
++ prefix = None
+ if prefix:
+ _add_directory(library_dirs, os.path.join(prefix, "lib"))
+ _add_directory(include_dirs, os.path.join(prefix, "include"))
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy )
PYTHON_REQ_USE='tk?,threads(+)'
-inherit distutils-r1 virtualx
+inherit distutils-r1 toolchain-funcs virtualx
MY_PN=Pillow
MY_P=${MY_PN}-${PV}
S="${WORKDIR}/${MY_P}"
PATCHES=(
- "${FILESDIR}/${PN}-5.2.0-fix-lib-paths.patch"
+ "${FILESDIR}"/${PN}-5.4.1-{pkg-config,toolchain-paths}.patch
)
python_configure_all() {
$(use_enable webp webpmux)
$(use_enable zlib)
)
+
+ # setup.py sucks at adding the right toolchain paths but it does
+ # accept additional ones from INCLUDE and LIB so set these. You
+ # wouldn't normally need these at all as the toolchain should look
+ # here anyway but this setup.py does stupid things.
+ export \
+ INCLUDE=${ESYSROOT}/usr/include \
+ LIB=${ESYSROOT}/usr/$(get_libdir)
+
+ # We have patched in this env var.
+ tc-export PKG_CONFIG
}
python_compile_all() {