package/python-pillow: new package
PATCH v2 1/1 package/python-pillow: new package
This patch adds python-pillow, the friendly python image library fork.
---
Changes:
v1 -> v2:
* Added patch to remove platform guessing, now headers should be searched in buildroot folders
* Fixed optional configure options
package/Config.in | 1 + ...setup.py-removing-unneeded-platform-guess.patch | 85 ++++++++++++++++++++++ package/python-pillow/Config.in | 47 ++++++++++++ package/python-pillow/python-pillow.mk | 18 +++++ 4 files changed, 151 insertions(+) create mode 100644 package/python-pillow/0001-setup.py-removing-unneeded-platform-guess.patch create mode 100644 package/python-pillow/Config.in create mode 100644 package/python-pillow/python-pillow.mk
package/Config.in +1 -0
@@ -634,6 +634,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/0001-setup.py-removing-unneeded-platform-guess.patch new file +85 -0
85 lines not on this page · raw message
package/python-pillow/Config.in new file +47 -0
47 lines not on this page · raw message
package/python-pillow/python-pillow.mk new file +18 -0
@@ -0,0 +1,18 @@ +################################################################################ +# +# python-pillow +# +################################################################################ + +PYTHON_PILLOW_VERSION = 3.0.0 +PYTHON_PILLOW_SITE = $(call github,python-pillow,Pillow,$(PYTHON_PILLOW_VERSION)) +PYTHON_PILLOW_SETUP_TYPE = distutils +PYTHON_PILLOW_DEPENDENCIES = python-setuptools \ + $(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) + +$(eval $(python-package))
Signature · 1 line
1.9.1
PATCH v2 1/1 package/python-pillow: new package
Dear Angelo Compagnucci,
Quoted 25 lines · Angelo Compagnucci
package/python-pillow/Config.in new file +25
-0+config BR2_PACKAGE_PYTHON_PILLOW_JPEG + bool "JPEG support" + select BR2_PACKAGE_JPEG + help + This option provides JPEG functionality. + +config BR2_PACKAGE_PYTHON_PILLOW_ZLIB + bool "compressed PNGs support" + select BR2_PACKAGE_ZLIB + help + This option provides access to compressed PNGs. + +config BR2_PACKAGE_PYTHON_PILLOW_TIFF + bool "compressed TIFF support" + select BR2_PACKAGE_TIFF + help + This option provides compressed TIFF functionality. + +config BR2_PACKAGE_PYTHON_PILLOW_FREETYPE + bool "freetype support" + select BR2_PACKAGE_FREETYPE + help + This option provides type related services. + +config BR2_PACKAGE_PYTHON_PILLOW_WEBP
package/python-pillow/Config.in line 45
Quoted 10 lines
package/python-pillow/Config.in new file +10
-0+ bool "WebP format support" + select BR2_PACKAGE_WEBP + help + This option provides the WebP format. + +config BR2_PACKAGE_PYTHON_PILLOW_JPEG2000 + bool "JPEG 2000 support" + select BR2_PACKAGE_OPENJPEG + help + This option provides JPEG 2000 functionality.
If you declare options here...
Quoted 12 lines
package/python-pillow/python-pillow.mk new file +6
-0@@ -0,0 +1,18 @@ +################################################################################ +# +# python-pillow +# +################################################################################ +
package/python-pillow/python-pillow.mk line 16
Quoted 10 lines
package/python-pillow/python-pillow.mk new file +10
-0+PYTHON_PILLOW_VERSION = 3.0.0 +PYTHON_PILLOW_SITE = $(call github,python-pillow,Pillow,$(PYTHON_PILLOW_VERSION)) +PYTHON_PILLOW_SETUP_TYPE = distutils +PYTHON_PILLOW_DEPENDENCIES = python-setuptools \ + $(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)
It would be good to use them here.
However, I believe you shouldn't declare any of those options. Just remove them from the Config.in, and use "implicit optional dependencies": i.e python-pillow will have jpeg support if the jpeg package is enabled.
Also, why do you need "python-setuptools" ? It is a bit strange to declare distutils as the <pkg>_SETUP_TYPE, and then having to depend on python-setuptools. Can you clarify ?
Finally, we now want to have hash files, even for github sourced packages, so please add one.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/1 package/python-pillow: new package
Dear Thomas Petazzoni,
2015-10-23 10:22 GMT+02:00 Thomas Petazzoni
<[email protected]>:
Quoted 67 lines
Dear Angelo Compagnucci,
Quoted 25 lines · Angelo Compagnucci
package/python-pillow/Config.in new file +25
-0+config BR2_PACKAGE_PYTHON_PILLOW_JPEG + bool "JPEG support" + select BR2_PACKAGE_JPEG + help + This option provides JPEG functionality. + +config BR2_PACKAGE_PYTHON_PILLOW_ZLIB + bool "compressed PNGs support" + select BR2_PACKAGE_ZLIB + help + This option provides access to compressed PNGs. + +config BR2_PACKAGE_PYTHON_PILLOW_TIFF + bool "compressed TIFF support" + select BR2_PACKAGE_TIFF + help + This option provides compressed TIFF functionality. + +config BR2_PACKAGE_PYTHON_PILLOW_FREETYPE + bool "freetype support" + select BR2_PACKAGE_FREETYPE + help + This option provides type related services. + +config BR2_PACKAGE_PYTHON_PILLOW_WEBPpackage/python-pillow/Config.in line 45
Quoted 10 lines
package/python-pillow/Config.in new file +10
-0+ bool "WebP format support" + select BR2_PACKAGE_WEBP + help + This option provides the WebP format. + +config BR2_PACKAGE_PYTHON_PILLOW_JPEG2000 + bool "JPEG 2000 support" + select BR2_PACKAGE_OPENJPEG + help + This option provides JPEG 2000 functionality.If you declare options here...
Quoted 12 lines
package/python-pillow/python-pillow.mk new file +6
-0@@ -0,0 +1,18 @@ +################################################################################ +# +# python-pillow +# +################################################################################ +package/python-pillow/python-pillow.mk line 16
Quoted 10 lines
package/python-pillow/python-pillow.mk new file +10
-0+PYTHON_PILLOW_VERSION = 3.0.0 +PYTHON_PILLOW_SITE = $(call github,python-pillow,Pillow,$(PYTHON_PILLOW_VERSION)) +PYTHON_PILLOW_SETUP_TYPE = distutils +PYTHON_PILLOW_DEPENDENCIES = python-setuptools \ + $(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)It would be good to use them here.
Quoted 4 lines
However, I believe you shouldn't declare any of those options. Just remove them from the Config.in, and use "implicit optional dependencies": i.e python-pillow will have jpeg support if the jpeg package is enabled.
No problem here, but how can a user detect if a dependency will be compiled if he's not informed explicitly about that dependency? A user should read the INSTALL file distributed with the software?
Making options explicit makes clear that if I want wepb support I should mark the corresponding checkbox.
In this case the software installer is smart to detect installed libraries, but in another case we should have provided build options explicitly. Where's the difference? (this is a honest question, just for understand the rule!)
Quoted 3 lines
Also, why do you need "python-setuptools" ? It is a bit strange to declare distutils as the <pkg>_SETUP_TYPE, and then having to depend on python-setuptools. Can you clarify ?
It doesn't work either way. I'll try to inspect this better tonight.
Quoted 2 lines
Finally, we now want to have hash files, even for github sourced packages, so please add one.
Ok!
Sincerely, Angelo.
Quoted 8 lines
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
PATCH v2 1/1 package/python-pillow: new package
Quoted 4 lines · Angelo Compagnucci
Dear Thomas Petazzoni,
2015-10-23 10:22 GMT+02:00 Thomas Petazzoni
<[email protected]>:
[snip]
Quoted 8 lines
Quoted 4 lines
However, I believe you shouldn't declare any of those options. Just remove them from the Config.in, and use "implicit optional dependencies": i.e python-pillow will have jpeg support if the jpeg package is enabled.
No problem here, but how can a user detect if a dependency will be compiled if he's not informed explicitly about that dependency? A user should read the INSTALL file distributed with the software?
No, the user should read the Config.in help text. In other words, just add a
list there of the libraries that you can select. Something like:
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).
Quoted 8 lines
Making options explicit makes clear that if I want wepb support I should mark the corresponding checkbox.
In this case the software installer is smart to detect installed libraries, but in another case we should have provided build options explicitly. Where's the difference? (this is a honest question, just for understand the rule!)
The idea is that we only add package options for non-obvious optional
dependencies. For example, that the jpeg library adds jpeg support to pillow is quite obvious.
We don't want to add new config options everywhere because that would really
explode the number of config options.
Regards,
Arnout
[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF