logo

overlay

My (experimental) gentoo overlay

mono-5.4.0.201.ebuild (2994B)


      1 # Copyright 1999-2017 Gentoo Foundation
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 EAPI=6
      5 
      6 inherit autotools eutils linux-info mono-env flag-o-matic pax-utils versionator multilib-minimal
      7 
      8 DESCRIPTION="Mono runtime and class libraries, a C# compiler/interpreter"
      9 HOMEPAGE="http://www.mono-project.com/Main_Page"
     10 SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.bz2"
     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 
     15 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux"
     16 
     17 IUSE="nls minimal pax_kernel xen doc"
     18 
     19 COMMONDEPEND="
     20 	!minimal? ( >=dev-dotnet/libgdiplus-2.10 )
     21 	ia64? ( sys-libs/libunwind )
     22 	nls? ( sys-devel/gettext )
     23 "
     24 RDEPEND="${COMMONDEPEND}
     25 	|| ( www-client/links www-client/lynx )
     26 "
     27 DEPEND="${COMMONDEPEND}
     28 	sys-devel/bc
     29 	virtual/yacc
     30 	pax_kernel? ( sys-apps/elfix )
     31 	dev-util/cmake
     32 	!dev-lang/mono-basic
     33 "
     34 
     35 PATCHES=(
     36 	"${FILESDIR}"/${PN}-5.0.1.1-x86_32.patch
     37 )
     38 
     39 #S="${WORKDIR}/${PN}-$(get_version_component_range 1-3)"
     40 
     41 pkg_pretend() {
     42 	linux-info_pkg_setup
     43 	if use kernel_linux; then
     44 		if linux_config_exists; then
     45 			linux_chkconfig_builtin SYSVIPC || die "SYSVIPC not enabled in the kernel"
     46 		else
     47 			# https://github.com/gentoo/gentoo/blob/f200e625bda8de696a28338318c9005b69e34710/eclass/linux-info.eclass#L686
     48 			ewarn "kernel config not found"
     49 			ewarn "If CONFIG_SYSVIPC is not set in your kernel .config, mono will hang while compiling."
     50 			ewarn "See https://bugs.gentoo.org/261869 for more info."
     51 		fi
     52 	fi
     53 }
     54 
     55 pkg_setup() {
     56 	mono-env_pkg_setup
     57 }
     58 
     59 src_prepare() {
     60 	# we need to sed in the paxctl-ng -mr in the runtime/mono-wrapper.in so it don't
     61 	# get killed in the build proces when MPROTECT is enable. #286280
     62 	# RANDMMAP kill the build proces to #347365
     63 	# use paxmark.sh to get PT/XT logic #532244
     64 	if use pax_kernel ; then
     65 		ewarn "We are disabling MPROTECT on the mono binary."
     66 
     67 		# issue 9 : https://github.com/Heather/gentoo-dotnet/issues/9
     68 		sed '/exec "/ i\paxmark.sh -mr "$r/@mono_runtime@"' -i "${S}"/runtime/mono-wrapper.in || die "Failed to sed mono-wrapper.in"
     69 	fi
     70 
     71 	# mono build system can fail otherwise
     72 	strip-flags
     73 
     74 	#TODO: resolve problem with newer binutils
     75 	#bug: https://bugs.gentoo.org/show_bug.cgi?id=600664
     76 	#append-flags -fPIC
     77 
     78 	default
     79 	# PATCHES contains configure.ac patch
     80 	eautoreconf
     81 	multilib_copy_sources
     82 }
     83 
     84 multilib_src_configure() {
     85 	local myeconfargs=(
     86 		--disable-silent-rules
     87 		$(use_with xen xen_opt)
     88 		--without-ikvm-native
     89 		--disable-dtrace
     90 		$(use_with doc mcs-docs)
     91 		$(use_enable nls)
     92 	)
     93 
     94 	econf "${myeconfargs[@]}"
     95 }
     96 
     97 multilib_src_test() {
     98 	cd mcs/tests || die
     99 	emake check
    100 }
    101 
    102 multilib_src_install() {
    103 	default_src_install
    104 
    105 	# Remove files not respecting LDFLAGS and that we are not supposed to provide, see Fedora
    106 	# mono.spec and http://www.mail-archive.com/mono-devel-list@lists.ximian.com/msg24870.html
    107 	# for reference.
    108 	rm -f "${ED}"/usr/lib/mono/{2.0,4.5}/mscorlib.dll.so || die
    109 	rm -f "${ED}"/usr/lib/mono/{2.0,4.5}/mcs.exe.so || die
    110 }