dev-libs/botan: ppc stable wrt bug #574034
[gentoo.git] / dev-lang / mono / mono-2.10.9-r2.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="4"
6
7 inherit linux-info mono eutils flag-o-matic multilib go-mono pax-utils
8
9 DESCRIPTION="Mono runtime and class libraries, a C# compiler/interpreter"
10 HOMEPAGE="http://www.mono-project.com/Main_Page"
11
12 LICENSE="MIT LGPL-2.1 GPL-2 BSD-4 NPL-1.1 Ms-PL GPL-2-with-linking-exception IDPL"
13 SLOT="0"
14 KEYWORDS="amd64 ppc ~ppc64 x86"
15
16 IUSE="minimal pax_kernel xen"
17
18 #Bash requirement is for += operator
19 COMMONDEPEND="!dev-util/monodoc
20         !minimal? ( =dev-dotnet/libgdiplus-${GO_MONO_REL_PV}* )
21         ia64? ( sys-libs/libunwind )"
22 RDEPEND="${COMMONDEPEND}
23         || ( www-client/links www-client/lynx )"
24
25 DEPEND="${COMMONDEPEND}
26         sys-devel/bc
27         virtual/yacc
28         >=app-shells/bash-3.2
29         pax_kernel? ( sys-apps/elfix )"
30
31 MAKEOPTS="${MAKEOPTS} -j1"
32
33 RESTRICT="test"
34
35 pkg_setup() {
36         if use kernel_linux
37         then
38                 get_version
39                 if linux_config_exists
40                 then
41                         if linux_chkconfig_present SYSVIPC
42                         then
43                                 einfo "CONFIG_SYSVIPC is set, looking good."
44                         else
45                                 eerror "If CONFIG_SYSVIPC is not set in your kernel .config, mono will hang while compiling."
46                                 eerror "See https://bugs.gentoo.org/261869 for more info."
47                                 eerror "Please set CONFIG_SYSVIPC in your kernel .config if build fails."
48                         fi
49                 else
50                         ewarn "Was unable to determine your kernel .config"
51                         ewarn "Please note that if CONFIG_SYSVIPC is not set in your kernel .config, mono will hang while compiling."
52                         ewarn "See https://bugs.gentoo.org/261869 for more info."
53                 fi
54         fi
55         PATCHES=( "${FILESDIR}/${PN}-2.10.2-threads-access.patch"
56                 "${FILESDIR}/${PN}-2.10.9-CVE-2012-3382.patch"
57                 "${FILESDIR}/${PN}-2.10.9-CVE-2012-3543.patch"
58                 "${FILESDIR}/${PN}-2.10.9-CVE-2012-3543_2.patch" )
59 }
60
61 src_prepare() {
62         go-mono_src_prepare
63
64         # we need to sed in the paxctl-ng -mr in the runtime/mono-wrapper.in so it doesn't
65         # get killed in the build process when MPROTECT is enabled. #286280
66         # RANDMMAP kills the build process to #347365
67         # use paxmark.sh to get PT/XT logic #532244
68         if use pax_kernel ; then
69                 ewarn "We are disabling MPROTECT on the mono binary."
70                 sed '/exec "/ i\paxmark.sh -mr "$r/@mono_runtime@"' -i "${S}"/runtime/mono-wrapper.in || die "Failed to sed mono-wrapper.in"
71         fi
72 }
73
74 src_configure() {
75         # mono's build system is finiky, strip the flags
76         strip-flags
77
78         # Remove this at your own peril. Mono will barf in unexpected ways.
79         append-flags -fno-strict-aliasing
80
81         # NOTE: We need the static libs for now so mono-debugger works.
82         # See https://bugs.gentoo.org/show_bug.cgi?id=256264 for details
83         #
84         # --without-moonlight since www-plugins/moonlight is not the only one
85         # using mono: https://bugzilla.novell.com/show_bug.cgi?id=641005#c3
86         #
87         # --with-profile4 needs to be always enabled since it's used by default
88         # and, otherwise, problems like bug #340641 appear.
89         #
90         # sgen fails on ppc, bug #359515
91
92         local myconf=""
93         use ppc && myconf="${myconf} --with-sgen=no"
94         go-mono_src_configure \
95                 --enable-static \
96                 --disable-quiet-build \
97                 --without-moonlight \
98                 --with-libgdiplus=$(use minimal && printf "no" || printf "installed" ) \
99                 $(use_with xen xen_opt) \
100                 --without-ikvm-native \
101                 --with-jit \
102                 --disable-dtrace \
103                 --with-profile4 \
104                 ${myconf}
105 }
106
107 src_test() {
108         echo ">>> Test phase [check]: ${CATEGORY}/${PF}"
109
110         export MONO_REGISTRY_PATH="${T}/registry"
111         export XDG_DATA_HOME="${T}/data"
112         export MONO_SHARED_DIR="${T}/shared"
113         export XDG_CONFIG_HOME="${T}/config"
114         export HOME="${T}/home"
115
116         emake -j1 check
117 }
118
119 src_install() {
120         go-mono_src_install
121
122         # Remove files not respecting LDFLAGS and that we are not supposed to provide, see Fedora
123         # mono.spec and http://www.mail-archive.com/mono-devel-list@lists.ximian.com/msg24870.html
124         # for reference.
125         rm -f "${ED}"/usr/$(get_libdir)/mono/2.0/mscorlib.dll.so
126         rm -f "${ED}"/usr/$(get_libdir)/mono/2.0/mcs.exe.so
127 }
128
129 #THINK!!!! Before touching postrm and postinst
130 #Reference phase order:
131 #pkg_preinst
132 #pkg_prerm
133 #pkg_postrm
134 #pkg_postinst
135
136 pkg_preinst() {
137         local symlink
138         local NUNIT_DIR="/usr/$(get_libdir)/mono/nunit"
139         local pv_atom
140         if  [[ "$(readlink "${ROOT}"/${NUNIT_DIR})" == *"mono-nunit"* ]]
141         then
142                 for pv_atom in 2.2{,-r1,-r2,-r3,-r4} '2.4_pre*' '2.4_rc*' 2.4
143                 do
144                         if has_version "=dev-lang/mono-${pv_atom}"
145                         then
146                                 einfo "If you just received a file collision warning message,"
147                                 einfo "be advised that this is a known problem, which will now be fixed:"
148                                 ebegin "Found broken symlinks created by $(best_version dev-lang/mono), fixing"
149                                 for symlink in                                          \
150                                         "${ROOT}/${NUNIT_DIR}"                          \
151                                         "${ROOT}/usr/$(get_libdir)/pkgconfig/nunit.pc"  \
152                                         "${ROOT}/usr/bin/nunit-console"                 \
153                                         "${ROOT}/usr/bin/nunit-console2"
154                                 do
155                                         if [[ -L "${symlink}" ]]
156                                         then
157                                                 rm -f "${symlink}" &> /dev/null
158                                         fi
159                                 done
160                                 eend 0
161                                 break
162                         fi
163                 done
164         fi
165 }
166
167 #pkg_postinst() {
168 #       elog "PLEASE TAKE NOTE!"
169 #       elog ""
170 #       elog "Some of the namespaces supported by Mono require extra packages to be installed."
171 #       elog "Below is a list of namespaces and the corresponding package you must install:"
172 #       elog ""
173 #       elog ">=x11-libs/cairo-1.6.4"
174 #       elog "  Mono.Cairo"
175 #       elog "Also read:"
176 #       elog "http://www.mono-project.com/Mono.Cairo"
177 #       elog ""
178 #       elog ">=dev-db/firebird-2.0.4.13130.1"
179 #       elog "  FirebirdSql.Data.Firebird"
180 #       elog "Also read:"
181 #       elog "http://www.mono-project.com/Firebird_Interbase"
182 #       elog ""
183 #       elog "dev-db/sqlite:3"
184 #       elog "  Mono.Data.Sqlite"
185 #       elog "Also read:"
186 #       elog "http://www.mono-project.com/SQLite"
187 #       elog ""
188 #       elog ">=dev-db/oracle-instantclient-basic-10.2"
189 #       elog "  System.Data.OracleClient"
190 #       elog "Also read:"
191 #       elog "http://www.mono-project.com/Oracle"
192 #       elog ""
193 #       elog "Mono also has support for packages that are not included in portage:"
194 #       elog ""
195 #       elog "No ebuild available:"
196 #       elog "  IBM.Data.DB2"
197 #       elog "Also read: http://www.mono-project.com/IBM_DB2"
198 #       elog ""
199 #       elog "No ebuild needed:"
200 #       elog "  Mono.Data.SybaseClient"
201 #       elog "Also read: http://www.mono-project.com/Sybase"
202 #}
203
204 # NOTICE: THE COPYRIGHT FILES IN THE TARBALL ARE UNCLEAR!
205 # WHENEVER YOU THINK SOMETHING IS GPL-2+, IT'S ONLY GPL-2
206 # UNLESS MIGUEL DE ICAZA HIMSELF SAYS OTHERWISE.
207
208 # mono
209 # The code we use is LGPL, but contributions must be made under the MIT/X11
210 # license, so Novell can serve its paying customers. Exception is mono/man.
211 # LICENSE="LGPL-2.1"
212
213         # mono/man
214         # LICENSE="MIT"
215
216 # mcs/mcs
217 # mcs/gmcs
218 # LICENSE="GPL-2 MIT"
219
220 # tests
221 # LICENSE="MIT"
222
223 # mcs/class
224 # Except the listed exceptions:
225 # LICENSE="MIT"
226
227         # mcs/class/ByteFX.Data
228         # mcs/class/Npgsql
229         # LICENSE="LGPL-2.1"
230
231         # mcs/class/FirebirdSql.Data.Firebird
232         # LICENSE="IDPL"
233
234         # mcs/class/ICSharpCode.SharpZipLib
235         # LICENSE="GPL-2-with-linking-exception"
236
237         # mcs/class/MicrosoftAjaxLibrary
238         # LICENSE="Ms-Pl"
239
240         # mcs/class/Microsoft.JScript/Microsoft.JScript/TokenStream.cs
241         # mcs/class/Microsoft.JScript/Microsoft.JScript/Token.cs
242         # mcs/class/Microsoft.JScript/Microsoft.JScript/Parser.cs
243         # mcs/class/Microsoft.JScript/Microsoft.JScript/Decompiler.cs
244         # LICENSE="|| ( NPL-1.1 GPL-2 )"
245
246 # mcs/jay
247 # LICENSE="BSD-4"
248
249 # mcs/tools
250 # Except the listed exceptions:
251 # LICENSE="MIT"
252
253         # mcs/tools/mdoc/Mono.Documentation/monodocs2html.cs
254         # LICENSE="GPL-2"
255
256         # mcs/tools/sqlsharp/SqlSharpCli.cs
257         # LICENSE="GPL-2"
258
259         # mcs/tools/csharp/repl.cs
260         # LICENSE="|| ( MIT GPL-2 )"
261
262         # mcs/tools/mono-win32-setup.nsi
263         # LICENSE="GPL-2"
264
265 # samples
266 # LICENSE="MIT"