1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 AUTOTOOLS_PRUNE_LIBTOOL_FILES="all"
9 inherit eutils linux-info mono-env flag-o-matic pax-utils autotools-utils versionator
11 DESCRIPTION="Mono runtime and class libraries, a C# compiler/interpreter"
12 HOMEPAGE="http://www.mono-project.com/Main_Page"
13 SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.bz2"
15 LICENSE="MIT LGPL-2.1 GPL-2 BSD-4 NPL-1.1 Ms-PL GPL-2-with-linking-exception IDPL"
18 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux"
20 IUSE="nls minimal pax_kernel xen doc"
23 !minimal? ( >=dev-dotnet/libgdiplus-2.10 )
24 ia64? ( sys-libs/libunwind )
25 nls? ( sys-devel/gettext )
27 RDEPEND="${COMMONDEPEND}
28 || ( www-client/links www-client/lynx )
30 DEPEND="${COMMONDEPEND}
33 pax_kernel? ( sys-apps/elfix )
37 MAKEOPTS="${MAKEOPTS} -j1" #nowarn
38 S="${WORKDIR}/${PN}-$(get_version_component_range 1-3)"
41 # If CONFIG_SYSVIPC is not set in your kernel .config, mono will hang while compiling.
42 # See http://bugs.gentoo.org/261869 for more info."
43 CONFIG_CHECK="SYSVIPC"
44 use kernel_linux && check_extra_config
53 # we need to sed in the paxctl-ng -mr in the runtime/mono-wrapper.in so it don't
54 # get killed in the build proces when MPROTECT is enable. #286280
55 # RANDMMAP kill the build proces to #347365
56 # use paxmark.sh to get PT/XT logic #532244
57 if use pax_kernel ; then
58 ewarn "We are disabling MPROTECT on the mono binary."
60 # issue 9 : https://github.com/Heather/gentoo-dotnet/issues/9
61 sed '/exec "/ i\paxmark.sh -mr "$r/@mono_runtime@"' -i "${S}"/runtime/mono-wrapper.in || die "Failed to sed mono-wrapper.in"
64 # mono build system can fail otherwise
68 # http://osdir.com/ml/general/2015-05/msg20808.html
69 epatch "${FILESDIR}/add_missing_vb_portable_targets.patch"
71 # Fix build when sgen disabled
72 # https://bugzilla.xamarin.com/show_bug.cgi?id=32015
73 epatch "${FILESDIR}/${PN}-4.0.2.5-fix-mono-dis-makefile-am-when-without-sgen.patch"
75 # Fix atomic_add_i4 support for 32-bit ppc
76 # https://github.com/mono/mono/compare/f967c79926900343f399c75624deedaba460e544^...8f379f0c8f98493180b508b9e68b9aa76c0c5bdf
77 epatch "${FILESDIR}/${PN}-4.0.2.5-fix-ppc-atomic-add-i4.patch"
79 epatch "${FILESDIR}/systemweb3.patch"
80 epatch "${FILESDIR}/fix-for-GitExtensions-issue-2710-another-resolution.patch"
81 epatch "${FILESDIR}/fix-for-bug36724.patch"
83 autotools-utils_src_prepare
88 --disable-silent-rules
89 $(use_with xen xen_opt)
92 $(use_with doc mcs-docs)
96 autotools-utils_src_configure
100 autotools-utils_src_compile
109 autotools-utils_src_install
111 # Remove files not respecting LDFLAGS and that we are not supposed to provide, see Fedora
112 # mono.spec and http://www.mail-archive.com/mono-devel-list@lists.ximian.com/msg24870.html
114 rm -f "${ED}"/usr/lib/mono/{2.0,4.5}/mscorlib.dll.so || die
115 rm -f "${ED}"/usr/lib/mono/{2.0,4.5}/mcs.exe.so || die