1 |
commit: 83f842d2f4ff6632396577fa77b7ade1ad7f4506 |
2 |
Author: grbd <garlicbready <AT> googlemail <DOT> com> |
3 |
AuthorDate: Sun Mar 25 21:04:12 2018 +0000 |
4 |
Commit: Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Mar 25 21:04:12 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=83f842d2 |
7 |
|
8 |
Added fix for latest mono when using ncurses 6.1 |
9 |
|
10 |
.../mono/files/mono-5.10.0.179-ncurses61.patch | 106 +++++++++++++++++++++ |
11 |
dev-lang/mono/mono-5.10.0.179.ebuild | 4 + |
12 |
2 files changed, 110 insertions(+) |
13 |
|
14 |
diff --git a/dev-lang/mono/files/mono-5.10.0.179-ncurses61.patch b/dev-lang/mono/files/mono-5.10.0.179-ncurses61.patch |
15 |
new file mode 100644 |
16 |
index 0000000..93a1f8f |
17 |
--- /dev/null |
18 |
+++ b/dev-lang/mono/files/mono-5.10.0.179-ncurses61.patch |
19 |
@@ -0,0 +1,106 @@ |
20 |
+diff -Naur mono-5.10.0.179.orig/mcs/class/corlib/System/TermInfoReader.cs mono-5.10.0.179/mcs/class/corlib/System/TermInfoReader.cs |
21 |
+--- mono-5.10.0.179.orig/mcs/class/corlib/System/TermInfoReader.cs 2018-03-19 07:46:31.000000000 +0000 |
22 |
++++ mono-5.10.0.179/mcs/class/corlib/System/TermInfoReader.cs 2018-03-25 20:57:57.721279733 +0100 |
23 |
+@@ -72,16 +72,16 @@ |
24 |
+ // |
25 |
+ |
26 |
+ class TermInfoReader { |
27 |
+- //short nameSize; |
28 |
+- short boolSize; |
29 |
+- short numSize; |
30 |
+- short strOffsets; |
31 |
+- //short strSize; |
32 |
++ int boolSize; |
33 |
++ int numSize; |
34 |
++ int strOffsets; |
35 |
+ |
36 |
+ //string [] names; // Last one is the description |
37 |
+ byte [] buffer; |
38 |
+ int booleansOffset; |
39 |
+ //string term; |
40 |
++ |
41 |
++ int intOffset; |
42 |
+ |
43 |
+ public TermInfoReader (string term, string filename) |
44 |
+ { |
45 |
+@@ -114,12 +114,21 @@ |
46 |
+ // get { return term; } |
47 |
+ // } |
48 |
+ |
49 |
++ void DetermineVersion (short magic) |
50 |
++ { |
51 |
++ if (magic == 0x11a) |
52 |
++ intOffset = 2; |
53 |
++ else if (magic == 0x21e) |
54 |
++ intOffset = 4; |
55 |
++ else |
56 |
++ throw new Exception (String.Format ("Magic number is unexpected: {0}", magic)); |
57 |
++ } |
58 |
++ |
59 |
+ void ReadHeader (byte [] buffer, ref int position) |
60 |
+ { |
61 |
+ short magic = GetInt16 (buffer, position); |
62 |
+ position += 2; |
63 |
+- if (magic != 282) |
64 |
+- throw new Exception (String.Format ("Magic number is wrong: {0}", magic)); |
65 |
++ DetermineVersion (magic); |
66 |
+ |
67 |
+ /*nameSize =*/ GetInt16 (buffer, position); |
68 |
+ position += 2; |
69 |
+@@ -161,8 +170,8 @@ |
70 |
+ if ((offset % 2) == 1) |
71 |
+ offset++; |
72 |
+ |
73 |
+- offset += ((int) number) * 2; |
74 |
+- return GetInt16 (buffer, offset); |
75 |
++ offset += ((int) number) * intOffset; |
76 |
++ return GetInteger (buffer, offset); |
77 |
+ } |
78 |
+ |
79 |
+ public string Get (TermInfoStrings tstr) |
80 |
+@@ -175,7 +184,7 @@ |
81 |
+ if ((offset % 2) == 1) |
82 |
+ offset++; |
83 |
+ |
84 |
+- offset += numSize * 2; |
85 |
++ offset += numSize * intOffset; |
86 |
+ int off2 = GetInt16 (buffer, offset + (int) tstr * 2); |
87 |
+ if (off2 == -1) |
88 |
+ return null; |
89 |
+@@ -193,7 +202,7 @@ |
90 |
+ if ((offset % 2) == 1) |
91 |
+ offset++; |
92 |
+ |
93 |
+- offset += numSize * 2; |
94 |
++ offset += numSize * intOffset; |
95 |
+ int off2 = GetInt16 (buffer, offset + (int) tstr * 2); |
96 |
+ if (off2 == -1) |
97 |
+ return null; |
98 |
+@@ -211,6 +220,27 @@ |
99 |
+ return (short) (uno + dos * 256); |
100 |
+ } |
101 |
+ |
102 |
++ int GetInt32 (byte [] buffer, int offset) |
103 |
++ { |
104 |
++ int b1 = (int) buffer [offset]; |
105 |
++ int b2 = (int) buffer [offset + 1]; |
106 |
++ int b3 = (int) buffer [offset + 2]; |
107 |
++ int b4 = (int) buffer [offset + 3]; |
108 |
++ if (b1 == 255 && b2 == 255 && b3 == 255 && b4 == 255) |
109 |
++ return -1; |
110 |
++ |
111 |
++ return b1 + b2 << 8 + b3 << 16 + b4 << 24; |
112 |
++ } |
113 |
++ |
114 |
++ int GetInteger (byte [] buffer, int offset) |
115 |
++ { |
116 |
++ if (intOffset == 2) |
117 |
++ return GetInt16 (buffer, offset); |
118 |
++ else |
119 |
++ // intOffset == 4 |
120 |
++ return GetInt32 (buffer, offset); |
121 |
++ } |
122 |
++ |
123 |
+ string GetString (byte [] buffer, int offset) |
124 |
+ { |
125 |
+ int length = 0; |
126 |
|
127 |
diff --git a/dev-lang/mono/mono-5.10.0.179.ebuild b/dev-lang/mono/mono-5.10.0.179.ebuild |
128 |
index f25dd8d..f709724 100644 |
129 |
--- a/dev-lang/mono/mono-5.10.0.179.ebuild |
130 |
+++ b/dev-lang/mono/mono-5.10.0.179.ebuild |
131 |
@@ -32,8 +32,12 @@ DEPEND="${COMMONDEPEND} |
132 |
!dev-lang/mono-basic |
133 |
" |
134 |
|
135 |
+# Patch added for ncurses 6.1 |
136 |
+# https://github.com/mono/mono/issues/6752 |
137 |
+ |
138 |
PATCHES=( |
139 |
"${FILESDIR}"/${PN}-5.0.1.1-x86_32.patch |
140 |
+ "${FILESDIR}"/${PN}-5.10.0.179-ncurses61.patch |
141 |
) |
142 |
|
143 |
#S="${WORKDIR}/${PN}-$(get_version_component_range 1-3)" |