1 |
commit: a5cc83c1a83841b8a54e9501a12df6a04f73252b |
2 |
Author: ArsenShnurkov <Arsen.Shnurkov <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Sep 27 07:28:49 2016 +0000 |
4 |
Commit: Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 27 07:28:49 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=a5cc83c1 |
7 |
|
8 |
patch for AutoFac |
9 |
|
10 |
dev-dotnet/system-web/files/autofac.patch | 24 +++++ |
11 |
.../system-web/system-web-4.6.0.182-r1.ebuild | 108 +++++++++++++++++++++ |
12 |
2 files changed, 132 insertions(+) |
13 |
|
14 |
diff --git a/dev-dotnet/system-web/files/autofac.patch b/dev-dotnet/system-web/files/autofac.patch |
15 |
new file mode 100644 |
16 |
index 0000000..1983c1d |
17 |
--- /dev/null |
18 |
+++ b/dev-dotnet/system-web/files/autofac.patch |
19 |
@@ -0,0 +1,24 @@ |
20 |
+--- a/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs |
21 |
++++ b/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs |
22 |
+@@ -156,9 +156,18 @@ |
23 |
+ |
24 |
+ HttpContext context = HttpContext.Current; |
25 |
+ HttpRequest req = context == null ? null : context.Request; |
26 |
+- if (req == null) |
27 |
+- return null; |
28 |
+- |
29 |
++ if (req == null) // ADDED for Orchard |
30 |
++ { |
31 |
++ var pp = HostingEnvironment.ApplicationPhysicalPath; |
32 |
++ String vp=virtualPath; |
33 |
++ if (vp.IndexOf("~/") == 0) |
34 |
++ { |
35 |
++ vp = pp + virtualPath.Substring(2); |
36 |
++ } |
37 |
++ // TODO: if not "~/" ???? then what? |
38 |
++ return vp; |
39 |
++ } // END added for Orchard |
40 |
++ else |
41 |
+ return req.MapPath (virtualPath); |
42 |
+ } |
43 |
+ |
44 |
|
45 |
diff --git a/dev-dotnet/system-web/system-web-4.6.0.182-r1.ebuild b/dev-dotnet/system-web/system-web-4.6.0.182-r1.ebuild |
46 |
new file mode 100644 |
47 |
index 0000000..4bf29d9 |
48 |
--- /dev/null |
49 |
+++ b/dev-dotnet/system-web/system-web-4.6.0.182-r1.ebuild |
50 |
@@ -0,0 +1,108 @@ |
51 |
+# Copyright 1999-2016 Gentoo Foundation |
52 |
+# Distributed under the terms of the GNU General Public License v2 |
53 |
+# $Id$ |
54 |
+ |
55 |
+EAPI=6 |
56 |
+ |
57 |
+USE_DOTNET="net45" |
58 |
+inherit gac dotnet |
59 |
+IUSE+=" +net45 +pkg-config debug" |
60 |
+ |
61 |
+DESCRIPTION="Framework for developing web-applications" |
62 |
+HOMEPAGE="https://www.asp.net/" |
63 |
+SRC_URI="https://github.com/ArsenShnurkov/shnurise-tarballs/archive/dev-dotnet/system-web/system-web-4.6.0.182.tar.gz" |
64 |
+RESTRICT="mirror" |
65 |
+S="${WORKDIR}/shnurise-tarballs-${CATEGORY}-${PN}-${PN}-${PV}" |
66 |
+ |
67 |
+NAME=System.Web |
68 |
+ |
69 |
+LICENSE="Apache-2.0" |
70 |
+SLOT="0" |
71 |
+ |
72 |
+KEYWORDS="~amd64 ~x86" |
73 |
+ |
74 |
+# dependency on mono is included in dotnet.eclass which is inherited with nupkg.eclass (so no need to include >=dev-lang/mono-4.0.2.5 here) |
75 |
+# dependency on nuget is included in nupkg.eclass when USE="nupkg" is set |
76 |
+COMMONDEPEND=" |
77 |
+" |
78 |
+RDEPEND="${COMMONDEPEND} |
79 |
+" |
80 |
+DEPEND="${COMMONDEPEND} |
81 |
+" |
82 |
+ |
83 |
+CSPROJ=${NAME}.csproj |
84 |
+ |
85 |
+src_prepare() |
86 |
+{ |
87 |
+ sed -i 's/public const string FxVersion = "4.0.0.0";/public const string FxVersion = "'${PV}'";/g' "${S}/mcs/build/common/Consts.cs" || die |
88 |
+ sed "s/4.6.0.150/4.6.0.182/g" "${FILESDIR}/policy.4.0.System.Web.config" > "${S}/policy.4.0.System.Web.config" || die |
89 |
+ eapply "${FILESDIR}/add-system-diagnostics-namespace.patch" |
90 |
+ eapply "${FILESDIR}/autofac.patch" |
91 |
+ eapply_user |
92 |
+} |
93 |
+ |
94 |
+src_configure() |
95 |
+{ |
96 |
+ :; |
97 |
+} |
98 |
+ |
99 |
+KEYFILE1=${S}/mcs/class/msfinal.pub |
100 |
+KEYFILE2=${S}/mcs/class/mono.snk |
101 |
+ |
102 |
+src_compile() |
103 |
+{ |
104 |
+ # System.Web.dll |
105 |
+ exbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=${KEYFILE1} /p:DelaySign=true "${S}/mcs/class/${NAME}/${CSPROJ}" |
106 |
+ if use debug; then |
107 |
+ DIR="Debug" |
108 |
+ else |
109 |
+ DIR="Release" |
110 |
+ fi |
111 |
+ sn -R "${S}/mcs/class/${NAME}/obj/${DIR}/${NAME}.dll" ${KEYFILE2} || die |
112 |
+ |
113 |
+ # Policy file |
114 |
+ al "/link:${S}/policy.4.0.System.Web.config" "/out:${S}/policy.4.0.System.Web.dll" "/keyfile:${KEYFILE1}" /delaysign+ || die |
115 |
+ sn -R "${S}/policy.4.0.System.Web.dll" ${KEYFILE2} || die |
116 |
+} |
117 |
+ |
118 |
+src_install() |
119 |
+{ |
120 |
+ if use debug; then |
121 |
+ DIR="Debug" |
122 |
+ else |
123 |
+ DIR="Release" |
124 |
+ fi |
125 |
+ egacinstall "${S}/mcs/class/${NAME}/obj/${DIR}/${NAME}.dll" |
126 |
+ egacinstall "${S}/policy.4.0.System.Web.dll" |
127 |
+ install_pc_file "${PN}" "${NAME}.dll" |
128 |
+} |
129 |
+ |
130 |
+# The file format contains predefined metadata keywords and freeform variables (like ${prefix} and ${exec_prefix}) |
131 |
+# $1 = ${PN} |
132 |
+# $2 = myassembly.dll |
133 |
+install_pc_file() |
134 |
+{ |
135 |
+ if use pkg-config; then |
136 |
+ dodir /usr/$(get_libdir)/pkgconfig |
137 |
+ ebegin "Installing ${PC_FILE_NAME}.pc file" |
138 |
+ sed \ |
139 |
+ -e "s:@LIBDIR@:$(get_libdir):" \ |
140 |
+ -e "s:@PACKAGENAME@:$1:" \ |
141 |
+ -e "s:@DESCRIPTION@:${DESCRIPTION}:" \ |
142 |
+ -e "s:@VERSION@:${PV}:" \ |
143 |
+ -e 's*@LIBS@*-r:${libdir}'"/mono/$1/$2"'*' \ |
144 |
+ <<-EOF >"${D}/usr/$(get_libdir)/pkgconfig/$1.pc" || die |
145 |
+ prefix=\${pcfiledir}/../.. |
146 |
+ exec_prefix=\${prefix} |
147 |
+ libdir=\${exec_prefix}/@LIBDIR@ |
148 |
+ Name: @PACKAGENAME@ |
149 |
+ Description: @DESCRIPTION@ |
150 |
+ Version: @VERSION@ |
151 |
+ Libs: @LIBS@ |
152 |
+ EOF |
153 |
+ |
154 |
+ einfo PKG_CONFIG_PATH="${D}/usr/$(get_libdir)/pkgconfig/" pkg-config --exists "$1" |
155 |
+ PKG_CONFIG_PATH="${D}/usr/$(get_libdir)/pkgconfig/" pkg-config --exists "$1" || die ".pc file failed to validate." |
156 |
+ eend $? |
157 |
+ fi |
158 |
+} |