Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-simulation/openttd/, games-simulation/openttd/files/
Date: Fri, 21 Sep 2018 11:37:17
Message-Id: 1537529825.d0c2fcd0affe96e988eefb31f7c561d6fc12a3af.polynomial-c@gentoo
1 commit: d0c2fcd0affe96e988eefb31f7c561d6fc12a3af
2 Author: Stefan Strogin <stefan.strogin <AT> gmail <DOT> com>
3 AuthorDate: Wed Sep 19 21:01:44 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 21 11:37:05 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0c2fcd0
7
8 games-simulation/openttd: fix compilation with icu-62.1
9
10 Closes: https://bugs.gentoo.org/666578
11 Package-Manager: Portage-2.3.49, Repoman-2.3.10
12 Signed-off-by: Stefan Strogin <stefan.strogin <AT> gmail.com>
13 Closes: https://github.com/gentoo/gentoo/pull/9922
14
15 .../openttd/files/openttd-1.8.0-icu62.patch | 99 ++++++++++++++++++++++
16 games-simulation/openttd/openttd-1.8.0.ebuild | 1 +
17 2 files changed, 100 insertions(+)
18
19 diff --git a/games-simulation/openttd/files/openttd-1.8.0-icu62.patch b/games-simulation/openttd/files/openttd-1.8.0-icu62.patch
20 new file mode 100644
21 index 00000000000..9ba907fa47e
22 --- /dev/null
23 +++ b/games-simulation/openttd/files/openttd-1.8.0-icu62.patch
24 @@ -0,0 +1,99 @@
25 +From 55bf7628e299ef2c143e9ac97e87817b5eda3239 Mon Sep 17 00:00:00 2001
26 +From: Stefan Strogin <stefan.strogin@×××××.com>
27 +Date: Wed, 19 Sep 2018 23:52:10 +0300
28 +Subject: [PATCH] Fix #6854: Compilation with ICU 62
29 +
30 +---
31 + src/gfx_layout.cpp | 18 +++++++++---------
32 + src/gfx_layout.h | 2 +-
33 + 2 files changed, 10 insertions(+), 10 deletions(-)
34 +
35 +diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp
36 +index f5463d401..e13ece0e7 100644
37 +--- a/src/gfx_layout.cpp
38 ++++ b/src/gfx_layout.cpp
39 +@@ -126,7 +126,7 @@ static size_t AppendToBuffer(UChar *buff, const UChar *buffer_last, WChar c)
40 + * Wrapper for doing layouts with ICU.
41 + */
42 + class ICUParagraphLayout : public AutoDeleteSmallVector<ParagraphLayouter::Line *, 4>, public ParagraphLayouter {
43 +- ParagraphLayout *p; ///< The actual ICU paragraph layout.
44 ++ icu::ParagraphLayout *p; ///< The actual ICU paragraph layout.
45 + public:
46 + /** Helper for GetLayouter, to get the right type. */
47 + typedef UChar CharType;
48 +@@ -135,10 +135,10 @@ public:
49 +
50 + /** Visual run contains data about the bit of text with the same font. */
51 + class ICUVisualRun : public ParagraphLayouter::VisualRun {
52 +- const ParagraphLayout::VisualRun *vr; ///< The actual ICU vr.
53 ++ const icu::ParagraphLayout::VisualRun *vr; ///< The actual ICU vr.
54 +
55 + public:
56 +- ICUVisualRun(const ParagraphLayout::VisualRun *vr) : vr(vr) { }
57 ++ ICUVisualRun(const icu::ParagraphLayout::VisualRun *vr) : vr(vr) { }
58 +
59 + const Font *GetFont() const { return (const Font*)vr->getFont(); }
60 + int GetGlyphCount() const { return vr->getGlyphCount(); }
61 +@@ -150,10 +150,10 @@ public:
62 +
63 + /** A single line worth of VisualRuns. */
64 + class ICULine : public AutoDeleteSmallVector<ICUVisualRun *, 4>, public ParagraphLayouter::Line {
65 +- ParagraphLayout::Line *l; ///< The actual ICU line.
66 ++ icu::ParagraphLayout::Line *l; ///< The actual ICU line.
67 +
68 + public:
69 +- ICULine(ParagraphLayout::Line *l) : l(l)
70 ++ ICULine(icu::ParagraphLayout::Line *l) : l(l)
71 + {
72 + for (int i = 0; i < l->countRuns(); i++) {
73 + *this->Append() = new ICUVisualRun(l->getVisualRun(i));
74 +@@ -173,13 +173,13 @@ public:
75 + }
76 + };
77 +
78 +- ICUParagraphLayout(ParagraphLayout *p) : p(p) { }
79 ++ ICUParagraphLayout(icu::ParagraphLayout *p) : p(p) { }
80 + ~ICUParagraphLayout() { delete p; }
81 + void Reflow() { p->reflow(); }
82 +
83 + ParagraphLayouter::Line *NextLine(int max_width)
84 + {
85 +- ParagraphLayout::Line *l = p->nextLine(max_width);
86 ++ icu::ParagraphLayout::Line *l = p->nextLine(max_width);
87 + return l == NULL ? NULL : new ICULine(l);
88 + }
89 + };
90 +@@ -196,7 +196,7 @@ static ParagraphLayouter *GetParagraphLayout(UChar *buff, UChar *buff_end, FontM
91 + }
92 +
93 + /* Fill ICU's FontRuns with the right data. */
94 +- FontRuns runs(fontMapping.Length());
95 ++ icu::FontRuns runs(fontMapping.Length());
96 + for (FontMap::iterator iter = fontMapping.Begin(); iter != fontMapping.End(); iter++) {
97 + runs.add(iter->second, iter->first);
98 + }
99 +@@ -204,7 +204,7 @@ static ParagraphLayouter *GetParagraphLayout(UChar *buff, UChar *buff_end, FontM
100 + LEErrorCode status = LE_NO_ERROR;
101 + /* ParagraphLayout does not copy "buff", so it must stay valid.
102 + * "runs" is copied according to the ICU source, but the documentation does not specify anything, so this might break somewhen. */
103 +- ParagraphLayout *p = new ParagraphLayout(buff, length, &runs, NULL, NULL, NULL, _current_text_dir == TD_RTL ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR, false, status);
104 ++ icu::ParagraphLayout *p = new icu::ParagraphLayout(buff, length, &runs, NULL, NULL, NULL, _current_text_dir == TD_RTL ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR, false, status);
105 + if (status != LE_NO_ERROR) {
106 + delete p;
107 + return NULL;
108 +diff --git a/src/gfx_layout.h b/src/gfx_layout.h
109 +index 0a21d9b0c..028f5be63 100644
110 +--- a/src/gfx_layout.h
111 ++++ b/src/gfx_layout.h
112 +@@ -21,7 +21,7 @@
113 +
114 + #ifdef WITH_ICU_LAYOUT
115 + #include "layout/ParagraphLayout.h"
116 +-#define ICU_FONTINSTANCE : public LEFontInstance
117 ++#define ICU_FONTINSTANCE : public icu::LEFontInstance
118 + #else /* WITH_ICU_LAYOUT */
119 + #define ICU_FONTINSTANCE
120 + #endif /* WITH_ICU_LAYOUT */
121 +--
122 +2.19.0
123 +
124
125 diff --git a/games-simulation/openttd/openttd-1.8.0.ebuild b/games-simulation/openttd/openttd-1.8.0.ebuild
126 index 2d97c8bf081..7daebea4a2c 100644
127 --- a/games-simulation/openttd/openttd-1.8.0.ebuild
128 +++ b/games-simulation/openttd/openttd-1.8.0.ebuild
129 @@ -52,6 +52,7 @@ S="${WORKDIR}/${MY_P}"
130 PATCHES=(
131 "${FILESDIR}"/${PN}-1.6.0-cflags.patch
132 "${FILESDIR}"/${PN}-1.8.0-icu61.patch
133 + "${FILESDIR}"/${PN}-1.8.0-icu62.patch
134 )
135
136 src_configure() {