1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit linux-info mono eutils flag-o-matic multilib go-mono pax-utils
9 DESCRIPTION="Mono runtime and class libraries, a C# compiler/interpreter"
10 HOMEPAGE="http://www.mono-project.com/Main_Page"
12 LICENSE="MIT LGPL-2.1 GPL-2 BSD-4 NPL-1.1 Ms-PL GPL-2-with-linking-exception IDPL"
14 KEYWORDS="amd64 ppc ~ppc64 x86"
16 IUSE="minimal pax_kernel xen"
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 )"
25 DEPEND="${COMMONDEPEND}
29 pax_kernel? ( sys-apps/elfix )"
31 MAKEOPTS="${MAKEOPTS} -j1"
39 if linux_config_exists
41 if linux_chkconfig_present SYSVIPC
43 einfo "CONFIG_SYSVIPC is set, looking good."
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."
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."
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" )
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"
75 # mono's build system is finiky, strip the flags
78 # Remove this at your own peril. Mono will barf in unexpected ways.
79 append-flags -fno-strict-aliasing
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
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
87 # --with-profile4 needs to be always enabled since it's used by default
88 # and, otherwise, problems like bug #340641 appear.
90 # sgen fails on ppc, bug #359515
93 use ppc && myconf="${myconf} --with-sgen=no"
94 go-mono_src_configure \
96 --disable-quiet-build \
98 --with-libgdiplus=$(use minimal && printf "no" || printf "installed" ) \
99 $(use_with xen xen_opt) \
100 --without-ikvm-native \
108 echo ">>> Test phase [check]: ${CATEGORY}/${PF}"
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"
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
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
129 #THINK!!!! Before touching postrm and postinst
130 #Reference phase order:
138 local NUNIT_DIR="/usr/$(get_libdir)/mono/nunit"
140 if [[ "$(readlink "${ROOT}"/${NUNIT_DIR})" == *"mono-nunit"* ]]
142 for pv_atom in 2.2{,-r1,-r2,-r3,-r4} '2.4_pre*' '2.4_rc*' 2.4
144 if has_version "=dev-lang/mono-${pv_atom}"
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"
150 "${ROOT}/${NUNIT_DIR}" \
151 "${ROOT}/usr/$(get_libdir)/pkgconfig/nunit.pc" \
152 "${ROOT}/usr/bin/nunit-console" \
153 "${ROOT}/usr/bin/nunit-console2"
155 if [[ -L "${symlink}" ]]
157 rm -f "${symlink}" &> /dev/null
168 # elog "PLEASE TAKE NOTE!"
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:"
173 # elog ">=x11-libs/cairo-1.6.4"
176 # elog "http://www.mono-project.com/Mono.Cairo"
178 # elog ">=dev-db/firebird-2.0.4.13130.1"
179 # elog " FirebirdSql.Data.Firebird"
181 # elog "http://www.mono-project.com/Firebird_Interbase"
183 # elog "dev-db/sqlite:3"
184 # elog " Mono.Data.Sqlite"
186 # elog "http://www.mono-project.com/SQLite"
188 # elog ">=dev-db/oracle-instantclient-basic-10.2"
189 # elog " System.Data.OracleClient"
191 # elog "http://www.mono-project.com/Oracle"
193 # elog "Mono also has support for packages that are not included in portage:"
195 # elog "No ebuild available:"
196 # elog " IBM.Data.DB2"
197 # elog "Also read: http://www.mono-project.com/IBM_DB2"
199 # elog "No ebuild needed:"
200 # elog " Mono.Data.SybaseClient"
201 # elog "Also read: http://www.mono-project.com/Sybase"
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.
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.
218 # LICENSE="GPL-2 MIT"
224 # Except the listed exceptions:
227 # mcs/class/ByteFX.Data
231 # mcs/class/FirebirdSql.Data.Firebird
234 # mcs/class/ICSharpCode.SharpZipLib
235 # LICENSE="GPL-2-with-linking-exception"
237 # mcs/class/MicrosoftAjaxLibrary
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 )"
250 # Except the listed exceptions:
253 # mcs/tools/mdoc/Mono.Documentation/monodocs2html.cs
256 # mcs/tools/sqlsharp/SqlSharpCli.cs
259 # mcs/tools/csharp/repl.cs
260 # LICENSE="|| ( MIT GPL-2 )"
262 # mcs/tools/mono-win32-setup.nsi