Skip to contentSkip to conversation

package/python-pillow: new package

PATCH Superseded Angelo Compagnucci 3 participants 3 messages Oct 14, 2015 – Oct 21, 2015

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

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

This patch adds python-pillow, the friendly python image library fork.

---
 package/Config.in                      |  1 +
 package/python-pillow/Config.in        | 53 ++++++++++++++++++++++++++++++++++
 package/python-pillow/python-pillow.mk | 36 +++++++++++++++++++++++
 3 files changed, 90 insertions(+)
 create mode 100644 package/python-pillow/Config.in
 create mode 100644 package/python-pillow/python-pillow.mk
package/Config.in +1 -0
index f686f13..7ba23f0 100644
@@ -633,6 +633,7 @@ menu "External python modules"
 	source "package/python-nfc/Config.in"
 	source "package/python-numpy/Config.in"
 	source "package/python-pam/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/Config.in new file +53 -0

53 lines not on this page · raw message

package/python-pillow/python-pillow.mk new file +36 -0
new file mode 100644
index 0000000..94c234e
@@ -0,0 +1,36 @@
+################################################################################
+#
+# python-pillow
+#
+################################################################################
+
+PYTHON_PILLOW_VERSION = 3.0.0
+PYTHON_PILLOW_SITE = $(call github,python-pillow,Pillow,$(PYTHON_PILLOW_VERSION))
+PYTHON_PILLOW_DEPENDENCIES = python-setuptools
+PYTHON_PILLOW_SETUP_TYPE = distutils
+
+ifeq ($(BR2_PACKAGE_PYTHON_PILLOW_JPEG),y)
+PYTHON_PILLOW_DEPENDENCIES += jpeg
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_PILLOW_ZLIB),y)
+PYTHON_PILLOW_DEPENDENCIES += zlib
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_PILLOW_TIFF),y)
+PYTHON_PILLOW_DEPENDENCIES += tiff
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_PILLOW_FREETYPE),y)
+PYTHON_PILLOW_DEPENDENCIES += freetype
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_PILLOW_WEBP),y)
+PYTHON_PILLOW_DEPENDENCIES += webp
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_PILLOW_JPEG2000),y)
+PYTHON_PILLOW_DEPENDENCIES += openjpeg
+endif
+
+$(eval $(python-package))
Signature · 1 line
1.9.1
#1 lore raw

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

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Angelo" == Angelo Compagnucci <[email protected]> writes:

This patch adds python-pillow, the friendly python image library fork.

Thanks, have you tested it with both python 2.7 and 3.x?

Quoted 29 lines
---
 package/Config.in                      |  1 +
 package/python-pillow/Config.in        | 53 ++++++++++++++++++++++++++++++++++
 package/python-pillow/python-pillow.mk | 36 +++++++++++++++++++++++
 3 files changed, 90 insertions(+)
 create mode 100644 package/python-pillow/Config.in
 create mode 100644 package/python-pillow/python-pillow.mk
package/Config.in +1 -0
index f686f13..7ba23f0 100644
@@ -633,6 +633,7 @@ menu "External python modules"
 	source "package/python-nfc/Config.in"
 	source "package/python-numpy/Config.in"
 	source "package/python-pam/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/Config.in new file +3 -0
new file mode 100644
index 0000000..7e19aec
@@ -0,0 +1,53 @@
+config BR2_PACKAGE_PYTHON_PILLOW
+	bool "python-pillow"
+	help

package/python-pillow/Config.in line 13

Quoted 10 lines
package/python-pillow/Config.in new file +10 -0
+	  Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is
+	  the Python Imaging Library by Fredrik Lundh and Contributors.
+
+	  https://pypi.python.org/pypi/Pillow/
+
+if BR2_PACKAGE_PYTHON_PILLOW
+
+config BR2_PACKAGE_PYTHON_PILLOW_JPEG
+	bool "JPEG support"
+	select BR2_PACKAGE_JPEG_LIBRARY

The option is simply called BR2_PACKAGE_JPEG.

package/python-pillow/Config.in line 14

Quoted 1 line
package/python-pillow/Config.in new file +1 -0
+	default n

'n' is the default value of a symbol, so you can drop it here and for the other options.

package/python-pillow/Config.in line 10

Quoted 12 lines
package/python-pillow/Config.in new file +11 -0
+++ b/package/python-pillow/python-pillow.mk
@@ -0,0 +1,36 @@
+################################################################################
+#
+# python-pillow
+#
+################################################################################
+
+PYTHON_PILLOW_VERSION = 3.0.0
+PYTHON_PILLOW_SITE = $(call github,python-pillow,Pillow,$(PYTHON_PILLOW_VERSION))
+PYTHON_PILLOW_DEPENDENCIES = python-setuptools
+PYTHON_PILLOW_SETUP_TYPE = distutils

Please also add license info.

package/python-pillow/Config.in line 13

Quoted 3 lines
package/python-pillow/Config.in new file +3 -0
+
+ifeq ($(BR2_PACKAGE_PYTHON_PILLOW_JPEG),y)
+PYTHON_PILLOW_DEPENDENCIES += jpeg

Is there no way of disabling support? If so, I think we should get rid of the explicit Config.in options and just enable support for the libraries that are enabled in the buildroot configuration, as it will add jpeg support if you have libjpeg enabled no matter if PYTHON_PILLOW_JPEG is enabled or not (if libjpeg happens to get built before pillow).

E.G.

PYTHON_PILLOW_DEPENDENCIES = \
      $(if $(BR2_PACKAGE_JPEG),jpeg) \
      $(if $(BR2_PACKAGE_ZLIB),zlib) \
      ..

It unfortunately doesn't build here because it looks in /usr/include for host headers:

/home/peko/source/buildroot/output-hest/host/usr/bin/arm-linux-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -I/usr/include/freetype2 -I/home/peko/source/buildroot/output-hest/build/python-pillow-3.0.0/libImaging -I/home/peko/source/buildroot/output-hest/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include -I/usr/local/include -I/usr/include -I/home/peko/source/buildroot/output-hest/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/python3.4m -I/usr/include/x86_64-linux-gnu -c libImaging/UnpackYCC.c -o build/temp.linux-x86_64-3.4/libImaging/UnpackYCC.o
arm-linux-gcc: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/freetype2'
arm-linux-gcc: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/freetype2'
..
arm-linux-gcc: ERROR: unsafe header/library path used in cross-compilation: '/lib64'
error: command '/home/peko/source/buildroot/output-hest/host/usr/bin/arm-linux-gcc' failed with exit status 1
package/pkg-generic.mk:188: recipe for target '/home/peko/source/buildroot/output-hest/build/python-pillow-3.0.0/.stamp_built' failed

Looking at setup.py I see a number of host header/library locations and host architecture checks, so that won't work for cross compilation.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

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

In reply to Angelo Compagnucci

Dear Angelo Compagnucci,

Quoted 10 lines · Angelo Compagnucci

This patch adds python-pillow, the friendly python image library fork.

---
 package/Config.in                      |  1 +
 package/python-pillow/Config.in        | 53 ++++++++++++++++++++++++++++++++++
 package/python-pillow/python-pillow.mk | 36 +++++++++++++++++++++++
 3 files changed, 90 insertions(+)
 create mode 100644 package/python-pillow/Config.in
 create mode 100644 package/python-pillow/python-pillow.mk

Following Peter Korsgaard's review, I've marked your patch as Changes Requested since there are a number of issues/comments to be addressed. Please make sure to send an updated version, otherwise we'll forget about your patch.

Thanks!

Thomas

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