dev-libs/botan: ppc stable wrt bug #574034
[gentoo.git] / dev-lang / mono / mono-4.2.2.10-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 AUTOTOOLS_PRUNE_LIBTOOL_FILES="all"
7 AUTOTOOLS_AUTORECONF=1
8
9 inherit eutils linux-info mono-env flag-o-matic pax-utils autotools-utils versionator
10
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"
14
15 LICENSE="MIT LGPL-2.1 GPL-2 BSD-4 NPL-1.1 Ms-PL GPL-2-with-linking-exception IDPL"
16 SLOT="0"
17
18 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux"
19
20 IUSE="nls minimal pax_kernel xen doc"
21
22 COMMONDEPEND="
23         !minimal? ( >=dev-dotnet/libgdiplus-2.10 )
24         ia64? ( sys-libs/libunwind )
25         nls? ( sys-devel/gettext )
26 "
27 RDEPEND="${COMMONDEPEND}
28         || ( www-client/links www-client/lynx )
29 "
30 DEPEND="${COMMONDEPEND}
31         sys-devel/bc
32         virtual/yacc
33         pax_kernel? ( sys-apps/elfix )
34         !dev-lang/mono-basic
35 "
36
37 MAKEOPTS="${MAKEOPTS} -j1" #nowarn
38 S="${WORKDIR}/${PN}-$(get_version_component_range 1-3)"
39
40 pkg_pretend() {
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
45 }
46
47 pkg_setup() {
48         linux-info_pkg_setup
49         mono-env_pkg_setup
50 }
51
52 src_prepare() {
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."
59
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"
62         fi
63
64         # mono build system can fail otherwise
65         strip-flags
66
67         # Fix VB targets
68         # http://osdir.com/ml/general/2015-05/msg20808.html
69         epatch "${FILESDIR}/add_missing_vb_portable_targets.patch"
70
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"
74
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"
78
79         epatch "${FILESDIR}/systemweb3.patch"
80         epatch "${FILESDIR}/fix-for-GitExtensions-issue-2710-another-resolution.patch"
81         epatch "${FILESDIR}/fix-for-bug36724.patch"
82
83         autotools-utils_src_prepare
84 }
85
86 src_configure() {
87         local myeconfargs=(
88                 --disable-silent-rules
89                 $(use_with xen xen_opt)
90                 --without-ikvm-native
91                 --disable-dtrace
92                 $(use_with doc mcs-docs)
93                 $(use_enable nls)
94         )
95
96         autotools-utils_src_configure
97 }
98
99 src_compile() {
100         autotools-utils_src_compile
101 }
102
103 src_test() {
104         cd mcs/tests || die
105         emake check
106 }
107
108 src_install() {
109         autotools-utils_src_install
110
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
113         # for reference.
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
116 }