0001-openjpeg-Fix-build-against-openjpeg-2.2.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From daaf649bda7231fd0d760802232a36ba62a4ea2d Mon Sep 17 00:00:00 2001
  2. From: Clemens Lang <cal@macports.org>
  3. Date: Sun, 13 Aug 2017 21:17:18 +0200
  4. Subject: [PATCH] openjpeg: Fix build against openjpeg 2.2
  5. OpenJPEG 2.2 has some API changes and thus ships its headers in a new
  6. include path. Add a configure check (to both meson and autoconf) to
  7. detect the newer version of OpenJPEG and add conditional includes.
  8. Fix the autoconf test for OpenJPEG 2.1, which checked for HAVE_OPENJPEG,
  9. which was always set even for 2.0.
  10. https://bugzilla.gnome.org/show_bug.cgi?id=786250
  11. [Peter: drop meson changes for 2017.02.x]
  12. Upstream: https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/patch/?id=15f24fef53a955c7c76fc966302cb0453732e657
  13. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  14. ---
  15. configure.ac | 7 ++++++-
  16. ext/openjpeg/gstopenjpeg.h | 4 +++-
  17. 2 files changed, 22 insertions(+), 10 deletions(-)
  18. diff --git a/configure.ac b/configure.ac
  19. index 30e26b8..c4f08c7 100644
  20. --- a/configure.ac
  21. +++ b/configure.ac
  22. @@ -2813,8 +2813,13 @@ AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [
  23. if test x"$HAVE_OPENJPEG" = x"yes"; then
  24. dnl minor API changes in v2.1
  25. AG_GST_PKG_CHECK_MODULES(OPENJPEG_2_1, libopenjp2 >= 2.1)
  26. - if test x"$HAVE_OPENJPEG" = x"yes"; then
  27. + if test x"$HAVE_OPENJPEG_2_1" = x"yes"; then
  28. AC_DEFINE([HAVE_OPENJPEG_2_1], 1, [Define if OpenJPEG 2.1 is used])
  29. + dnl include paths changed for v2.2
  30. + AG_GST_PKG_CHECK_MODULES(OPENJPEG_2_2, libopenjp2 >= 2.2)
  31. + if test x"$HAVE_OPENJPEG_2_2" = x"yes"; then
  32. + AC_DEFINE([HAVE_OPENJPEG_2_2], 1, [Define if OpenJPEG 2.2 is used])
  33. + fi
  34. fi
  35. else
  36. # Fallback to v1.5
  37. diff --git a/ext/openjpeg/gstopenjpeg.h b/ext/openjpeg/gstopenjpeg.h
  38. index 03ce52e..52410a4 100644
  39. --- a/ext/openjpeg/gstopenjpeg.h
  40. +++ b/ext/openjpeg/gstopenjpeg.h
  41. @@ -38,7 +38,9 @@
  42. #define OPJ_CPRL CPRL
  43. #else
  44. #include <stdio.h>
  45. -# ifdef HAVE_OPENJPEG_2_1
  46. +# if defined(HAVE_OPENJPEG_2_2)
  47. +# include <openjpeg-2.2/openjpeg.h>
  48. +# elif defined(HAVE_OPENJPEG_2_1)
  49. # include <openjpeg-2.1/openjpeg.h>
  50. # else
  51. # include <openjpeg-2.0/openjpeg.h>
  52. --
  53. 2.12.3