1 |
commit: d87c297e46e25d032b4fed630429d28f663f0028 |
2 |
Author: Ben Sagal <bsagal <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Jul 13 08:00:07 2016 +0000 |
4 |
Commit: Heather Cynede <cynede <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 13 08:06:43 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=d87c297e |
7 |
|
8 |
Add dev-dotnet/dotnet-cli (bug #148) |
9 |
|
10 |
.../dotnet-cli-1.0.0_pre2_p003121.ebuild | 125 +++++++++++++++++++++ |
11 |
.../coreclr-1.0.0-gcc6-github-pull-5304.patch | 28 +++++ |
12 |
.../files/coreclr-1.0.0-icu57-commit-352df35.patch | 42 +++++++ |
13 |
.../coreclr-1.0.0-segv-github-pull-6027.patch | 59 ++++++++++ |
14 |
dev-dotnet/dotnet-cli/metadata.xml | 8 ++ |
15 |
5 files changed, 262 insertions(+) |
16 |
|
17 |
diff --git a/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003121.ebuild b/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003121.ebuild |
18 |
new file mode 100644 |
19 |
index 0000000..0211db9 |
20 |
--- /dev/null |
21 |
+++ b/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003121.ebuild |
22 |
@@ -0,0 +1,125 @@ |
23 |
+# Copyright 1999-2016 Gentoo Foundation |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+# $Id$ |
26 |
+ |
27 |
+#BASED ON https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=dotnet-cli |
28 |
+ |
29 |
+EAPI="6" |
30 |
+ |
31 |
+BASE_PV=${PV%_p*} |
32 |
+P_BUILD=${PV##*_p} |
33 |
+DIST='debian-x64' |
34 |
+ |
35 |
+MY_BASE_PV=${BASE_PV/_pre/-preview} |
36 |
+ |
37 |
+MY_PV=${MY_BASE_PV}-${P_BUILD} |
38 |
+MY_P=${PN}-${MY_PV} |
39 |
+ |
40 |
+CORE_V=${PV%%_*} |
41 |
+ |
42 |
+CORECLR_N=coreclr-${CORE_V} |
43 |
+COREFX_N=corefx-${CORE_V} |
44 |
+ |
45 |
+DESCRIPTION="A command line utility for building, testing, packaging and running .NET Core applications and libraries" |
46 |
+HOMEPAGE="https://www.microsoft.com/net/core" |
47 |
+LICENSE="MIT" |
48 |
+ |
49 |
+IUSE="" |
50 |
+SRC_URI="https://github.com/dotnet/coreclr/archive/v${CORE_V}.tar.gz -> ${CORECLR_N}.tar.gz |
51 |
+ https://github.com/dotnet/corefx/archive/v${CORE_V}.tar.gz -> ${COREFX_N}.tar.gz |
52 |
+ https://download.microsoft.com/download/1/5/2/1523EBE1-3764-4328-8961-D1BD8ECA9295/dotnet-dev-${DIST}.${MY_PV}.tar.gz" |
53 |
+ |
54 |
+SLOT="0" |
55 |
+KEYWORDS="~amd64" |
56 |
+ |
57 |
+RDEPEND=" |
58 |
+ >=sys-devel/llvm-3.7.1-r3[lldb] |
59 |
+ >=sys-libs/libunwind-1.1-r1 |
60 |
+ >=dev-libs/icu-57.1 |
61 |
+ >=dev-util/lttng-ust-2.8.1 |
62 |
+ >=dev-libs/openssl-1.0.2h-r2 |
63 |
+ >=net-misc/curl-7.49.0" |
64 |
+DEPEND="${RDEPEND} |
65 |
+ >=dev-util/cmake-3.3.1-r1 |
66 |
+ >=sys-devel/make-4.1-r1 |
67 |
+ >=sys-devel/clang-3.7.1-r100 |
68 |
+ >=sys-devel/gettext-0.19.7" |
69 |
+ |
70 |
+PATCHES=( |
71 |
+ "${FILESDIR}/${CORECLR_N}-icu57-commit-352df35.patch" |
72 |
+ "${FILESDIR}/${CORECLR_N}-gcc6-github-pull-5304.patch" |
73 |
+ "${FILESDIR}/${CORECLR_N}-segv-github-pull-6027.patch" |
74 |
+) |
75 |
+ |
76 |
+S=${WORKDIR} |
77 |
+CLI_S="${S}/dotnet_cli" |
78 |
+CORECLR_S="${S}/${CORECLR_N}" |
79 |
+COREFX_S="${S}/${COREFX_N}" |
80 |
+ |
81 |
+CORECLR_FILES=( |
82 |
+ 'libclrjit.so' |
83 |
+ 'libcoreclr.so' |
84 |
+ 'libcoreclrtraceptprovider.so' |
85 |
+ 'libdbgshim.so' |
86 |
+ 'libmscordaccore.so' |
87 |
+ 'libmscordbi.so' |
88 |
+ 'libsos.so' |
89 |
+ 'libsosplugin.so' |
90 |
+ 'System.Globalization.Native.so' |
91 |
+) |
92 |
+ |
93 |
+COREFX_FILES=( |
94 |
+ 'System.IO.Compression.Native.so' |
95 |
+ 'System.Native.a' |
96 |
+ 'System.Native.so' |
97 |
+ 'System.Net.Http.Native.so' |
98 |
+ 'System.Net.Security.Native.so' |
99 |
+ 'System.Security.Cryptography.Native.so' |
100 |
+) |
101 |
+ |
102 |
+src_unpack() { |
103 |
+ unpack "${CORECLR_N}.tar.gz" "${COREFX_N}.tar.gz" |
104 |
+ mkdir "${CLI_S}" || die |
105 |
+ cd "${CLI_S}" || die |
106 |
+ unpack "dotnet-dev-${DIST}.${MY_PV}.tar.gz" |
107 |
+} |
108 |
+ |
109 |
+src_prepare() { |
110 |
+ for file in "${CORECLR_FILES[@]}"; do |
111 |
+ rm "${CLI_S}/shared/Microsoft.NETCore.App/${CORE_V}/${file}" |
112 |
+ done |
113 |
+ for file in "${COREFX_FILES[@]}"; do |
114 |
+ rm "${CLI_S}/shared/Microsoft.NETCore.App/${CORE_V}/${file}" |
115 |
+ done |
116 |
+ default_src_prepare |
117 |
+} |
118 |
+ |
119 |
+src_compile() { |
120 |
+ cd "${S}/${CORECLR_N}" || die |
121 |
+ ./build.sh x64 release || die |
122 |
+ |
123 |
+ cd "${S}/${COREFX_N}" || die |
124 |
+ ./build.sh native x64 release || die |
125 |
+} |
126 |
+ |
127 |
+ |
128 |
+src_install() { |
129 |
+ |
130 |
+ local dest="/opt/dotnet_cli" |
131 |
+ local ddest="${D}/${dest}" |
132 |
+ local ddest_core="${ddest}/shared/Microsoft.NETCore.App/${CORE_V}/" |
133 |
+ |
134 |
+ dodir "${dest}" |
135 |
+ cp -pPR "${CLI_S}"/* "${ddest}" || die |
136 |
+ |
137 |
+ for file in "${CORECLR_FILES[@]}"; do |
138 |
+ cp -pP "${CORECLR_S}/bin/Product/Linux.x64.Release/${file}" "${ddest_core}" || die |
139 |
+ done |
140 |
+ |
141 |
+ for file in "${COREFX_FILES[@]}"; do |
142 |
+ cp -pP "${COREFX_N}/bin/Linux.x64.Release/Native/${file}" "${ddest_core}" || die |
143 |
+ done |
144 |
+ |
145 |
+ dosym "../../opt/dotnet_cli/dotnet" "/usr/bin/dotnet" |
146 |
+ |
147 |
+} |
148 |
|
149 |
diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-gcc6-github-pull-5304.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-gcc6-github-pull-5304.patch |
150 |
new file mode 100644 |
151 |
index 0000000..872c539 |
152 |
--- /dev/null |
153 |
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-gcc6-github-pull-5304.patch |
154 |
@@ -0,0 +1,28 @@ |
155 |
+From 41912e3adb789b62f4cb46acffe915b6f1ab0e1e Mon Sep 17 00:00:00 2001 |
156 |
+From: =?UTF-8?q?J=C3=BCrgen=20H=C3=B6tzel?= <juergen@×××××××.info> |
157 |
+Date: Mon, 30 May 2016 11:45:49 +0200 |
158 |
+Subject: [PATCH] Don't use libstdc++ wrappers for stdlib.h (#5304) |
159 |
+ |
160 |
+This prevents #undef of min/max macros. Refs #5006. |
161 |
+--- |
162 |
+ src/pal/src/include/pal/palinternal.h | 4 ++++ |
163 |
+ 1 file changed, 4 insertions(+) |
164 |
+ |
165 |
+diff --git a/src/pal/src/include/pal/palinternal.h b/src/pal/src/include/pal/palinternal.h |
166 |
+index 4c01be8..fdebc8d 100644 |
167 |
+--- a/coreclr-1.0.0/src/pal/src/include/pal/palinternal.h |
168 |
++++ b/coreclr-1.0.0/src/pal/src/include/pal/palinternal.h |
169 |
+@@ -567,6 +567,10 @@ function_name() to call the system's implementation |
170 |
+ #endif |
171 |
+ #include <ctype.h> |
172 |
+ |
173 |
++// Don't use C++ wrappers for stdlib.h |
174 |
++// https://gcc.gnu.org/ml/libstdc++/2016-01/msg00025.html |
175 |
++#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS 1 |
176 |
++ |
177 |
+ #define _WITH_GETLINE |
178 |
+ #include <stdio.h> |
179 |
+ #include <stdlib.h> |
180 |
+-- |
181 |
+2.9.0 |
182 |
+ |
183 |
|
184 |
diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-icu57-commit-352df35.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-icu57-commit-352df35.patch |
185 |
new file mode 100644 |
186 |
index 0000000..d16369c |
187 |
--- /dev/null |
188 |
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-icu57-commit-352df35.patch |
189 |
@@ -0,0 +1,42 @@ |
190 |
+From 352df35c124104586ee4c977556cb50ce720af62 Mon Sep 17 00:00:00 2001 |
191 |
+From: Peter Jas <necmon@×××××.com> |
192 |
+Date: Mon, 30 May 2016 12:54:02 +0300 |
193 |
+Subject: [PATCH] Fix ucol_setMaxVariable detection for Gentoo Linux (#5309) |
194 |
+ |
195 |
+The issue was the symbol is exported by the ICU lib. Including headers |
196 |
+was not enough. The linker requires the libraries to succeed. |
197 |
+ |
198 |
+With this fix, CoreCLR successfully builds on Gentoo Linux 100%. |
199 |
+Tested with LXC gentoo container on Ubuntu machine. |
200 |
+ |
201 |
+Steps to configure and build: |
202 |
+https://gist.github.com/jasonwilliams200OK/1a2e2c0e904ffa95faf6333fcd88d9b8 |
203 |
+ |
204 |
+Fix #5160 |
205 |
+--- |
206 |
+ src/corefx/System.Globalization.Native/configure.cmake | 7 +++++++ |
207 |
+ 1 file changed, 7 insertions(+) |
208 |
+ |
209 |
+diff --git a/src/corefx/System.Globalization.Native/configure.cmake b/src/corefx/System.Globalization.Native/configure.cmake |
210 |
+index 4250c7c..138127e 100644 |
211 |
+--- a/coreclr-1.0.0/src/corefx/System.Globalization.Native/configure.cmake |
212 |
++++ b/coreclr-1.0.0/src/corefx/System.Globalization.Native/configure.cmake |
213 |
+@@ -8,11 +8,18 @@ CHECK_CXX_SOURCE_COMPILES(" |
214 |
+ int main() { UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; } |
215 |
+ " HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS) |
216 |
+ |
217 |
++if(NOT CLR_CMAKE_PLATFORM_DARWIN) |
218 |
++ set(CMAKE_REQUIRED_LIBRARIES ${ICUUC} ${ICUI18N}) |
219 |
++else() |
220 |
++ set(CMAKE_REQUIRED_LIBRARIES ${ICUCORE}) |
221 |
++endif() |
222 |
++ |
223 |
+ check_symbol_exists( |
224 |
+ ucol_setMaxVariable |
225 |
+ "unicode/ucol.h" |
226 |
+ HAVE_SET_MAX_VARIABLE) |
227 |
+ |
228 |
++unset(CMAKE_REQUIRED_LIBRARIES) |
229 |
+ unset(CMAKE_REQUIRED_INCLUDES) |
230 |
+ |
231 |
+ configure_file( |
232 |
|
233 |
diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-segv-github-pull-6027.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-segv-github-pull-6027.patch |
234 |
new file mode 100644 |
235 |
index 0000000..5d07157 |
236 |
--- /dev/null |
237 |
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-segv-github-pull-6027.patch |
238 |
@@ -0,0 +1,59 @@ |
239 |
+From 56ab756b0e9afef24cf9151a4a43f23e8d78de29 Mon Sep 17 00:00:00 2001 |
240 |
+From: Jan Vorlicek <janvorli@×××××××××.com> |
241 |
+Date: Tue, 28 Jun 2016 21:34:04 +0200 |
242 |
+Subject: [PATCH] Fix Windows context to Unix context translation on AMD64 |
243 |
+ (#6027) |
244 |
+ |
245 |
+There was a bug in the context translation between the Windows context |
246 |
+and Unix context on AMD64 caused by the fact that the Unix context |
247 |
+gregs array contains CS, GS and FS in a single field (REG_CSGSFS) and |
248 |
+the MCREG_SegCs accessor macro was incorrectly written to use the |
249 |
+whole field as CS. So writing the CS into the Unix context also |
250 |
+cleared the GS, FS and the topmost 16 bits described as padding. |
251 |
+This issue was exposed on the Linux kernel >= 4.6.0 where the padding |
252 |
+for some reason was not zero, probably used by the kernel for some |
253 |
+internal purposes. |
254 |
+I have fixed it by changing the accessor to modify only the 16 bits |
255 |
+corresponding to the CS. |
256 |
+I have also changed the code in the inject_activation_handler to |
257 |
+save cycles and not to copy the Windows context back to the Unix one |
258 |
+in case the activation function was not called and so the context |
259 |
+was not possibly changed. |
260 |
+--- |
261 |
+ src/pal/src/exception/signal.cpp | 5 ++--- |
262 |
+ src/pal/src/include/pal/context.h | 2 +- |
263 |
+ 2 files changed, 3 insertions(+), 4 deletions(-) |
264 |
+ |
265 |
+diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp |
266 |
+index dc26ee4..adeada1 100644 |
267 |
+--- a/coreclr-1.0.0/src/pal/src/exception/signal.cpp |
268 |
++++ b/coreclr-1.0.0/src/pal/src/exception/signal.cpp |
269 |
+@@ -464,10 +464,9 @@ static void inject_activation_handler(int code, siginfo_t *siginfo, void *contex |
270 |
+ if (g_safeActivationCheckFunction(CONTEXTGetPC(&winContext), /* checkingCurrentThread */ TRUE)) |
271 |
+ { |
272 |
+ g_activationFunction(&winContext); |
273 |
++ // Activation function may have modified the context, so update it. |
274 |
++ CONTEXTToNativeContext(&winContext, ucontext); |
275 |
+ } |
276 |
+- |
277 |
+- // Activation function may have modified the context, so update it. |
278 |
+- CONTEXTToNativeContext(&winContext, ucontext); |
279 |
+ } |
280 |
+ else if (g_previous_activation.sa_sigaction != NULL) |
281 |
+ { |
282 |
+diff --git a/src/pal/src/include/pal/context.h b/src/pal/src/include/pal/context.h |
283 |
+index 7591703..6f1b3fe 100644 |
284 |
+--- a/coreclr-1.0.0/src/pal/src/include/pal/context.h |
285 |
++++ b/coreclr-1.0.0/src/pal/src/include/pal/context.h |
286 |
+@@ -111,7 +111,7 @@ typedef ucontext_t native_context_t; |
287 |
+ #define MCREG_Rax(mc) ((mc).gregs[REG_RAX]) |
288 |
+ #define MCREG_Rip(mc) ((mc).gregs[REG_RIP]) |
289 |
+ #define MCREG_Rsp(mc) ((mc).gregs[REG_RSP]) |
290 |
+-#define MCREG_SegCs(mc) ((mc).gregs[REG_CSGSFS]) |
291 |
++#define MCREG_SegCs(mc) (*(WORD*)&((mc).gregs[REG_CSGSFS])) |
292 |
+ #define MCREG_R8(mc) ((mc).gregs[REG_R8]) |
293 |
+ #define MCREG_R9(mc) ((mc).gregs[REG_R9]) |
294 |
+ #define MCREG_R10(mc) ((mc).gregs[REG_R10]) |
295 |
+-- |
296 |
+2.9.0 |
297 |
+ |
298 |
|
299 |
diff --git a/dev-dotnet/dotnet-cli/metadata.xml b/dev-dotnet/dotnet-cli/metadata.xml |
300 |
new file mode 100644 |
301 |
index 0000000..b1262f1 |
302 |
--- /dev/null |
303 |
+++ b/dev-dotnet/dotnet-cli/metadata.xml |
304 |
@@ -0,0 +1,8 @@ |
305 |
+<?xml version="1.0" encoding="UTF-8"?> |
306 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
307 |
+<pkgmetadata> |
308 |
+ <maintainer type="project"> |
309 |
+ <email>dotnet@g.o</email> |
310 |
+ <description>Gentoo Dotnet Project</description> |
311 |
+ </maintainer> |
312 |
+</pkgmetadata> |