Gentoo Archives: gentoo-commits

From: Ian Stakenvicius <axs@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/graphite2/, media-gfx/graphite2/files/
Date: Thu, 27 Apr 2017 03:15:35
Message-Id: 1493262920.0608e06d87b35052fb08d47652a3016c4756c435.axs@gentoo
1 commit: 0608e06d87b35052fb08d47652a3016c4756c435
2 Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 27 02:26:43 2017 +0000
4 Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 27 03:15:20 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0608e06d
7
8 media-gfx/graphite2: patch and revbump for security bug 616034
9
10 Applied the two patches mozilla backported to fix MFSA-2017-11 to 1.3.8-r1,
11 and 1.3.9-r1 as applicable.
12
13 Package-Manager: Portage-2.3.3, Repoman-2.3.1
14
15 ...hite2-1.3.8-rule-length-test-overflow-fix.patch | 22 ++++
16 ...raphite2-1.3.9-increase-pDest-reservation.patch | 22 ++++
17 media-gfx/graphite2/graphite2-1.3.8-r1.ebuild | 121 +++++++++++++++++++++
18 media-gfx/graphite2/graphite2-1.3.9-r1.ebuild | 120 ++++++++++++++++++++
19 4 files changed, 285 insertions(+)
20
21 diff --git a/media-gfx/graphite2/files/graphite2-1.3.8-rule-length-test-overflow-fix.patch b/media-gfx/graphite2/files/graphite2-1.3.8-rule-length-test-overflow-fix.patch
22 new file mode 100644
23 index 00000000000..624442fbb16
24 --- /dev/null
25 +++ b/media-gfx/graphite2/files/graphite2-1.3.8-rule-length-test-overflow-fix.patch
26 @@ -0,0 +1,22 @@
27 +From 56157cf9845d13452068c297205f96b946126cc2 Mon Sep 17 00:00:00 2001
28 +From: Martin Hosken <martin_hosken@×××.org>
29 +Date: Mon, 4 Apr 2016 16:04:16 +0700
30 +Subject: [PATCH] Resolve rule length test overflow
31 +
32 +---
33 + src/Pass.cpp | 2 +-
34 + 1 file changed, 1 insertion(+), 1 deletion(-)
35 +
36 +diff --git a/src/Pass.cpp b/src/Pass.cpp
37 +index 7289406..1c9c73c 100644
38 +--- a/src/Pass.cpp
39 ++++ b/src/Pass.cpp
40 +@@ -635,7 +635,7 @@ bool Pass::testPassConstraint(Machine & m) const
41 + bool Pass::testConstraint(const Rule & r, Machine & m) const
42 + {
43 + const uint16 curr_context = m.slotMap().context();
44 +- if (unsigned(r.sort - r.preContext) > m.slotMap().size() - curr_context
45 ++ if (unsigned(r.sort + curr_context - r.preContext) > m.slotMap().size()
46 + || curr_context - r.preContext < 0) return false;
47 +
48 + vm::slotref * map = m.slotMap().begin() + curr_context - r.preContext;
49
50 diff --git a/media-gfx/graphite2/files/graphite2-1.3.9-increase-pDest-reservation.patch b/media-gfx/graphite2/files/graphite2-1.3.9-increase-pDest-reservation.patch
51 new file mode 100644
52 index 00000000000..fdd7e7ec4f0
53 --- /dev/null
54 +++ b/media-gfx/graphite2/files/graphite2-1.3.9-increase-pDest-reservation.patch
55 @@ -0,0 +1,22 @@
56 +From 1ce331d5548b98ed8b818532b2556d6f2c7a3b83 Mon Sep 17 00:00:00 2001
57 +From: Martin Hosken <martin_hosken@×××.org>
58 +Date: Thu, 9 Mar 2017 22:04:04 +0000
59 +Subject: [PATCH] Ensure features have enough space. Fix from Mozilla
60 +
61 +---
62 + src/FeatureMap.cpp | 2 +-
63 + 1 file changed, 1 insertion(+), 1 deletion(-)
64 +
65 +diff --git a/src/FeatureMap.cpp b/src/FeatureMap.cpp
66 +index b8c8405..83bd5f6 100644
67 +--- a/src/FeatureMap.cpp
68 ++++ b/src/FeatureMap.cpp
69 +@@ -275,7 +275,7 @@ bool FeatureRef::applyValToFeature(uint32 val, Features & pDest) const
70 + else
71 + if (pDest.m_pMap!=&m_pFace->theSill().theFeatureMap())
72 + return false; //incompatible
73 +- pDest.reserve(m_index);
74 ++ pDest.reserve(m_index+1);
75 + pDest[m_index] &= ~m_mask;
76 + pDest[m_index] |= (uint32(val) << m_bits);
77 + return true;
78
79 diff --git a/media-gfx/graphite2/graphite2-1.3.8-r1.ebuild b/media-gfx/graphite2/graphite2-1.3.8-r1.ebuild
80 new file mode 100644
81 index 00000000000..d72cda42264
82 --- /dev/null
83 +++ b/media-gfx/graphite2/graphite2-1.3.8-r1.ebuild
84 @@ -0,0 +1,121 @@
85 +# Copyright 1999-2017 Gentoo Foundation
86 +# Distributed under the terms of the GNU General Public License v2
87 +
88 +EAPI=6
89 +
90 +PYTHON_COMPAT=( python2_7 )
91 +
92 +GENTOO_DEPEND_ON_PERL="no"
93 +inherit eutils perl-module python-any-r1 cmake-multilib
94 +
95 +DESCRIPTION="Library providing rendering capabilities for complex non-Roman writing systems"
96 +HOMEPAGE="http://graphite.sil.org/"
97 +SRC_URI="mirror://sourceforge/silgraphite/${PN}/${P}.tgz"
98 +
99 +LICENSE="LGPL-2.1"
100 +SLOT="0"
101 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
102 +IUSE="perl test"
103 +
104 +RDEPEND="
105 + perl? ( dev-lang/perl:= )
106 +"
107 +DEPEND="${RDEPEND}
108 + perl? (
109 + dev-perl/Module-Build
110 + dev-perl/Locale-Maketext-Lexicon
111 + )
112 + test? (
113 + dev-libs/glib:2
114 + media-libs/fontconfig
115 + media-libs/silgraphite
116 + $(python_gen_any_dep '
117 + dev-python/fonttools[${PYTHON_USEDEP}]
118 + ')
119 + ${PYTHON_DEPS}
120 + perl? ( virtual/perl-Test-Simple )
121 + )
122 +"
123 +
124 +PATCHES=(
125 + "${FILESDIR}/${PN}-1.3.5-includes-libs-perl.patch"
126 + "${FILESDIR}/${PN}-1.3.8-rule-length-test-overflow-fix.patch"
127 + "${FILESDIR}/${PN}-1.3.9-increase-pDest-reservation.patch"
128 +)
129 +
130 +pkg_setup() {
131 + use perl && perl_set_version
132 + use test && python-any-r1_pkg_setup
133 +}
134 +
135 +python_check_deps() {
136 + has_version "dev-python/fonttools[${PYTHON_USEDEP}]"
137 +}
138 +
139 +src_prepare() {
140 + cmake-utils_src_prepare
141 +
142 + # make tests optional
143 + if ! use test; then
144 + sed -i \
145 + -e '/tests/d' \
146 + CMakeLists.txt || die
147 + fi
148 +}
149 +
150 +multilib_src_configure() {
151 + local mycmakeargs=(
152 + "-DVM_MACHINE_TYPE=direct"
153 + # https://sourceforge.net/p/silgraphite/bugs/49/
154 + $([[ ${CHOST} == powerpc*-apple* ]] && \
155 + echo "-DGRAPHITE2_NSEGCACHE:BOOL=ON")
156 + )
157 +
158 + cmake-utils_src_configure
159 +
160 + # fix perl linking
161 + if multilib_is_native_abi && use perl; then
162 + # we rely on the fact that cmake-utils_src_configure sets BUILD_DIR
163 + sed -i \
164 + -e "s:@BUILD_DIR@:\"${BUILD_DIR}/src\":" \
165 + "${S}"/contrib/perl/Build.PL || die
166 + fi
167 +}
168 +
169 +src_compile() {
170 + cmake-multilib_src_compile
171 + if use perl; then
172 + cd contrib/perl || die
173 + perl-module_src_configure
174 + perl-module_src_compile
175 + fi
176 +}
177 +
178 +multilib_src_test() {
179 + if multilib_is_native_abi; then
180 + cmake-utils_src_test
181 + else
182 + einfo Cannot test since python is not multilib.
183 + fi
184 +}
185 +
186 +src_test() {
187 + cmake-multilib_src_test
188 + if use perl; then
189 + cd contrib/perl || die
190 + # SRC_TEST=do
191 + # Perl tests fail due to missing POD coverage...
192 + perl-module_src_test
193 + fi
194 +}
195 +
196 +src_install() {
197 + cmake-multilib_src_install
198 + if use perl; then
199 + cd contrib/perl || die
200 + perl-module_src_install
201 + perl_delete_localpod
202 + fi
203 +
204 + prune_libtool_files --all
205 +}
206
207 diff --git a/media-gfx/graphite2/graphite2-1.3.9-r1.ebuild b/media-gfx/graphite2/graphite2-1.3.9-r1.ebuild
208 new file mode 100644
209 index 00000000000..731a6db5070
210 --- /dev/null
211 +++ b/media-gfx/graphite2/graphite2-1.3.9-r1.ebuild
212 @@ -0,0 +1,120 @@
213 +# Copyright 1999-2017 Gentoo Foundation
214 +# Distributed under the terms of the GNU General Public License v2
215 +
216 +EAPI=6
217 +
218 +PYTHON_COMPAT=( python2_7 )
219 +
220 +GENTOO_DEPEND_ON_PERL="no"
221 +inherit eutils perl-module python-any-r1 cmake-multilib
222 +
223 +DESCRIPTION="Library providing rendering capabilities for complex non-Roman writing systems"
224 +HOMEPAGE="http://graphite.sil.org/"
225 +SRC_URI="mirror://sourceforge/silgraphite/${PN}/${P}.tgz"
226 +
227 +LICENSE="LGPL-2.1"
228 +SLOT="0"
229 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
230 +IUSE="perl test"
231 +
232 +RDEPEND="
233 + perl? ( dev-lang/perl:= )
234 +"
235 +DEPEND="${RDEPEND}
236 + perl? (
237 + dev-perl/Module-Build
238 + dev-perl/Locale-Maketext-Lexicon
239 + )
240 + test? (
241 + dev-libs/glib:2
242 + media-libs/fontconfig
243 + media-libs/silgraphite
244 + $(python_gen_any_dep '
245 + dev-python/fonttools[${PYTHON_USEDEP}]
246 + ')
247 + ${PYTHON_DEPS}
248 + perl? ( virtual/perl-Test-Simple )
249 + )
250 +"
251 +
252 +PATCHES=(
253 + "${FILESDIR}/${PN}-1.3.5-includes-libs-perl.patch"
254 + "${FILESDIR}/${PN}-1.3.9-increase-pDest-reservation.patch"
255 +)
256 +
257 +pkg_setup() {
258 + use perl && perl_set_version
259 + use test && python-any-r1_pkg_setup
260 +}
261 +
262 +python_check_deps() {
263 + has_version "dev-python/fonttools[${PYTHON_USEDEP}]"
264 +}
265 +
266 +src_prepare() {
267 + cmake-utils_src_prepare
268 +
269 + # make tests optional
270 + if ! use test; then
271 + sed -i \
272 + -e '/tests/d' \
273 + CMakeLists.txt || die
274 + fi
275 +}
276 +
277 +multilib_src_configure() {
278 + local mycmakeargs=(
279 + "-DVM_MACHINE_TYPE=direct"
280 + # https://sourceforge.net/p/silgraphite/bugs/49/
281 + $([[ ${CHOST} == powerpc*-apple* ]] && \
282 + echo "-DGRAPHITE2_NSEGCACHE:BOOL=ON")
283 + )
284 +
285 + cmake-utils_src_configure
286 +
287 + # fix perl linking
288 + if multilib_is_native_abi && use perl; then
289 + # we rely on the fact that cmake-utils_src_configure sets BUILD_DIR
290 + sed -i \
291 + -e "s:@BUILD_DIR@:\"${BUILD_DIR}/src\":" \
292 + "${S}"/contrib/perl/Build.PL || die
293 + fi
294 +}
295 +
296 +src_compile() {
297 + cmake-multilib_src_compile
298 + if use perl; then
299 + cd contrib/perl || die
300 + perl-module_src_configure
301 + perl-module_src_compile
302 + fi
303 +}
304 +
305 +multilib_src_test() {
306 + if multilib_is_native_abi; then
307 + cmake-utils_src_test
308 + else
309 + einfo Cannot test since python is not multilib.
310 + fi
311 +}
312 +
313 +src_test() {
314 + cmake-multilib_src_test
315 + if use perl; then
316 + # Perl tests fail due to missing POD coverage...
317 + perl_rm_files "contrib/perl/t/pod.t" "contrib/perl/t/pod-coverage.t"
318 + cd contrib/perl || die
319 + perl-module_src_test
320 + fi
321 +}
322 +
323 +src_install() {
324 + cmake-multilib_src_install
325 + if use perl; then
326 + cd contrib/perl || die
327 + perl-module_src_install
328 + perl_delete_localpod
329 + fi
330 +
331 + prune_libtool_files --all
332 +}