Skip to contentSkip to conversation

python-pillow: new package

PATCH Superseded Angelo Compagnucci 4 participants 16 messages Apr 25, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover python-pillow: new package

This patch add python-pillow the friendly python fork and bumps openjpeg to version 2.1 required to correctly compile.

Angelo Compagnucci (2):
package/openjpeg: bump to version 2.1
package/python-pillow: new package

 package/openjpeg/openjpeg.hash                     |   2 +-
 package/openjpeg/openjpeg.mk                       |  31 +---
 ...y-add-option-to-disable-platform-guessing.patch | 169 +++++++++++++++++++++
 package/python-pillow/Config.in                    |  12 ++
 package/python-pillow/python-pillow.hash           |   2 +
 package/python-pillow/python-pillow.mk             |  39 +++++
 6 files changed, 226 insertions(+), 29 deletions(-)
 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
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 package/openjpeg: bump to version 2.1

This patch bumps openjpeg to version 2.1 and converts the package to use cmake.

---
 package/openjpeg/openjpeg.hash |  2 +-
 package/openjpeg/openjpeg.mk   | 31 +++----------------------------
 2 files changed, 4 insertions(+), 29 deletions(-)
package/openjpeg/openjpeg.hash +1 -1
index a8695c1..35d4fbd 100644
@@ -1,2 +1,2 @@
 # Locally computed:
-sha256	15df7b194a5d8dba0052cd21c17a4dc761149a770a907d73fffb972078c28a87  openjpeg-1.5.2.tar.gz
+sha256	4afc996cd5e0d16360d71c58216950bcb4ce29a3272360eb29cadb1c8bce4efc  openjpeg-2.1.tar.gz
package/openjpeg/openjpeg.mk +3 -28
index c613ba8..d421428 100644
@@ -4,35 +4,10 @@
 #
 ################################################################################
 
-OPENJPEG_VERSION = 1.5.2
-OPENJPEG_SITE = http://downloads.sourceforge.net/project/openjpeg.mirror/$(OPENJPEG_VERSION)
+OPENJPEG_VERSION = 2.1
+OPENJPEG_SITE = $(call github,uclouvain,openjpeg,version.$(OPENJPEG_VERSION))
 OPENJPEG_LICENSE = BSD-2c
 OPENJPEG_LICENSE_FILES = LICENSE
-# tarball does not contain the generated files
-OPENJPEG_AUTORECONF = YES
 OPENJPEG_INSTALL_STAGING = YES
-OPENJPEG_DEPENDENCIES = host-pkgconf
-OPENJPEG_CONF_OPTS = --disable-lcms1
 
-ifeq ($(BR2_PACKAGE_LIBPNG),y)
-OPENJPEG_DEPENDENCIES += libpng
-OPENJPEG_CONF_OPTS += --enable-png
-else
-OPENJPEG_CONF_OPTS += --disable-png
-endif
-
-ifeq ($(BR2_PACKAGE_TIFF),y)
-OPENJPEG_DEPENDENCIES += tiff
-OPENJPEG_CONF_OPTS += --enable-tiff
-else
-OPENJPEG_CONF_OPTS += --disable-tiff
-endif
-
-ifeq ($(BR2_PACKAGE_LCMS2),y)
-OPENJPEG_DEPENDENCIES += lcms2
-OPENJPEG_CONF_OPTS += --enable-lcms2
-else
-OPENJPEG_CONF_OPTS += --disable-lcms2
-endif
-
-$(eval $(autotools-package))
+$(eval $(cmake-package))
Signature · 1 line
1.9.1
#13 lore raw

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

In reply to Angelo Compagnucci

This patch adds python pillow, the friendly python fork. The accompaining patch to disable platform guessing was submitted upstream for inclusion.

---
 ...y-add-option-to-disable-platform-guessing.patch | 169 +++++++++++++++++++++
 package/python-pillow/Config.in                    |  12 ++
 package/python-pillow/python-pillow.hash           |   2 +
 package/python-pillow/python-pillow.mk             |  39 +++++
 4 files changed, 222 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/python-pillow/0001-setup.py-add-option-to-disable-platform-guessing.patch new file +169 -0
new file mode 100644
index 0000000..e8e6d7c
@@ -0,0 +1,169 @@
+From fa2a0e73502426c5add9e4a0e13971fe195a82a0 Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <[email protected]>
+Date: Mon, 25 Apr 2016 16:50:20 +0200
+Subject: [PATCH] setup.py: add option to disable platform guessing
+
+When cross-compiling (ex on Buildroot) platform guessing is not needed
+cause the environment is correctly built externally.
+This patch adds an option to disable platform guessing on Linux.
+---
+ setup.py | 123 +++++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 65 insertions(+), 58 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 0f74a40..d25390f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -121,9 +121,12 @@ class pil_build_ext(build_ext):
+         ('disable-%s' % x, None, 'Disable support for %s' % x) for x in feature
+     ] + [
+         ('enable-%s' % x, None, 'Enable support for %s' % x) for x in feature
++    ] + [
++        ('disable-platform-guessing', None, 'Disable platform guessing on Linux'),
+     ]
+ 
+     def initialize_options(self):
++        self.disable_platform_guessing = None
+         build_ext.initialize_options(self)
+         for x in self.feature:
+             setattr(self, 'disable_%s' % x, None)
+@@ -236,62 +239,65 @@ class pil_build_ext(build_ext):
+                 _add_directory(include_dirs, "/usr/X11/include")
+ 
+         elif sys.platform.startswith("linux"):
+-            arch_tp = (plat.processor(), plat.architecture()[0])
+-            if arch_tp == ("x86_64", "32bit"):
+-                # 32-bit build on 64-bit machine.
+-                _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
++            if self.disable_platform_guessing:
++                pass
+             else:
+-                for platform_ in arch_tp:
+-
+-                    if not platform_:
+-                        continue
+-
+-                    if platform_ in ["x86_64", "64bit"]:
+-                        _add_directory(library_dirs, "/lib64")
+-                        _add_directory(library_dirs, "/usr/lib64")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/x86_64-linux-gnu")
+-                        break
+-                    elif platform_ in ["i386", "i686", "32bit"]:
+-                        _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
+-                        break
+-                    elif platform_ in ["aarch64"]:
+-                        _add_directory(library_dirs, "/usr/lib64")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/aarch64-linux-gnu")
+-                        break
+-                    elif platform_ in ["arm", "armv7l"]:
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/arm-linux-gnueabi")
+-                        break
+-                    elif platform_ in ["ppc64"]:
+-                        _add_directory(library_dirs, "/usr/lib64")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/ppc64-linux-gnu")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/powerpc64-linux-gnu")
+-                        break
+-                    elif platform_ in ["ppc"]:
+-                        _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/powerpc-linux-gnu")
+-                        break
+-                    elif platform_ in ["s390x"]:
+-                        _add_directory(library_dirs, "/usr/lib64")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/s390x-linux-gnu")
+-                        break
+-                    elif platform_ in ["s390"]:
+-                        _add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
+-                        break
++                arch_tp = (plat.processor(), plat.architecture()[0])
++                if arch_tp == ("x86_64", "32bit"):
++                    # 32-bit build on 64-bit machine.
++                    _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
+                 else:
+-                    raise ValueError(
+-                        "Unable to identify Linux platform: `%s`" % platform_)
+-
+-            # XXX Kludge. Above /\ we brute force support multiarch. Here we
+-            # try Barry's more general approach. Afterward, something should
+-            # work ;-)
+-            self.add_multiarch_paths()
++                    for platform_ in arch_tp:
++
++                        if not platform_:
++                            continue
++
++                        if platform_ in ["x86_64", "64bit"]:
++                            _add_directory(library_dirs, "/lib64")
++                            _add_directory(library_dirs, "/usr/lib64")
++                            _add_directory(library_dirs,
++                                           "/usr/lib/x86_64-linux-gnu")
++                            break
++                        elif platform_ in ["i386", "i686", "32bit"]:
++                            _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
++                            break
++                        elif platform_ in ["aarch64"]:
++                            _add_directory(library_dirs, "/usr/lib64")
++                            _add_directory(library_dirs,
++                                           "/usr/lib/aarch64-linux-gnu")
++                            break
++                        elif platform_ in ["arm", "armv7l"]:
++                            _add_directory(library_dirs,
++                                           "/usr/lib/arm-linux-gnueabi")
++                            break
++                        elif platform_ in ["ppc64"]:
++                            _add_directory(library_dirs, "/usr/lib64")
++                            _add_directory(library_dirs,
++                                           "/usr/lib/ppc64-linux-gnu")
++                            _add_directory(library_dirs,
++                                           "/usr/lib/powerpc64-linux-gnu")
++                            break
++                        elif platform_ in ["ppc"]:
++                            _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
++                            _add_directory(library_dirs,
++                                           "/usr/lib/powerpc-linux-gnu")
++                            break
++                        elif platform_ in ["s390x"]:
++                            _add_directory(library_dirs, "/usr/lib64")
++                            _add_directory(library_dirs,
++                                           "/usr/lib/s390x-linux-gnu")
++                            break
++                        elif platform_ in ["s390"]:
++                            _add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
++                            break
++                    else:
++                        raise ValueError(
++                            "Unable to identify Linux platform: `%s`" % platform_)
++
++                # XXX Kludge. Above /\ we brute force support multiarch. Here we
++                # try Barry's more general approach. Afterward, something should
++                # work ;-)
++                self.add_multiarch_paths()
+ 
+         elif sys.platform.startswith("gnu"):
+             self.add_multiarch_paths()
+@@ -352,11 +358,12 @@ class pil_build_ext(build_ext):
+                 _add_directory(include_dirs, tcl_dir)
+ 
+         # standard locations
+-        _add_directory(library_dirs, "/usr/local/lib")
+-        _add_directory(include_dirs, "/usr/local/include")
++        if not self.disable_platform_guessing:
++            _add_directory(library_dirs, "/usr/local/lib")
++            _add_directory(include_dirs, "/usr/local/include")
+ 
+-        _add_directory(library_dirs, "/usr/lib")
+-        _add_directory(include_dirs, "/usr/include")
++            _add_directory(library_dirs, "/usr/lib")
++            _add_directory(include_dirs, "/usr/include")
+ 
+         # on Windows, look for the OpenJPEG libraries in the location that
+         # the official installer puts them
+-- 
+1.9.1
+
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 +2 -0
new file mode 100644
index 0000000..0fc349c
@@ -0,0 +1,2 @@
+https://pypi.python.org/pypi?:action=show_md5&digest=7cfd093c11205d9e2ebe3c51dfcad510
+md5 7cfd093c11205d9e2ebe3c51dfcad510  Pillow-3.2.0.tar.gz
package/python-pillow/python-pillow.mk new file +39 -0
new file mode 100644
index 0000000..f186ab6
@@ -0,0 +1,39 @@
+################################################################################
+#
+# 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_INSTALL_TARGET_OPTS += $(PYTHON_PILLOW_BUILD_OPTS)
+
+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 = (cd $(PYTHON_PILLOW_BUILDDIR); \
+		$(PYTHON_PILLOW_BASE_ENV) $(PYTHON_PILLOW_ENV) \
+		$(PYTHON_PILLOW_PYTHON_INTERPRETER) setup.py build_ext \
+		$(PYTHON_PILLOW_INSTALL_TARGET_OPTS) install \
+		$(PYTHON_PILLOW_BASE_INSTALL_TARGET_OPTS))
+
+$(eval $(python-package))
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Angelo Compagnucci

Hello,

Quoted 10 lines · Angelo Compagnucci
package/openjpeg/openjpeg.mk +0 -10
-ifeq ($(BR2_PACKAGE_LIBPNG),y)
-OPENJPEG_DEPENDENCIES += libpng
-OPENJPEG_CONF_OPTS += --enable-png
-else
-OPENJPEG_CONF_OPTS += --disable-png
-endif
-
-ifeq ($(BR2_PACKAGE_TIFF),y)
-OPENJPEG_DEPENDENCIES += tiff
-OPENJPEG_CONF_OPTS += --enable-tiff

package/openjpeg/openjpeg.mk line 36

Quoted 10 lines
package/openjpeg/openjpeg.mk +0 -10
-else
-OPENJPEG_CONF_OPTS += --disable-tiff
-endif
-
-ifeq ($(BR2_PACKAGE_LCMS2),y)
-OPENJPEG_DEPENDENCIES += lcms2
-OPENJPEG_CONF_OPTS += --enable-lcms2
-else
-OPENJPEG_CONF_OPTS += --disable-lcms2
-endif

What about those optional dependencies? They are no longer used?

Thanks!

Thomas

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

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Angelo Compagnucci
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

This patch bumps openjpeg to version 2.1 and converts the package to use cmake.

A bit more detailed changelog would be good, E.G. the fact that it has now moved to github. What happened to all those optional dependencies?

Looking at the 2.x release notes I see it mentions various API changes. Have you verified that the reverse dependencies (efl, gst1-plugins-bad, poppler) still build/work with the new version?

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

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Thomas Petazzoni

Dear Thomas Petazzoni,

2016-04-25 21:28 GMT+02:00 Thomas Petazzoni
<[email protected]>:

Quoted 18 lines

Hello,

Quoted 14 lines · Angelo Compagnucci
package/openjpeg/openjpeg.mk +0 -14
-ifeq ($(BR2_PACKAGE_LIBPNG),y)
-OPENJPEG_DEPENDENCIES += libpng
-OPENJPEG_CONF_OPTS += --enable-png
-else
-OPENJPEG_CONF_OPTS += --disable-png
-endif
-
-ifeq ($(BR2_PACKAGE_TIFF),y)
-OPENJPEG_DEPENDENCIES += tiff
-OPENJPEG_CONF_OPTS += --enable-tiff
-else
-OPENJPEG_CONF_OPTS += --disable-tiff
-endif
-
Quoted 8 lines

package/openjpeg/openjpeg.mk line 36

Quoted 6 lines
package/openjpeg/openjpeg.mk +0 -6
-ifeq ($(BR2_PACKAGE_LCMS2),y)
-OPENJPEG_DEPENDENCIES += lcms2
-OPENJPEG_CONF_OPTS += --enable-lcms2
-else
-OPENJPEG_CONF_OPTS += --disable-lcms2
-endif

What about those optional dependencies? They are no longer used?

They are no longer present as cmake options, they are handled internally.

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
#11 lore raw

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Peter Korsgaard

Dear Peter Korsgaard,

2016-04-25 21:29 GMT+02:00 Peter Korsgaard <[email protected]>:

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

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

This patch bumps openjpeg to version 2.1 and converts the package to use cmake.

Quoted 8 lines
Quoted 1 line

A bit more detailed changelog would be good, E.G. the fact that it has now moved to github. What happened to all those optional dependencies?

Looking at the 2.x release notes I see it mentions various API changes. Have you verified that the reverse dependencies (efl, gst1-plugins-bad, poppler) still build/work with the new version?

Mmm, intresting observation, i'll try in a moment!

Sincerely, Angelo

Quoted 3 lines

--
Bye, Peter Korsgaard

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#4 lore raw

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Angelo Compagnucci

Hello,

Quoted 3 lines · Angelo Compagnucci
Quoted 1 line

What about those optional dependencies? They are no longer used?

They are no longer present as cmake options, they are handled internally.

What do you mean by "internally"? They are still optional dependencies, but there are no CMake options to enable/disable them? The libpng, tiff and lcms2 code has been duplicated in the openjpeg project?

Thomas

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

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Angelo Compagnucci
Quoted 31 lines · Angelo Compagnucci

Dear Thomas Petazzoni,

2016-04-25 21:28 GMT+02:00 Thomas Petazzoni
<[email protected]>:

Quoted 18 lines

Hello,

Quoted 14 lines · Angelo Compagnucci
package/openjpeg/openjpeg.mk +0 -14
-ifeq ($(BR2_PACKAGE_LIBPNG),y)
-OPENJPEG_DEPENDENCIES += libpng
-OPENJPEG_CONF_OPTS += --enable-png
-else
-OPENJPEG_CONF_OPTS += --disable-png
-endif
-
-ifeq ($(BR2_PACKAGE_TIFF),y)
-OPENJPEG_DEPENDENCIES += tiff
-OPENJPEG_CONF_OPTS += --enable-tiff
-else
-OPENJPEG_CONF_OPTS += --disable-tiff
-endif
-
Quoted 8 lines

package/openjpeg/openjpeg.mk line 36

Quoted 6 lines
package/openjpeg/openjpeg.mk +0 -6
-ifeq ($(BR2_PACKAGE_LCMS2),y)
-OPENJPEG_DEPENDENCIES += lcms2
-OPENJPEG_CONF_OPTS += --enable-lcms2
-else
-OPENJPEG_CONF_OPTS += --disable-lcms2
-endif

What about those optional dependencies? They are no longer used?

Quoted 1 line

They are no longer present as cmake options, they are handled internally.

hmm, not that simple.
These thirdparty are still bundle with openjpeg, the parsing of the thirdparty dir. is sensible to BUILD_CODEC [1] (which is ON by default [2]) plus some magics [3,4] involving BUILD_THIRDPARTY.
So to prevent building the bundled 3rd parties, you should explicitly add the dependencies and disable these flags.

[1] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L268
[2] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L254
[3] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L269

Regards,

Signature · 1 line
Samuel
#14 lore raw

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

In reply to Angelo Compagnucci

Hello,

Quoted 5 lines · Angelo Compagnucci

This patch adds python pillow, the friendly python fork. The accompaining patch to disable platform guessing was submitted upstream for inclusion.

Since you're sending it in a series after the openjpeg patch, should we assume that this version of the python-pillow package requires the new version of openjpeg?

You posted other patches for python-pillow in the past, but without an update for openjpeg, so I'd prefer to ask, so that we can see if python-pillow can be merged independently from the openjpeg update.

Best regards,

Thomas

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

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Samuel Martin

Dear Samuel Martin

2016-04-25 22:18 GMT+02:00 Samuel Martin <[email protected]>:

Quoted 41 lines
Quoted 31 lines · Angelo Compagnucci

Dear Thomas Petazzoni,

2016-04-25 21:28 GMT+02:00 Thomas Petazzoni
<[email protected]>:

Quoted 18 lines

Hello,

Quoted 14 lines · Angelo Compagnucci
package/openjpeg/openjpeg.mk +0 -14
-ifeq ($(BR2_PACKAGE_LIBPNG),y)
-OPENJPEG_DEPENDENCIES += libpng
-OPENJPEG_CONF_OPTS += --enable-png
-else
-OPENJPEG_CONF_OPTS += --disable-png
-endif
-
-ifeq ($(BR2_PACKAGE_TIFF),y)
-OPENJPEG_DEPENDENCIES += tiff
-OPENJPEG_CONF_OPTS += --enable-tiff
-else
-OPENJPEG_CONF_OPTS += --disable-tiff
-endif
-
Quoted 8 lines

package/openjpeg/openjpeg.mk line 36

Quoted 6 lines
package/openjpeg/openjpeg.mk +0 -6
-ifeq ($(BR2_PACKAGE_LCMS2),y)
-OPENJPEG_DEPENDENCIES += lcms2
-OPENJPEG_CONF_OPTS += --enable-lcms2
-else
-OPENJPEG_CONF_OPTS += --disable-lcms2
-endif

What about those optional dependencies? They are no longer used?

Quoted 1 line

They are no longer present as cmake options, they are handled internally.

hmm, not that simple.
These thirdparty are still bundle with openjpeg, the parsing of the thirdparty dir. is sensible to BUILD_CODEC [1] (which is ON by default [2]) plus some magics [3,4] involving BUILD_THIRDPARTY.
So to prevent building the bundled 3rd parties, you should explicitly add the dependencies and disable these flags.

Quoted 3 lines

[1] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L268
[2] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L254
[3] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L269

I reviewed the logic a little bit more and I can confirm that keeping the default is sensible:

[1] if (BUILD_CODEC OR BUILD_MJ2)
[2] option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
[3] ELSE (BUILD_THIRDPARTY)
[4] IF(ZLIB_FOUND)

    SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
    SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
    message(STATUS "Your system seems to have a Z lib available, we

will use it to generate PNG lib")
ELSE (ZLIB_FOUND) # not found
message(STATUS "Z lib not found, activate BUILD_THIRDPARTY if you
want build it (necessary to build libPNG)")

So at the end if BUILD_CODEC is ON (default) system libraries will only be used if found.
Is not this the intended behaviuor?

[1] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L268
[2] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L271
[3] https://github.com/uclouvain/openjpeg/blob/master/thirdparty/CMakeLists.txt#L12
[4] https://github.com/uclouvain/openjpeg/blob/master/thirdparty/CMakeLists.txt#L15

Sincerely, Angelo

Quoted 6 lines

Regards,

--
Samuel

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#15 lore raw

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

In reply to Thomas Petazzoni

Dear Thomas Petazzoni

2016-04-25 22:35 GMT+02:00 Thomas Petazzoni
<[email protected]>:

Quoted 7 lines

Hello,

Quoted 4 lines · Angelo Compagnucci

This patch adds python pillow, the friendly python fork. The accompaining patch to disable platform guessing was submitted upstream for inclusion.

Quoted 5 lines
Quoted 1 line

Since you're sending it in a series after the openjpeg patch, should we assume that this version of the python-pillow package requires the new version of openjpeg?

Python-Pillow 3.2.0 depends on openjpeg 2.1. The dependency is optional, but if activated brakes the build.

Quoted 4 lines

You posted other patches for python-pillow in the past, but without an update for openjpeg, so I'd prefer to ask, so that we can see if python-pillow can be merged independently from the openjpeg update.

Yes, I sent several patches in the past struggling to be up to date with the mainline version.
The patches were used by me, but I felt that they should be shared. If you want, you can accept (finally!) the old patch (v5) that carries a little bit less up to date pillow [1].

Sincerely, Angelo

[1] http://patchwork.ozlabs.org/patch/587224/

Quoted 8 lines

Best regards,

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
#7 lore raw

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Angelo Compagnucci

Dear Samuel Martin,

2016-04-25 22:43 GMT+02:00 Angelo Compagnucci <[email protected]>:

Quoted 59 lines

Dear Samuel Martin

2016-04-25 22:18 GMT+02:00 Samuel Martin <[email protected]>:

Quoted 41 lines
Quoted 31 lines · Angelo Compagnucci

Dear Thomas Petazzoni,

2016-04-25 21:28 GMT+02:00 Thomas Petazzoni
<[email protected]>:

Quoted 18 lines

Hello,

Quoted 14 lines · Angelo Compagnucci
package/openjpeg/openjpeg.mk +0 -14
-ifeq ($(BR2_PACKAGE_LIBPNG),y)
-OPENJPEG_DEPENDENCIES += libpng
-OPENJPEG_CONF_OPTS += --enable-png
-else
-OPENJPEG_CONF_OPTS += --disable-png
-endif
-
-ifeq ($(BR2_PACKAGE_TIFF),y)
-OPENJPEG_DEPENDENCIES += tiff
-OPENJPEG_CONF_OPTS += --enable-tiff
-else
-OPENJPEG_CONF_OPTS += --disable-tiff
-endif
-
Quoted 8 lines

package/openjpeg/openjpeg.mk line 36

Quoted 6 lines
package/openjpeg/openjpeg.mk +0 -6
-ifeq ($(BR2_PACKAGE_LCMS2),y)
-OPENJPEG_DEPENDENCIES += lcms2
-OPENJPEG_CONF_OPTS += --enable-lcms2
-else
-OPENJPEG_CONF_OPTS += --disable-lcms2
-endif

What about those optional dependencies? They are no longer used?

Quoted 1 line

They are no longer present as cmake options, they are handled internally.

hmm, not that simple.
These thirdparty are still bundle with openjpeg, the parsing of the thirdparty dir. is sensible to BUILD_CODEC [1] (which is ON by default [2]) plus some magics [3,4] involving BUILD_THIRDPARTY.
So to prevent building the bundled 3rd parties, you should explicitly add the dependencies and disable these flags.

Quoted 3 lines

[1] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L268
[2] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L254
[3] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L269

I reviewed the logic a little bit more and I can confirm that keeping the default is sensible:

[1] if (BUILD_CODEC OR BUILD_MJ2)
[2] option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
[3] ELSE (BUILD_THIRDPARTY)
[4] IF(ZLIB_FOUND)

    SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
    SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
    message(STATUS "Your system seems to have a Z lib available, we
Quoted 8 lines

will use it to generate PNG lib")
ELSE (ZLIB_FOUND) # not found
message(STATUS "Z lib not found, activate BUILD_THIRDPARTY if you
want build it (necessary to build libPNG)")

So at the end if BUILD_CODEC is ON (default) system libraries will only be used if found.
Is not this the intended behaviuor?

To confirm more, this is a snippet from cmake output:

-- Found ZLIB: /home/angelo/DEV/BUILDROOT/br_arietta_pillow/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libz.so (found version "1.2.8")
-- Your system seems to have a Z lib available, we will use it to
generate PNG lib
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- PNG lib not found, activate BUILD_THIRDPARTY if you want build it
-- Found TIFF: /home/angelo/DEV/BUILDROOT/br_arietta_pillow/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libtiff.so (found version "4.0.6")
-- Your system seems to have a TIFF lib available, we will use it
-- Could NOT find LCMS2 (missing: LCMS2_LIBRARY LCMS2_INCLUDE_DIR)
-- Could NOT find LCMS (missing: LCMS_LIBRARY LCMS_INCLUDE_DIR)
-- LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it

Quoted 21 lines

[1] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L268
[2] https://github.com/uclouvain/openjpeg/blob/master/CMakeLists.txt#L271
[3] https://github.com/uclouvain/openjpeg/blob/master/thirdparty/CMakeLists.txt#L12
[4] https://github.com/uclouvain/openjpeg/blob/master/thirdparty/CMakeLists.txt#L15

Sincerely, Angelo

Quoted 6 lines

Regards,

--
Samuel

--
Profile: http://it.linkedin.com/in/compagnucciangelo

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#8 lore raw

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Angelo Compagnucci

Angelo,

Quoted 2 lines · Angelo Compagnucci

Dear Samuel Martin

[...]

Quoted 12 lines

I reviewed the logic a little bit more and I can confirm that keeping the default is sensible:

[1] if (BUILD_CODEC OR BUILD_MJ2)
[2] option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
[3] ELSE (BUILD_THIRDPARTY)
[4] IF(ZLIB_FOUND)

    SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
    SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
    message(STATUS "Your system seems to have a Z lib available, we
Quoted 8 lines

will use it to generate PNG lib")
ELSE (ZLIB_FOUND) # not found
message(STATUS "Z lib not found, activate BUILD_THIRDPARTY if you
want build it (necessary to build libPNG)")

So at the end if BUILD_CODEC is ON (default) system libraries will only be used if found.
Is not this the intended behaviuor?

Certainly.
However, they may exist or not, depending on the package selection and the build order, so my questions are:
- are they required or optional stuff?
- if optional, can we force using or not using them? (from build reproducibility perspective)

Regards,

Signature · 1 line
Samuel
#9 lore raw

PATCH 1/2 package/openjpeg: bump to version 2.1

Dear Samuel Martin,

2016-04-25 22:56 GMT+02:00 Samuel Martin <[email protected]>:

Quoted 24 lines

Angelo,

Quoted 2 lines · Angelo Compagnucci

Dear Samuel Martin

[...]

Quoted 17 lines

I reviewed the logic a little bit more and I can confirm that keeping the default is sensible:

[1] if (BUILD_CODEC OR BUILD_MJ2)
[2] option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
[3] ELSE (BUILD_THIRDPARTY)
[4] IF(ZLIB_FOUND)

    SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
    SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
    message(STATUS "Your system seems to have a Z lib available, we

will use it to generate PNG lib")
ELSE (ZLIB_FOUND) # not found
message(STATUS "Z lib not found, activate BUILD_THIRDPARTY if you
want build it (necessary to build libPNG)")

Quoted 7 lines
Quoted 3 lines

So at the end if BUILD_CODEC is ON (default) system libraries will only be used if found.
Is not this the intended behaviuor?

Certainly.
However, they may exist or not, depending on the package selection and the build order, so my questions are:
- are they required or optional stuff?

Rigth, they should be in OPENJPEG_DEPENDENCIES if found.

Quoted 2 lines

- if optional, can we force using or not using them? (from build reproducibility perspective)

From the make system perspective, nope. Actually they are built if found, no way to explicitly enabling/disabling them.

Quoted 6 lines

Regards,

--
Samuel

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#12 lore raw

PATCH 1/2 package/openjpeg: bump to version 2.1

In reply to Angelo Compagnucci

Dear Peter Korsgaard,

2016-04-25 22:06 GMT+02:00 Angelo Compagnucci <[email protected]>:

Quoted 10 lines

Dear Peter Korsgaard,

2016-04-25 21:29 GMT+02:00 Peter Korsgaard <[email protected]>:

Quoted 7 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

This patch bumps openjpeg to version 2.1 and converts the package to use cmake.

Quoted 8 lines
Quoted 6 lines

A bit more detailed changelog would be good, E.G. the fact that it has now moved to github. What happened to all those optional dependencies?

Looking at the 2.x release notes I see it mentions various API changes. Have you verified that the reverse dependencies (efl, gst1-plugins-bad, poppler) still build/work with the new version?

Mmm, intresting observation, i'll try in a moment!

The only necessary changing is:

POPPLER_CONF_OPTS += --enable-libopenjpeg=openjpeg1 to
POPPLER_CONF_OPTS += --enable-libopenjpeg

to eneble openjpeg version autodetection.

I'll send a new series shortly.

Sincerely, Angelo

Quoted 11 lines

Sincerely, Angelo

Quoted 3 lines

--
Bye, Peter Korsgaard

--
Profile: http://it.linkedin.com/in/compagnucciangelo

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo