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/graphite2/, media-gfx/graphite2/files/
Date: Wed, 29 Dec 2021 15:42:09
Message-Id: 1640792481.b20f577be5280947b9cfcbf0021b4a4ec715e1b6.asturm@gentoo
1 commit: b20f577be5280947b9cfcbf0021b4a4ec715e1b6
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 28 15:43:57 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 29 15:41:21 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b20f577b
7
8 media-gfx/graphite2: python3_10, EAPI-8, cmake function, upstream fix
9
10 Closes: https://bugs.gentoo.org/830038
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 ...e2-1.3.14-fix-inaccurate-slice-range-calc.patch | 34 ++++++
15 .../files/graphite2-1.3.14-no-libtool-file.patch | 68 +++++++++++
16 media-gfx/graphite2/graphite2-1.3.14-r2.ebuild | 124 +++++++++++++++++++++
17 3 files changed, 226 insertions(+)
18
19 diff --git a/media-gfx/graphite2/files/graphite2-1.3.14-fix-inaccurate-slice-range-calc.patch b/media-gfx/graphite2/files/graphite2-1.3.14-fix-inaccurate-slice-range-calc.patch
20 new file mode 100644
21 index 000000000000..32e01535838f
22 --- /dev/null
23 +++ b/media-gfx/graphite2/files/graphite2-1.3.14-fix-inaccurate-slice-range-calc.patch
24 @@ -0,0 +1,34 @@
25 +From 5c181c316ee0399d720efe1e75be702f1ca95b66 Mon Sep 17 00:00:00 2001
26 +From: Martin Hosken <martin_hosken@×××.org>
27 +Date: Thu, 20 May 2021 13:53:29 +0700
28 +Subject: [PATCH] Fix inaccurate slice range calculation for bases with
29 + diacritics
30 +
31 +---
32 + src/Pass.cpp | 9 +++++++--
33 + 1 file changed, 7 insertions(+), 2 deletions(-)
34 +
35 +diff --git a/src/Pass.cpp b/src/Pass.cpp
36 +index db31c22d..47ae2064 100644
37 +--- a/src/Pass.cpp
38 ++++ b/src/Pass.cpp
39 +@@ -1056,12 +1056,17 @@ float Pass::resolveKern(Segment *seg, Slot *slotFix, GR_MAYBE_UNUSED Slot *start
40 + ymin = min(by + bbb.bl.y, ymin);
41 + for (nbor = slotFix->next(); nbor; nbor = nbor->next())
42 + {
43 +- if (nbor->isChildOf(base))
44 +- continue;
45 + if (!gc.check(nbor->gid()))
46 + return 0.;
47 + const Rect &bb = seg->theGlyphBBoxTemporary(nbor->gid());
48 + SlotCollision *cNbor = seg->collisionInfo(nbor);
49 ++ const float nby = nbor->origin().y + cNbor->shift().y;
50 ++ if (nbor->isChildOf(base))
51 ++ {
52 ++ ymax = max(nby + bb.tr.y, ymax);
53 ++ ymin = min(nby + bb.bl.y, ymin);
54 ++ continue;
55 ++ }
56 + if ((bb.bl.y == 0.f && bb.tr.y == 0.f) || (cNbor->flags() & SlotCollision::COLL_ISSPACE))
57 + {
58 + if (m_kernColls == InWord)
59
60 diff --git a/media-gfx/graphite2/files/graphite2-1.3.14-no-libtool-file.patch b/media-gfx/graphite2/files/graphite2-1.3.14-no-libtool-file.patch
61 new file mode 100644
62 index 000000000000..2f1056be05d8
63 --- /dev/null
64 +++ b/media-gfx/graphite2/files/graphite2-1.3.14-no-libtool-file.patch
65 @@ -0,0 +1,68 @@
66 +From https://github.com/silnrsi/graphite/pull/65
67 +
68 +From 3edb88b55c0870989778c670d555aa159a2c3abc Mon Sep 17 00:00:00 2001
69 +From: Fabrice Fontaine <fontaine.fabrice@×××××.com>
70 +Date: Mon, 31 Aug 2020 20:56:43 +0200
71 +Subject: [PATCH] don't install a libtool file with static library
72 +
73 +Static library is supported since version 1.3.11 and
74 +https://github.com/silnrsi/graphite/commit/2f143c04da5caa43ddf4dba437b2f2bc26bf4238
75 +
76 +However, graphite2 is still installing libgraphite2.la which contains
77 +incorrect information (i.e. dlname set to libgraphite2.so and
78 +old_library set to ''):
79 +
80 +dlname='libgraphite2.so'
81 +
82 +library_names='libgraphite2.so.3.2.1 libgraphite2.so.3 libgraphite2.so'
83 +
84 +old_library=''
85 +
86 +dependency_libs=''
87 +
88 +This will result in the following build failure with any applications
89 +using this file such as harfbuzz:
90 +
91 +arm-linux-g++.br_real: error: /home/buildroot/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libgraphite2.so: No such file or directory
92 +make[5]: *** [main] Error 1
93 +
94 +Instead of trying to fix this libtool file, just disable it when
95 +building a static library as it is not needed
96 +
97 +Fixes:
98 + - http://autobuild.buildroot.org/results/9ebe1d11e80755d59190ef2aae82bbba5cc45e44
99 +
100 +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@×××××.com>
101 +
102 +* asturm 2021-12-28: We don't want those files at all.
103 +
104 +---
105 + src/CMakeLists.txt | 8 ++++++--
106 + 1 file changed, 6 insertions(+), 2 deletions(-)
107 +
108 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
109 +index b6ac26bf..a7ace040 100644
110 +--- a/src/CMakeLists.txt
111 ++++ b/src/CMakeLists.txt
112 +@@ -131,7 +131,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
113 + nolib_test(stdc++ $<TARGET_SONAME_FILE:graphite2>)
114 + endif ()
115 + set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
116 +- CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
117 ++ if (0)
118 ++ CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
119 ++ endif()
120 + endif()
121 +
122 + if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
123 +@@ -146,7 +148,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
124 + include(Graphite)
125 + nolib_test(stdc++ $<TARGET_SONAME_FILE:graphite2>)
126 + set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
127 +- CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
128 ++ if (0)
129 ++ CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
130 ++ endif()
131 + endif()
132 +
133 + if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
134
135 diff --git a/media-gfx/graphite2/graphite2-1.3.14-r2.ebuild b/media-gfx/graphite2/graphite2-1.3.14-r2.ebuild
136 new file mode 100644
137 index 000000000000..5fcd5521f24a
138 --- /dev/null
139 +++ b/media-gfx/graphite2/graphite2-1.3.14-r2.ebuild
140 @@ -0,0 +1,124 @@
141 +# Copyright 1999-2021 Gentoo Authors
142 +# Distributed under the terms of the GNU General Public License v2
143 +
144 +EAPI=8
145 +
146 +GENTOO_DEPEND_ON_PERL="no"
147 +PYTHON_COMPAT=( python3_{8..10} )
148 +inherit perl-module python-any-r1 cmake-multilib
149 +
150 +DESCRIPTION="Library providing rendering capabilities for complex non-Roman writing systems"
151 +HOMEPAGE="https://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=graphite_home"
152 +SRC_URI="mirror://sourceforge/silgraphite/${PN}/${P}.tgz"
153 +
154 +LICENSE="LGPL-2.1"
155 +SLOT="0"
156 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
157 +IUSE="perl test"
158 +RESTRICT="!test? ( test )"
159 +
160 +RDEPEND="perl? ( dev-lang/perl:= )"
161 +DEPEND="${RDEPEND}
162 + test? ( dev-libs/glib:2 )
163 +"
164 +BDEPEND="
165 + perl? (
166 + dev-lang/perl
167 + dev-perl/Locale-Maketext-Lexicon
168 + dev-perl/Module-Build
169 + )
170 + test? (
171 + ${PYTHON_DEPS}
172 + $(python_gen_any_dep 'dev-python/fonttools[${PYTHON_USEDEP}]')
173 + media-libs/fontconfig
174 + perl? ( virtual/perl-Test-Simple )
175 + )
176 +"
177 +
178 +PATCHES=(
179 + # downstream:
180 + "${FILESDIR}/${PN}-1.3.5-includes-libs-perl.patch"
181 + "${FILESDIR}/${PN}-1.35-fix-gcc-linking.patch"
182 + "${FILESDIR}/${PN}-1.3.14-fix-cmake-files-libdir.patch"
183 + "${FILESDIR}/${P}-no-libtool-file.patch"
184 + # git master:
185 + "${FILESDIR}/${P}-fix-inaccurate-slice-range-calc.patch"
186 +)
187 +
188 +pkg_setup() {
189 + use perl && perl_set_version
190 + use test && python-any-r1_pkg_setup
191 +}
192 +
193 +python_check_deps() {
194 + has_version -b "dev-python/fonttools[${PYTHON_USEDEP}]"
195 +}
196 +
197 +src_prepare() {
198 + cmake_src_prepare
199 + use test || cmake_comment_add_subdirectory tests
200 +}
201 +
202 +multilib_src_configure() {
203 + local mycmakeargs=(
204 + # Renamed VM_MACHINE_TYPE to GRAPHITE2_VM_TYPE
205 + -DGRAPHITE2_VM_TYPE=direct
206 + )
207 + # https://sourceforge.net/p/silgraphite/bugs/49/
208 + [[ ${CHOST} == powerpc*-apple* ]] && mycmakeargs+=(
209 + -DGRAPHITE2_NSEGCACHE:BOOL=ON
210 + )
211 +
212 + if use elibc_musl ; then
213 + # bug #829690
214 + if use ppc || use x86 ; then
215 + sed -e 's:${GRAPHITE_LINK_FLAGS}:-lssp_nonshared &:' \
216 + -i "${S}"/src/CMakeLists.txt || die
217 + fi
218 + fi
219 +
220 + cmake_src_configure
221 +
222 + # fix perl linking
223 + if multilib_is_native_abi && use perl; then
224 + # we rely on the fact that cmake_src_configure sets BUILD_DIR
225 + sed -e "s:@BUILD_DIR@:\"${BUILD_DIR}/src\":" \
226 + -i "${S}"/contrib/perl/Build.PL || die
227 + fi
228 +}
229 +
230 +src_compile() {
231 + cmake-multilib_src_compile
232 + if use perl; then
233 + cd contrib/perl || die
234 + perl-module_src_configure
235 + perl-module_src_compile
236 + fi
237 +}
238 +
239 +multilib_src_test() {
240 + if multilib_is_native_abi; then
241 + cmake_src_test
242 + else
243 + einfo "Cannot test since python is not multilib."
244 + fi
245 +}
246 +
247 +src_test() {
248 + cmake-multilib_src_test
249 + if use perl; then
250 + # Perl tests fail due to missing POD coverage...
251 + perl_rm_files "contrib/perl/t/pod.t" "contrib/perl/t/pod-coverage.t"
252 + cd contrib/perl || die
253 + perl-module_src_test
254 + fi
255 +}
256 +
257 +src_install() {
258 + cmake-multilib_src_install
259 + if use perl; then
260 + cd contrib/perl || die
261 + perl-module_src_install
262 + perl_delete_localpod
263 + fi
264 +}