commit:     2da389e51d92dbe277d6e7b5cfd8194d5cae4ec3
Author:     Christophe Lermytte <gentoo <AT> lermytte <DOT> be>
AuthorDate: Sun Nov 27 23:07:16 2016 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Apr  4 15:41:35 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2da389e5

media-gfx/ufraw: add explicit jpeg2k support

Upstream links to libjasper when available. This commit patches
configure.ac to make libjasper support explicit and adds a jpeg2k
USE flag to enable/disable it.

Gentoo-bug: 470836
Package-Manager: portage-2.3.2
Closes: https://github.com/gentoo/gentoo/pull/2939

 .../ufraw/files/ufraw-0.22-jasper-automagic.patch   | 21 +++++++++++++++++++++
 media-gfx/ufraw/ufraw-0.22-r1.ebuild                |  5 ++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/media-gfx/ufraw/files/ufraw-0.22-jasper-automagic.patch 
b/media-gfx/ufraw/files/ufraw-0.22-jasper-automagic.patch
new file mode 100644
index 00000000000..93e1d691af1
--- /dev/null
+++ b/media-gfx/ufraw/files/ufraw-0.22-jasper-automagic.patch
@@ -0,0 +1,21 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,8 +159,16 @@
+ have_jpeg=${ac_cv_lib_jpeg_jpeg_CreateCompress:-no}
+ 
+ # Check for libjasper.
+-AC_CHECK_LIB(jasper, jas_image_decode)
+-have_jasper=${ac_cv_lib_jasper_jas_image_decode:-no}
++AC_ARG_ENABLE([jasper],
++  AS_HELP_STRING([--enable-jasper], [enable JPEG2000 support]))
++
++have_jasper=no
++AS_IF([test "x$enable_jasper" = "xyes"], [
++  AC_SEARCH_LIBS([jas_image_decode], [jasper], [have_jasper=yes], [
++    AC_MSG_ERROR([unable to find the jas_image_decode() function])
++  ])
++])
++
+ 
+ # Check for tiff headers and library.
+ PKG_CHECK_MODULES(LIBTIFF, libtiff-4,

diff --git a/media-gfx/ufraw/ufraw-0.22-r1.ebuild 
b/media-gfx/ufraw/ufraw-0.22-r1.ebuild
index 7f16fe8192f..225999943e4 100644
--- a/media-gfx/ufraw/ufraw-0.22-r1.ebuild
+++ b/media-gfx/ufraw/ufraw-0.22-r1.ebuild
@@ -12,7 +12,7 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 
~amd64-fbsd ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
-IUSE="contrast fits gimp gnome gtk openmp timezone"
+IUSE="contrast fits gimp gnome gtk jpeg2k openmp timezone"
 
 REQUIRED_USE="gimp? ( gtk )"
 
@@ -31,12 +31,14 @@ RDEPEND="
                >=media-gfx/gtkimageview-1.5
                >=x11-libs/gtk+-2.6:2
        )
+       jpeg2k? ( media-libs/jasper:= )
 "
 DEPEND="${RDEPEND}
        virtual/pkgconfig"
 
 PATCHES=(
        "${FILESDIR}"/${PN}-0.17-cfitsio-automagic.patch
+       "${FILESDIR}"/${P}-jasper-automagic.patch
        "${FILESDIR}"/${P}-crashfix.patch
 )
 
@@ -52,6 +54,7 @@ src_configure() {
                $(use_with gimp) \
                $(use_enable gnome mime) \
                $(use_with gtk) \
+               $(use_enable jpeg2k jasper) \
                $(use_enable openmp) \
                $(use_enable timezone dst-correction)
 }

Reply via email to