1 |
commit: dd3025146de1c3dd04ed2b5797c0586c4e37cfc9 |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Jun 19 00:51:03 2021 +0000 |
4 |
Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
5 |
CommitDate: Sat Jun 19 00:51:03 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=dd302514 |
7 |
|
8 |
media-gfx/fontdiff: initial import |
9 |
|
10 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
11 |
|
12 |
media-gfx/fontdiff/Manifest | 1 + |
13 |
.../files/fontdiff-0.2.3-no-bundled-libs.patch | 28 +++++++++ |
14 |
media-gfx/fontdiff/files/fontdiff-cairo114.diff | 13 +++++ |
15 |
media-gfx/fontdiff/files/fontdiff-hbicu.diff | 53 +++++++++++++++++ |
16 |
media-gfx/fontdiff/fontdiff-0.2.3.ebuild | 68 ++++++++++++++++++++++ |
17 |
media-gfx/fontdiff/metadata.xml | 5 ++ |
18 |
6 files changed, 168 insertions(+) |
19 |
|
20 |
diff --git a/media-gfx/fontdiff/Manifest b/media-gfx/fontdiff/Manifest |
21 |
new file mode 100644 |
22 |
index 000000000..68031ebc2 |
23 |
--- /dev/null |
24 |
+++ b/media-gfx/fontdiff/Manifest |
25 |
@@ -0,0 +1 @@ |
26 |
+DIST fontdiff-0.2.3.tar.gz 23940699 BLAKE2B 3a14deae16e67ba5c897c9b0779a9a5e4f2f5a5c9bb4ad2dd2e605fbc854b6939196c387160b2ed5b950ce81cf80868aa17414113115058d16e2ffeca752ed97 SHA512 6fb04c1527f8dc73677b8cb5437760f72deabc4ab117e2c16f0bff36e6e5eb58b1e1ff5e45f54de03be0534f0ab55b447a32ce56d9d2750817643dff84e087ea |
27 |
|
28 |
diff --git a/media-gfx/fontdiff/files/fontdiff-0.2.3-no-bundled-libs.patch b/media-gfx/fontdiff/files/fontdiff-0.2.3-no-bundled-libs.patch |
29 |
new file mode 100644 |
30 |
index 000000000..7e5dad0be |
31 |
--- /dev/null |
32 |
+++ b/media-gfx/fontdiff/files/fontdiff-0.2.3-no-bundled-libs.patch |
33 |
@@ -0,0 +1,28 @@ |
34 |
+--- a/src/fontdiff/fontdiff.gyp |
35 |
++++ b/src/fontdiff/fontdiff.gyp |
36 |
+@@ -20,9 +20,7 @@ |
37 |
+ 'main.cc', |
38 |
+ ], |
39 |
+ 'dependencies': [ |
40 |
+- 'fontdiff_lib', |
41 |
+- '../third_party/freetype/freetype.gyp:freetype', |
42 |
+- '../third_party/icu/icu.gyp:icu_uc', |
43 |
++ 'fontdiff_lib' |
44 |
+ ], |
45 |
+ 'conditions': [ |
46 |
+ ['OS == "linux"', { |
47 |
+@@ -67,14 +65,6 @@ |
48 |
+ 'FONTDIFF_VERSION=' + '<!(echo $FONTDIFF_VERSION)', |
49 |
+ ], |
50 |
+ 'dependencies': [ |
51 |
+- '../third_party/cairo/cairo.gyp:cairo', |
52 |
+- '../third_party/dtl/dtl.gyp:dtl', |
53 |
+- '../third_party/expat/expat.gyp:expat', |
54 |
+- '../third_party/freetype/freetype.gyp:freetype', |
55 |
+- '../third_party/harfbuzz/harfbuzz.gyp:harfbuzz', |
56 |
+- '../third_party/icu/icu.gyp:icu_i18n', |
57 |
+- '../third_party/icu/icu.gyp:icu_uc', |
58 |
+- '../third_party/icu/icu.gyp:icu_data', |
59 |
+ ], |
60 |
+ 'conditions': [ |
61 |
+ ['OS == "linux"', { |
62 |
|
63 |
diff --git a/media-gfx/fontdiff/files/fontdiff-cairo114.diff b/media-gfx/fontdiff/files/fontdiff-cairo114.diff |
64 |
new file mode 100644 |
65 |
index 000000000..9bad60d3b |
66 |
--- /dev/null |
67 |
+++ b/media-gfx/fontdiff/files/fontdiff-cairo114.diff |
68 |
@@ -0,0 +1,13 @@ |
69 |
+--- a/src/fontdiff/diff_job.cc |
70 |
++++ b/src/fontdiff/diff_job.cc |
71 |
+@@ -77,8 +77,10 @@ void DiffJob::WritePDF(const std::string& filepath) { |
72 |
+ creator.append(" "); |
73 |
+ creator.append(version); |
74 |
+ } |
75 |
++ #if CAIRO_VERSION > 11499 |
76 |
+ cairo_pdf_surface_set_metadata(pdf_surface, CAIRO_PDF_METADATA_CREATOR, |
77 |
+ creator.c_str()); |
78 |
++ #endif |
79 |
+ |
80 |
+ cairo_t* pdf = cairo_create(pdf_surface); |
81 |
+ for (const Page* page : pages_) { |
82 |
|
83 |
diff --git a/media-gfx/fontdiff/files/fontdiff-hbicu.diff b/media-gfx/fontdiff/files/fontdiff-hbicu.diff |
84 |
new file mode 100644 |
85 |
index 000000000..121d87fd8 |
86 |
--- /dev/null |
87 |
+++ b/media-gfx/fontdiff/files/fontdiff-hbicu.diff |
88 |
@@ -0,0 +1,53 @@ |
89 |
+--- a/src/fontdiff/diff_job.cc |
90 |
++++ b/src/fontdiff/diff_job.cc |
91 |
+@@ -132,7 +132,7 @@ void DiffJob::HandleEndElement() { |
92 |
+ xmlElements_.pop_back(); |
93 |
+ } |
94 |
+ |
95 |
+-void DiffJob::HandleCharData(const StringPiece& text) { |
96 |
++void DiffJob::HandleCharData(const icu::StringPiece& text) { |
97 |
+ const XMLElement& e = xmlElements_.back(); |
98 |
+ e.paragraph->AppendSpan(text, e.style); |
99 |
+ } |
100 |
+--- a/src/fontdiff/diff_job.h |
101 |
++++ b/src/fontdiff/diff_job.h |
102 |
+@@ -62,7 +62,7 @@ class DiffJob { |
103 |
+ const std::string& name, |
104 |
+ const std::map<std::string, std::string>& attr); |
105 |
+ void HandleEndElement(); |
106 |
+- void HandleCharData(const StringPiece& text); |
107 |
++ void HandleCharData(const icu::StringPiece& text); |
108 |
+ |
109 |
+ bool has_diffs_; |
110 |
+ const FontCollection* beforeFonts_; |
111 |
+--- a/src/fontdiff/paragraph.cc |
112 |
++++ b/src/fontdiff/paragraph.cc |
113 |
+@@ -300,7 +300,7 @@ void Paragraph::FindPotentialLineBreaks(int32_t start, int32_t limit, |
114 |
+ if (breaker) { |
115 |
+ breaker->setText(text_); |
116 |
+ int32_t cur = breaker->following(start > 0 ? start - 1 : 0); |
117 |
+- while (cur != BreakIterator::DONE && cur < limit) { |
118 |
++ while (cur != icu::BreakIterator::DONE && cur < limit) { |
119 |
+ breaks->push_back(cur); |
120 |
+ cur = breaker->next(); |
121 |
+ } |
122 |
+--- a/src/fontdiff/shaped_text.cc |
123 |
++++ b/src/fontdiff/shaped_text.cc |
124 |
+@@ -21,7 +21,7 @@ |
125 |
+ #include <hb.h> |
126 |
+ #include <hb-ft.h> |
127 |
+ #include <hb-icu.h> |
128 |
+-#include <unicode/unistr.h> |
129 |
++#include <unicode/ustring.h> |
130 |
+ |
131 |
+ #include "fontdiff/font.h" |
132 |
+ #include "fontdiff/icu_helper.h" |
133 |
+@@ -39,7 +39,7 @@ ShapedText::ShapedText(const UChar* text, int32_t start, int32_t limit, |
134 |
+ hb_buffer_(hb_buffer_create()), ascender_(0), descender_(0) { |
135 |
+ const int32_t length = limit - start; |
136 |
+ hb_buffer_set_unicode_funcs(hb_buffer_, hb_icu_get_unicode_funcs()); |
137 |
+- hb_buffer_add_utf16(hb_buffer_, text + start, length, 0, length); |
138 |
++ hb_buffer_add_utf16(hb_buffer_, (uint16_t*)text + start, length, 0, length); |
139 |
+ hb_buffer_set_cluster_level(hb_buffer_, |
140 |
+ HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS); |
141 |
+ hb_segment_properties_t props; |
142 |
|
143 |
diff --git a/media-gfx/fontdiff/fontdiff-0.2.3.ebuild b/media-gfx/fontdiff/fontdiff-0.2.3.ebuild |
144 |
new file mode 100644 |
145 |
index 000000000..c01424df6 |
146 |
--- /dev/null |
147 |
+++ b/media-gfx/fontdiff/fontdiff-0.2.3.ebuild |
148 |
@@ -0,0 +1,68 @@ |
149 |
+# Copyright 1999-2021 Gentoo Authors |
150 |
+# Distributed under the terms of the GNU General Public License v2 |
151 |
+ |
152 |
+EAPI=7 |
153 |
+ |
154 |
+inherit toolchain-funcs |
155 |
+ |
156 |
+SRC_URI="https://github.com/googlefonts/fontdiff/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" |
157 |
+KEYWORDS="~amd64" |
158 |
+DESCRIPTION="A tool for finding visual differences between two font versions" |
159 |
+HOMEPAGE="https://github.com/googlei18n/fontdiff" |
160 |
+LICENSE="Apache-2.0" |
161 |
+SLOT="0" |
162 |
+ |
163 |
+RDEPEND=" |
164 |
+ app-i18n/unicode-data |
165 |
+ app-i18n/unicode-emoji |
166 |
+ dev-libs/expat |
167 |
+ dev-libs/fribidi |
168 |
+ dev-libs/icu:= |
169 |
+ dev-util/ragel |
170 |
+ >=media-libs/freetype-2.9:2 |
171 |
+ >=media-libs/harfbuzz-1.7.4[icu] |
172 |
+ x11-libs/cairo |
173 |
+ x11-libs/pixman |
174 |
+" |
175 |
+DEPEND=" |
176 |
+ ${RDEPEND} |
177 |
+ dev-cpp/dtl |
178 |
+ dev-util/gyp |
179 |
+" |
180 |
+BDEPEND="virtual/pkgconfig" |
181 |
+ |
182 |
+PATCHES=( |
183 |
+ "${FILESDIR}/${PN}-cairo114.diff" |
184 |
+ "${FILESDIR}/${PN}-hbicu.diff" |
185 |
+ "${FILESDIR}/${P}-no-bundled-libs.patch" |
186 |
+) |
187 |
+ |
188 |
+src_prepare() { |
189 |
+ #no bundled libs |
190 |
+ rm -r src/third_party || die |
191 |
+ default |
192 |
+} |
193 |
+ |
194 |
+src_configure() { |
195 |
+ gyp -f make --depth . "${S}/src/fontdiff/fontdiff.gyp" || die |
196 |
+} |
197 |
+ |
198 |
+src_compile() { |
199 |
+ local _pc="$(tc-getPKG_CONFIG)" |
200 |
+ local _d="cairo expat freetype2 harfbuzz-icu icu-uc" |
201 |
+ local myargs=( |
202 |
+ CXX=$(tc-getCXX) |
203 |
+ CC=$(tc-getCC) |
204 |
+ AR=$(tc-getAR) |
205 |
+ LIBS="$(${_pc} --libs ${_d})" |
206 |
+ CPPFLAGS="$(${_pc} --cflags ${_d})" |
207 |
+ V=1 |
208 |
+ ) |
209 |
+ |
210 |
+ emake "${myargs[@]}" |
211 |
+} |
212 |
+ |
213 |
+src_install() { |
214 |
+ dobin "${S}/out/Default/${PN}" |
215 |
+ einstalldocs |
216 |
+} |
217 |
|
218 |
diff --git a/media-gfx/fontdiff/metadata.xml b/media-gfx/fontdiff/metadata.xml |
219 |
new file mode 100644 |
220 |
index 000000000..6f49eba8f |
221 |
--- /dev/null |
222 |
+++ b/media-gfx/fontdiff/metadata.xml |
223 |
@@ -0,0 +1,5 @@ |
224 |
+<?xml version="1.0" encoding="UTF-8"?> |
225 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
226 |
+<pkgmetadata> |
227 |
+<!-- maintainer-needed --> |
228 |
+</pkgmetadata> |