Skip to contentSkip to conversation

package/python-pillow: new package

PATCH Superseded Angelo Compagnucci 3 participants 4 messages Jun 29, 2016 – Jul 5, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 package/python-pillow: new package

This patch adds python pillow, the friendly python image library fork, it includes a backported patch to disable configuration platfom guessing.

---
Changes

v5 -> v6:

* Fixed sob in patch (Bernd Kuhls)

v4 -> v5:

* Better build and install opts handling (Peter Korsgaard)
* Strong sha256 hash
* Simplified INSTALL_TARGET_CMDS
* Better commit message

 package/Config.in                                  |  1 +
 ...y-add-option-to-disable-platform-guessing.patch | 65 ++++++++++++++++++++++
 package/python-pillow/Config.in                    | 12 ++++
 package/python-pillow/python-pillow.hash           |  4 ++
 package/python-pillow/python-pillow.mk             | 33 +++++++++++
 5 files changed, 115 insertions(+)
 create mode 100644 package/python-pillow/0001-setup.py-add-option-to-disable-platform-guessing.patch
 create mode 100644 package/python-pillow/Config.in
 create mode 100644 package/python-pillow/python-pillow.hash
 create mode 100644 package/python-pillow/python-pillow.mk
package/Config.in +1 -0
index 4c39b12..15a266b 100644
@@ -707,6 +707,7 @@ menu "External python modules"
 	source "package/python-pathtools/Config.in"
 	source "package/python-pathvalidate/Config.in"
 	source "package/python-pexpect/Config.in"
+	source "package/python-pillow/Config.in"
 	source "package/python-posix-ipc/Config.in"
 	source "package/python-protobuf/Config.in"
 	source "package/python-psutil/Config.in"
package/python-pillow/0001-setup.py-add-option-to-disable-platform-guessing.patch new file +65 -0

65 lines not on this page · raw message

package/python-pillow/Config.in new file +12 -0
new file mode 100644
index 0000000..d5c3809
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_PYTHON_PILLOW
+	bool "python-pillow"
+	help
+	  Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is
+	  the Python Imaging Library by Fredrik Lundh and Contributors.
+
+	  Pillow relies on external libraries to provide support various
+	  image formats. Select the corresponding package(s) to get this
+	  support. Pillow can use jpeg, zlib (for PNG), tiff, freetype, webp,
+	  and openjpeg (JPEG-2000).
+
+	  https://pypi.python.org/pypi/Pillow/
package/python-pillow/python-pillow.hash new file +4 -0
new file mode 100644
index 0000000..6de9606
@@ -0,0 +1,4 @@
+# https://pypi.python.org/pypi?:action=show_md5&digest=7cfd093c11205d9e2ebe3c51dfcad510
+md5 7cfd093c11205d9e2ebe3c51dfcad510  Pillow-3.2.0.tar.gz
+# sha256 locally computed
+sha256 64b0a057210c480aea99406c9391180cd866fc0fd8f0b53367e3af21b195784a  Pillow-3.2.0.tar.gz
package/python-pillow/python-pillow.mk new file +33 -0
new file mode 100644
index 0000000..2926886
@@ -0,0 +1,33 @@
+################################################################################
+#
+# python-pillow
+#
+################################################################################
+
+PYTHON_PILLOW_VERSION = 3.2.0
+PYTHON_PILLOW_SOURCE = Pillow-$(PYTHON_PILLOW_VERSION).tar.gz
+PYTHON_PILLOW_SITE = https://pypi.python.org/packages/source/P/Pillow
+PYTHON_PILLOW_SETUP_TYPE = setuptools
+PYTHON_PILLOW_DEPENDENCIES = $(if $(BR2_PACKAGE_JPEG),jpeg) \
+      $(if $(BR2_PACKAGE_ZLIB),zlib) \
+      $(if $(BR2_PACKAGE_TIFF),tiff) \
+      $(if $(BR2_PACKAGE_FREETYPE),freetype) \
+      $(if $(BR2_PACKAGE_WEBP),webp) \
+      $(if $(BR2_PACKAGE_OPENJPEG),openjpeg)
+
+PYTHON_PILLOW_BUILD_OPTS = --disable-platform-guessing
+PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_JPEG),--enable-jpeg,--disable-jpeg)
+PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_ZLIB),--enable-zlib,--disable-zlib)
+PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_TIFF),--enable-tiff,--disable-tiff)
+PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_FREETYPE),--enable-freetype,--disable-freetype)
+PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_WEBP),--enable-webp,--disable-webp)
+PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_OPENJPEG),--enable-jpeg2000,--disable-jpeg2000)
+
+PYTHON_PILLOW_BUILD_CMDS = cd $(PYTHON_PILLOW_BUILDDIR); \
+		$(PYTHON_PILLOW_BASE_ENV) $(PYTHON_PILLOW_ENV) \
+		$(PYTHON_PILLOW_PYTHON_INTERPRETER) setup.py build_ext \
+		$(PYTHON_PILLOW_BASE_BUILD_OPTS) $(PYTHON_PILLOW_BUILD_OPTS)
+
+PYTHON_PILLOW_INSTALL_TARGET_CMDS = $(PYTHON_PILLOW_BUILD_CMDS) install
+
+$(eval $(python-package))
Signature · 1 line
1.9.1
#1 lore raw

PATCH v6 1/1 package/python-pillow: new package

Hi,

my first try to get this package to work with Kodi failed due to segfaults I have yet to investigate. I am sending this mail to inform you about some other stuff I found out while working on the package.

[posted and mailed]

Quoted 1 line
 ...y-add-option-to-disable-platform-guessing.patch | 65 

++++++++++++++++++++++

You can remove this patch because python-pillow-3.3.0, released 2016-07-01 includes it.

Quoted 1 line

+PYTHON_PILLOW_VERSION = 3.2.0

See above, please bump to 3.3.0.

Quoted 1 line

+PYTHON_PILLOW_INSTALL_TARGET_CMDS = $(PYTHON_PILLOW_BUILD_CMDS) install

With my setup I needed to remove this line, otherwise the files installed by this package would end up in $(HOST_DIR) instead of $(TARGET_DIR).

While investigating the Kodi segfault I saw that they carry their own cross compile patch in
https://github.com/xbmc/xbmc/tree/master/tools/depends/target/pythonmodule-
pil

Though aimed at pillow-3.0.0, it is possible to rebase the patch for 3.3.0, but I am lacking time atm to continue working on it.

Regards, Bernd

#2 lore raw

PATCH v6 1/1 package/python-pillow: new package

Dear Bernd Kuhls,

2016-07-03 20:18 GMT+02:00 Bernd Kuhls <[email protected]>:

Quoted 11 lines

Hi,

my first try to get this package to work with Kodi failed due to segfaults I have yet to investigate. I am sending this mail to inform you about some other stuff I found out while working on the package.

[posted and mailed]

Quoted 1 line
 ...y-add-option-to-disable-platform-guessing.patch | 65
Quoted 8 lines

++++++++++++++++++++++

You can remove this patch because python-pillow-3.3.0, released 2016-07-01 includes it.

Quoted 1 line

+PYTHON_PILLOW_VERSION = 3.2.0

See above, please bump to 3.3.0.

Wonderful news!

Quoted 4 lines
Quoted 1 line

+PYTHON_PILLOW_INSTALL_TARGET_CMDS = $(PYTHON_PILLOW_BUILD_CMDS) install

With my setup I needed to remove this line, otherwise the files installed by this package would end up in $(HOST_DIR) instead of $(TARGET_DIR).

I'll give a look at this but I have used this package several times in the past and never encountered such a problem. Probably something related to the latests releases.

Quoted 7 lines

While investigating the Kodi segfault I saw that they carry their own cross compile patch in
https://github.com/xbmc/xbmc/tree/master/tools/depends/target/pythonmodule-
pil

Though aimed at pillow-3.0.0, it is possible to rebase the patch for 3.3.0, but I am lacking time atm to continue working on it.

I had a look at this patch but it implements in a cruder way what I've done with the implementation of --disable-platform-guessing configuration switch.

Quoted 3 lines

Regards, Bernd

Sincerely, Angelo

#3 lore raw

PATCH v6 1/1 package/python-pillow: new package

In reply to Angelo Compagnucci

Hello,

Quoted 4 lines · Angelo Compagnucci

This patch adds python pillow, the friendly python image library fork, it includes a backported patch to disable configuration platfom guessing.

Applied, after doing a number of changes:

[Thomas:
- Rewrap Config.in help text.
- As suggested by Bernd Kuhls, bump the version to 3.3.0 and drop the patch that has been applied upstream.
- Rework the optional dependency handling to follow what we do in most Buildroot packages.
- Add licensing information.]

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com