diff mbox

[1/2] package/openjpeg: bump to version 2.1

Message ID 1461597623-14629-2-git-send-email-angelo.compagnucci@gmail.com
State Changes Requested
Headers show

Commit Message

Angelo Compagnucci April 25, 2016, 3:20 p.m. UTC
This patch bumps openjpeg to version 2.1 and converts the
package to use cmake.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
 package/openjpeg/openjpeg.hash |  2 +-
 package/openjpeg/openjpeg.mk   | 31 +++----------------------------
 2 files changed, 4 insertions(+), 29 deletions(-)

Comments

Thomas Petazzoni April 25, 2016, 7:28 p.m. UTC | #1
Hello,

On Mon, 25 Apr 2016 17:20:22 +0200, Angelo Compagnucci wrote:

> -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

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

Thanks!

Thomas
Peter Korsgaard April 25, 2016, 7:29 p.m. UTC | #2
>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@gmail.com> writes:

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

 > Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>

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?
Angelo Compagnucci April 25, 2016, 8:05 p.m. UTC | #3
Dear Thomas Petazzoni,

2016-04-25 21:28 GMT+02:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> Hello,
>
> On Mon, 25 Apr 2016 17:20:22 +0200, Angelo Compagnucci wrote:
>
>> -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
>
> What about those optional dependencies? They are no longer used?

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

Sincerely, Angelo

>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
Angelo Compagnucci April 25, 2016, 8:06 p.m. UTC | #4
Dear Peter Korsgaard,

2016-04-25 21:29 GMT+02:00 Peter Korsgaard <peter@korsgaard.com>:
>>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@gmail.com> writes:
>
>  > This patch bumps openjpeg to version 2.1 and converts the
>  > package to use cmake.
>
>  > Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
>
> 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

>
> --
> Bye, Peter Korsgaard
Thomas Petazzoni April 25, 2016, 8:14 p.m. UTC | #5
Hello,

On Mon, 25 Apr 2016 22:05:44 +0200, Angelo Compagnucci wrote:

> > 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
Samuel Martin April 25, 2016, 8:18 p.m. UTC | #6
On Mon, Apr 25, 2016 at 10:05 PM, Angelo Compagnucci
<angelo.compagnucci@gmail.com> wrote:
> Dear Thomas Petazzoni,
>
> 2016-04-25 21:28 GMT+02:00 Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com>:
>> Hello,
>>
>> On Mon, 25 Apr 2016 17:20:22 +0200, Angelo Compagnucci wrote:
>>
>>> -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
>>
>> What about those optional dependencies? They are no longer used?
>
> 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,
Angelo Compagnucci April 25, 2016, 8:43 p.m. UTC | #7
Dear Samuel Martin

2016-04-25 22:18 GMT+02:00 Samuel Martin <s.martin49@gmail.com>:
> On Mon, Apr 25, 2016 at 10:05 PM, Angelo Compagnucci
> <angelo.compagnucci@gmail.com> wrote:
>> Dear Thomas Petazzoni,
>>
>> 2016-04-25 21:28 GMT+02:00 Thomas Petazzoni
>> <thomas.petazzoni@free-electrons.com>:
>>> Hello,
>>>
>>> On Mon, 25 Apr 2016 17:20:22 +0200, Angelo Compagnucci wrote:
>>>
>>>> -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
>>>
>>> What about those optional dependencies? They are no longer used?
>>
>> 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

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

>
>
> Regards,
>
> --
> Samuel
Angelo Compagnucci April 25, 2016, 8:53 p.m. UTC | #8
Dear Samuel Martin,

2016-04-25 22:43 GMT+02:00 Angelo Compagnucci <angelo.compagnucci@gmail.com>:
> Dear Samuel Martin
>
> 2016-04-25 22:18 GMT+02:00 Samuel Martin <s.martin49@gmail.com>:
>> On Mon, Apr 25, 2016 at 10:05 PM, Angelo Compagnucci
>> <angelo.compagnucci@gmail.com> wrote:
>>> Dear Thomas Petazzoni,
>>>
>>> 2016-04-25 21:28 GMT+02:00 Thomas Petazzoni
>>> <thomas.petazzoni@free-electrons.com>:
>>>> Hello,
>>>>
>>>> On Mon, 25 Apr 2016 17:20:22 +0200, Angelo Compagnucci wrote:
>>>>
>>>>> -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
>>>>
>>>> What about those optional dependencies? They are no longer used?
>>>
>>> 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
>
> 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?

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


>
>
> [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
>
>>
>>
>> Regards,
>>
>> --
>> Samuel
>
>
>
> --
> Profile: http://it.linkedin.com/in/compagnucciangelo
Samuel Martin April 25, 2016, 8:56 p.m. UTC | #9
Angelo,

On Mon, Apr 25, 2016 at 10:43 PM, Angelo Compagnucci
<angelo.compagnucci@gmail.com> wrote:
> Dear Samuel Martin
>
[...]
>
> 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?
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,
Angelo Compagnucci April 25, 2016, 9:01 p.m. UTC | #10
Dear Samuel Martin,

2016-04-25 22:56 GMT+02:00 Samuel Martin <s.martin49@gmail.com>:
> Angelo,
>
> On Mon, Apr 25, 2016 at 10:43 PM, Angelo Compagnucci
> <angelo.compagnucci@gmail.com> wrote:
>> Dear Samuel Martin
>>
> [...]
>>
>> 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?
> 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.

> - 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.

>
>
> Regards,
>
> --
> Samuel
Angelo Compagnucci April 25, 2016, 9:19 p.m. UTC | #11
Dear Peter Korsgaard,

2016-04-25 22:06 GMT+02:00 Angelo Compagnucci <angelo.compagnucci@gmail.com>:
> Dear Peter Korsgaard,
>
> 2016-04-25 21:29 GMT+02:00 Peter Korsgaard <peter@korsgaard.com>:
>>>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@gmail.com> writes:
>>
>>  > This patch bumps openjpeg to version 2.1 and converts the
>>  > package to use cmake.
>>
>>  > Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
>>
>> 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

>
> Sincerely, Angelo
>
>>
>> --
>> Bye, Peter Korsgaard
>
>
>
> --
> Profile: http://it.linkedin.com/in/compagnucciangelo
diff mbox

Patch

diff --git a/package/openjpeg/openjpeg.hash b/package/openjpeg/openjpeg.hash
index a8695c1..35d4fbd 100644
--- a/package/openjpeg/openjpeg.hash
+++ b/package/openjpeg/openjpeg.hash
@@ -1,2 +1,2 @@ 
 # Locally computed:
-sha256	15df7b194a5d8dba0052cd21c17a4dc761149a770a907d73fffb972078c28a87  openjpeg-1.5.2.tar.gz
+sha256	4afc996cd5e0d16360d71c58216950bcb4ce29a3272360eb29cadb1c8bce4efc  openjpeg-2.1.tar.gz
diff --git a/package/openjpeg/openjpeg.mk b/package/openjpeg/openjpeg.mk
index c613ba8..d421428 100644
--- a/package/openjpeg/openjpeg.mk
+++ b/package/openjpeg/openjpeg.mk
@@ -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))