Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libheif/files/, media-libs/libheif/
Date: Sat, 06 Oct 2018 16:05:47
Message-Id: 1538841933.b8a3b060c5a3feec00f662b14a825c939ce43c71.whissi@gentoo
1 commit: b8a3b060c5a3feec00f662b14a825c939ce43c71
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 6 16:04:18 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 6 16:05:33 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8a3b060
7
8 media-libs/libheif: add support for libjpeg-turbo-2.0
9
10 Package-Manager: Portage-2.3.50, Repoman-2.3.11
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 .../libheif/files/libheif-1.3.2-openjpeg-2.patch | 93 ++++++++++++++++++++++
14 ...ibheif-1.3.2.ebuild => libheif-1.3.2-r1.ebuild} | 6 +-
15 2 files changed, 96 insertions(+), 3 deletions(-)
16
17 diff --git a/media-libs/libheif/files/libheif-1.3.2-openjpeg-2.patch b/media-libs/libheif/files/libheif-1.3.2-openjpeg-2.patch
18 new file mode 100644
19 index 00000000000..138295965b4
20 --- /dev/null
21 +++ b/media-libs/libheif/files/libheif-1.3.2-openjpeg-2.patch
22 @@ -0,0 +1,93 @@
23 +Support building against libjpeg-turbo 2.0.
24 +
25 +Backport of https://github.com/strukturag/libheif/pull/85
26 +
27 +--- a/configure.ac
28 ++++ b/configure.ac
29 +@@ -95,6 +95,22 @@ AC_CHECK_LIB([jpeg], [jpeg_destroy_compress], [
30 + ], [have_libjpeg="no"])
31 + fi
32 + AM_CONDITIONAL([HAVE_LIBJPEG], [test "x$have_libjpeg" = "xyes"])
33 ++if eval "test x$have_libjpeg = xyes"; then
34 ++AC_MSG_CHECKING([for jpeg_write_icc_profile])
35 ++AC_LANG_PUSH(C++)
36 ++AC_TRY_COMPILE([
37 ++ #include <stddef.h>
38 ++ #include <stdio.h>
39 ++ #include <jpeglib.h>
40 ++],[
41 ++ jpeg_write_icc_profile(NULL, NULL, 0);
42 ++],[has_jpeg_write_icc_profile=yes],[has_jpeg_write_icc_profile=no]);
43 ++AC_LANG_POP(C++)
44 ++AC_MSG_RESULT([$has_jpeg_write_icc_profile])
45 ++if eval "test x$has_jpeg_write_icc_profile = xyes"; then
46 ++ AC_DEFINE(HAVE_JPEG_WRITE_ICC_PROFILE, 1, [Define to 1 if jpeg_write_icc_profile is available in libjpeg.])
47 ++fi
48 ++fi
49 +
50 + PKG_CHECK_MODULES([libpng], [libpng], [
51 + AC_DEFINE([HAVE_LIBPNG], [1], [Whether libpng was found.])
52 +--- a/examples/CMakeLists.txt
53 ++++ b/examples/CMakeLists.txt
54 +@@ -8,6 +8,24 @@ include (${CMAKE_ROOT}/Modules/FindJPEG.cmake)
55 +
56 + if(JPEG_FOUND)
57 + add_definitions(-DHAVE_LIBJPEG=1)
58 ++
59 ++include (${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake)
60 ++
61 ++set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES})
62 ++check_cxx_source_compiles("
63 ++#include <stddef.h>
64 ++#include <stdio.h>
65 ++#include <jpeglib.h>
66 ++
67 ++int main() {
68 ++ jpeg_write_icc_profile(NULL, NULL, 0);
69 ++ return 0;
70 ++}
71 ++" HAVE_JPEG_WRITE_ICC_PROFILE)
72 ++if(HAVE_JPEG_WRITE_ICC_PROFILE)
73 ++ add_definitions(-DHAVE_JPEG_WRITE_ICC_PROFILE=1)
74 ++endif()
75 ++
76 + set (heif_convert_sources
77 + ${heif_convert_sources}
78 + encoder_jpeg.cc
79 +--- a/examples/encoder_jpeg.cc
80 ++++ b/examples/encoder_jpeg.cc
81 +@@ -17,6 +17,10 @@
82 + * You should have received a copy of the GNU General Public License
83 + * along with convert. If not, see <http://www.gnu.org/licenses/>.
84 + */
85 ++#if defined(HAVE_CONFIG_H)
86 ++#include "config.h"
87 ++#endif
88 ++
89 + #include <assert.h>
90 + #include <errno.h>
91 + #include <string.h>
92 +--- a/examples/encoder_jpeg.h
93 ++++ b/examples/encoder_jpeg.h
94 +@@ -24,6 +24,9 @@
95 + #include <stddef.h>
96 + #include <stdio.h>
97 +
98 ++// Prevent duplicate definition for newer versions of libjpeg-turbo.
99 ++#undef HAVE_STDDEF_H
100 ++#undef HAVE_STDLIB_H
101 + #include <jpeglib.h>
102 +
103 + #include <string>
104 +--- a/examples/heif_enc.cc
105 ++++ b/examples/heif_enc.cc
106 +@@ -35,6 +35,9 @@
107 +
108 + #if HAVE_LIBJPEG
109 + extern "C" {
110 ++// Prevent duplicate definition for newer versions of libjpeg-turbo.
111 ++#undef HAVE_STDDEF_H
112 ++#undef HAVE_STDLIB_H
113 + #include <jpeglib.h>
114 + }
115 + #endif
116
117 diff --git a/media-libs/libheif/libheif-1.3.2.ebuild b/media-libs/libheif/libheif-1.3.2-r1.ebuild
118 similarity index 88%
119 rename from media-libs/libheif/libheif-1.3.2.ebuild
120 rename to media-libs/libheif/libheif-1.3.2-r1.ebuild
121 index 2bce8218a61..aedf7a7e259 100644
122 --- a/media-libs/libheif/libheif-1.3.2.ebuild
123 +++ b/media-libs/libheif/libheif-1.3.2-r1.ebuild
124 @@ -1,4 +1,4 @@
125 -# Copyright 1999-2018 Gentoo Foundation
126 +# Copyright 1999-2018 Gentoo Authors
127 # Distributed under the terms of the GNU General Public License v2
128
129 EAPI="7"
130 @@ -11,6 +11,8 @@ if [[ ${PV} == "9999" ]] ; then
131 else
132 SRC_URI="https://github.com/strukturag/${PN}/releases/download/v${PV}/${P}.tar.gz"
133 KEYWORDS="~amd64 ~x86"
134 +
135 + PATCHES=( "${FILESDIR}"/${P}-openjpeg-2.patch )
136 fi
137
138 DESCRIPTION="ISO/IEC 23008-12:2017 HEIF file format decoder and encoder"
139 @@ -20,14 +22,12 @@ LICENSE="GPL-3"
140 SLOT="0/1.3"
141 IUSE="static-libs +threads"
142
143 -# Doesn't yet support libjpeg-turbo-2, https://github.com/strukturag/libheif/issues/70
144 DEPEND="
145 media-libs/libde265:=[${MULTILIB_USEDEP}]
146 media-libs/libpng:0=[${MULTILIB_USEDEP}]
147 media-libs/x265:=[${MULTILIB_USEDEP}]
148 sys-libs/zlib:=[${MULTILIB_USEDEP}]
149 virtual/jpeg:0=[${MULTILIB_USEDEP}]
150 - !>=media-libs/libjpeg-turbo-2
151 "
152 RDEPEND="${DEPEND}"