# Compiling time: 3.45 SBU
# Maintainer: DeX77 <dex77@frugalware.org>
# Contributor: bouleetbil <bouleetbil@frogdev.info>

pkgname=mono
pkgver=6.12.0.122
pkgrel=1
pkgdesc="Mono runtime and class libraries, a C# compiler/interpreter"
url="http://www.mono-project.com/"
groups=('devel')
archs=("x86_64")
depends=('zlib' 'libstdc++>=9.1.0-3')
makedepends+=('cmake')
up2date="lynx -dump $url/download/stable/ | grep 'Stable Mono release is' | egrep -o '[0-9.]+' | tail -n 1"
source=(https://download.mono-project.com/sources/mono/$pkgname-$pkgver.tar.xz)

replaces=('monodoc' 'ikvm')
conflicts=('monodoc' 'ikvm')
provides=('monodoc' 'ikvm')

options=('static' 'force' 'nolto')
sha1sums=('0ddc92fccdeaa88aa8301421f2d997fdb9d1437e')

Fconfopts+="   --disable-quiet-build \
               --disable-system-aot \
               --with-libgdiplus=installed \
               --with-ikvm-native=yes \
               --with-jit=yes \
               --with-mcs-docs=no"

build() {

	## do NOT remove
	CFLAGS+=" -fno-strict-aliasing"
	CXXFLAGS+=" -fno-strict-aliasing"

	unset LDFLAGS
	Fbuild

	# for openoffice
	sed -i -e "s:#Requires:Requires:" ${Fdestdir}/usr/lib/pkgconfig/mono.pc || Fdie
}

# optimization OK
