Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/exiv2/, media-gfx/exiv2/files/
Date: Tue, 05 Dec 2017 16:15:40
Message-Id: 1512490510.4c6eada07c811dc3bd34ce06907d3a5cd8cafe54.asturm@gentoo
1 commit: 4c6eada07c811dc3bd34ce06907d3a5cd8cafe54
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 5 16:10:05 2017 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 5 16:15:10 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c6eada0
7
8 media-gfx/exiv2: Fix crash with Pentax/Nikon exif data
9
10 Bug: https://bugs.gentoo.org/626214
11 Package-Manager: Portage-2.3.13, Repoman-2.3.4
12
13 media-gfx/exiv2/Manifest | 2 +-
14 media-gfx/exiv2/exiv2-0.26_p20171104-r1.ebuild | 129 +++++++++++++++++++++
15 .../exiv2/files/exiv2-0.26-pentaxnikon-crash.patch | 52 +++++++++
16 3 files changed, 182 insertions(+), 1 deletion(-)
17
18 diff --git a/media-gfx/exiv2/Manifest b/media-gfx/exiv2/Manifest
19 index 44859a8fee7..a9b1bd775e2 100644
20 --- a/media-gfx/exiv2/Manifest
21 +++ b/media-gfx/exiv2/Manifest
22 @@ -1 +1 @@
23 -DIST exiv2-0.26_p20171104.tar.gz 28368697 SHA256 f7a46c0b1d3d3c30518202e62dbe086029f584a064bbb531a0ab11270a454007 SHA512 6f6a884d7978e54dceb9ce45248cd0425ff469887c85ef52b0e38cb755970f69fce96b4b5317c8e8070b833f72ca214696042aac71292a6f9c3440f6a369d474 WHIRLPOOL 7baf5fcde327b2e1decde48f44b616f98fab7c65d22ee5e94e0b356fad4d7950c116db17a94b3c91954ac1565c3fe2853b83262c0a4597744dea708b304dce09
24 +DIST exiv2-0.26_p20171104.tar.gz 28368697 BLAKE2B 50013cf0bf30a2a476b02d5db4027fca268a4b38733762eb4c08e5f3bdfaf737038e9a62f7ef471fecb10250d8ae686ef683f9b0ea4ccc5d109440ba534371e4 SHA512 6f6a884d7978e54dceb9ce45248cd0425ff469887c85ef52b0e38cb755970f69fce96b4b5317c8e8070b833f72ca214696042aac71292a6f9c3440f6a369d474
25
26 diff --git a/media-gfx/exiv2/exiv2-0.26_p20171104-r1.ebuild b/media-gfx/exiv2/exiv2-0.26_p20171104-r1.ebuild
27 new file mode 100644
28 index 00000000000..f7eb67dc5bf
29 --- /dev/null
30 +++ b/media-gfx/exiv2/exiv2-0.26_p20171104-r1.ebuild
31 @@ -0,0 +1,129 @@
32 +# Copyright 1999-2017 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=6
36 +
37 +LINGUAS="bs de es fi fr gl ms pl pt ru sk sv ug uk vi"
38 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
39 +if [[ ${PV} = *9999 ]]; then
40 + EGIT_REPO_URI="https://github.com/Exiv2/exiv2.git"
41 + EGIT_BRANCH="0.26"
42 + GIT_ECLASS=git-r3
43 +else
44 + COMMIT=900d2417dbeb46e14cbf65fc2798ed1d043ab76d
45 + SRC_URI="https://github.com/Exiv2/${PN}/tarball/${COMMIT} -> ${P}.tar.gz"
46 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
47 +fi
48 +inherit cmake-multilib python-any-r1 vcs-snapshot
49 +
50 +DESCRIPTION="EXIF, IPTC and XMP metadata C++ library and command line utility"
51 +HOMEPAGE="http://www.exiv2.org/"
52 +
53 +LICENSE="GPL-2"
54 +SLOT="0/26"
55 +IUSE="doc examples nls png webready xmp $(printf 'linguas_%s ' ${LINGUAS})"
56 +
57 +RDEPEND="
58 + >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
59 + nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )
60 + png? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
61 + webready? (
62 + net-libs/libssh[${MULTILIB_USEDEP}]
63 + net-misc/curl[${MULTILIB_USEDEP}]
64 + )
65 + xmp? ( >=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}] )
66 +"
67 +DEPEND="${RDEPEND}
68 + doc? (
69 + ${PYTHON_DEPS}
70 + app-doc/doxygen
71 + dev-libs/libxslt
72 + media-gfx/graphviz
73 + virtual/pkgconfig
74 + )
75 + nls? ( sys-devel/gettext )
76 +"
77 +
78 +DOCS=( README doc/ChangeLog doc/cmd.txt )
79 +
80 +PATCHES=(
81 + # TODO: Take to upstream
82 + "${FILESDIR}"/${PN}-0.26-fix-docs.patch
83 + "${FILESDIR}"/${PN}-0.26-tools-optional.patch
84 + "${FILESDIR}"/${PN}-0.26-pentaxnikon-crash.patch
85 +)
86 +
87 +pkg_setup() {
88 + use doc && python-any-r1_pkg_setup
89 +}
90 +
91 +src_prepare() {
92 + if [[ ${PV} != *9999 ]] ; then
93 + if [[ -d po ]] ; then
94 + pushd po > /dev/null || die
95 + local lang
96 + for lang in *.po; do
97 + if [[ -e ${lang} ]] && ! has ${lang/.po/} ${LINGUAS} ; then
98 + case ${lang} in
99 + CMakeLists.txt | \
100 + ${PN}.pot) ;;
101 + *) rm -r ${lang} || die ;;
102 + esac
103 + fi
104 + done
105 + popd > /dev/null || die
106 + else
107 + die "Failed to prepare LINGUAS - po directory moved?"
108 + fi
109 + fi
110 +
111 + # FIXME @upstream:
112 + einfo "Converting doc/cmd.txt to UTF-8"
113 + iconv -f LATIN1 -t UTF-8 doc/cmd.txt > doc/cmd.txt.tmp || die
114 + mv -f doc/cmd.txt.tmp doc/cmd.txt || die
115 +
116 + if use doc; then
117 + einfo "Updating doxygen config"
118 + doxygen &>/dev/null -u config/Doxyfile || die
119 + fi
120 +
121 + cmake-utils_src_prepare
122 +}
123 +
124 +multilib_src_configure() {
125 + local mycmakeargs=(
126 + -DEXIV2_ENABLE_BUILD_SAMPLES=NO
127 + -DEXIV2_ENABLE_BUILD_PO=$(usex nls)
128 + -DEXIV2_ENABLE_NLS=$(usex nls)
129 + -DEXIV2_ENABLE_PNG=$(usex png)
130 + -DEXIV2_ENABLE_CURL=$(usex webready)
131 + -DEXIV2_ENABLE_SSH=$(usex webready)
132 + -DEXIV2_ENABLE_WEBREADY=$(usex webready)
133 + -DEXIV2_ENABLE_XMP=$(usex xmp)
134 + -DEXIV2_ENABLE_LIBXMP=NO
135 + $(multilib_is_native_abi || echo -DEXIV2_ENABLE_TOOLS=NO)
136 + )
137 +
138 + cmake-utils_src_configure
139 +}
140 +
141 +multilib_src_compile() {
142 + cmake-utils_src_compile
143 +
144 + if multilib_is_native_abi; then
145 + use doc && emake -j1 doc
146 + fi
147 +}
148 +
149 +multilib_src_install_all() {
150 + use xmp && DOCS+=( doc/{COPYING-XMPSDK,README-XMP,cmdxmp.txt} )
151 + use doc && HTML_DOCS=( "${S}"/doc/html/. )
152 +
153 + einstalldocs
154 + find "${D}" -name '*.la' -delete || die
155 +
156 + if use examples; then
157 + docinto examples
158 + dodoc samples/*.cpp
159 + fi
160 +}
161
162 diff --git a/media-gfx/exiv2/files/exiv2-0.26-pentaxnikon-crash.patch b/media-gfx/exiv2/files/exiv2-0.26-pentaxnikon-crash.patch
163 new file mode 100644
164 index 00000000000..a66af8d5dc9
165 --- /dev/null
166 +++ b/media-gfx/exiv2/files/exiv2-0.26-pentaxnikon-crash.patch
167 @@ -0,0 +1,52 @@
168 +From 2dc166b04ca6152d01bff6627a332e89ddef24d1 Mon Sep 17 00:00:00 2001
169 +From: clanmills <robin@×××××××××.com>
170 +Date: Tue, 12 Sep 2017 09:14:42 +0100
171 +Subject: [PATCH 1/2] Fix http://dev.exiv2.org/issues/1305
172 +
173 +---
174 + src/pentaxmn.cpp | 2 ++
175 + 1 file changed, 2 insertions(+)
176 +
177 +diff --git a/src/pentaxmn.cpp b/src/pentaxmn.cpp
178 +index 4fc38be0..b22cb43b 100644
179 +--- a/src/pentaxmn.cpp
180 ++++ b/src/pentaxmn.cpp
181 +@@ -1167,6 +1167,8 @@ namespace Exiv2 {
182 +
183 + std::ostream& PentaxMakerNote::printShutterCount(std::ostream& os, const Value& value, const ExifData* metadata)
184 + {
185 ++ if ( ! metadata ) return os << "undefined" ;
186 ++
187 + ExifData::const_iterator dateIt = metadata->findKey(
188 + ExifKey("Exif.PentaxDng.Date"));
189 + if (dateIt == metadata->end()) {
190 +--
191 +2.13.6
192 +
193 +
194 +From 3bc0b91bcecefdad531129b1a934be1251021c95 Mon Sep 17 00:00:00 2001
195 +From: =?UTF-8?q?M=C4=81ris=20Narti=C5=A1s?= <mn@××××××.lv>
196 +Date: Mon, 18 Sep 2017 23:37:40 +0300
197 +Subject: [PATCH 2/2] Fix crash on undefined metadata on some Nikon images.
198 + Identical to commit:5405d61623e82896e498c5c8342dd6f42e689115
199 +
200 +---
201 + src/nikonmn.cpp | 2 ++
202 + 1 file changed, 2 insertions(+)
203 +
204 +diff --git a/src/nikonmn.cpp b/src/nikonmn.cpp
205 +index 571ab806..34bf601c 100644
206 +--- a/src/nikonmn.cpp
207 ++++ b/src/nikonmn.cpp
208 +@@ -299,6 +299,8 @@ namespace Exiv2 {
209 + const Value& value,
210 + const ExifData* exifData)
211 + {
212 ++ if ( ! exifData ) return os << "undefined" ;
213 ++
214 + if ( value.count() >= 9 ) {
215 + ByteOrder bo = getKeyString("Exif.MakerNote.ByteOrder",exifData) == "MM" ? bigEndian : littleEndian;
216 + byte p[4];
217 +--
218 +2.13.6
219 +