# Description: Cross platform, open source .NET framework
# URL: https://www.mono-project.com
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: cmake ninja

name=mono
version=6.12.0.199
release=1
source=(https://download.mono-project.com/sources/$name/preview/$name-$version.tar.xz)

build() {
  cd $name-$version

  [[ -e /usr/lib/ccache ]] && PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"

  CFLAGS+=" -ffat-lto-objects" \
  ./configure --prefix=/usr \
    --mandir=/usr/share/man \
    --enable-ninja \
    --with-mcs-docs=no \
    --disable-crash-reporting \
    --disable-nls

  PYTHON=/usr/bin/python3 make
  make DESTDIR=$PKG install

  rm -fr $PKG/usr/share/locale
  find $PKG \( -iname "*README*" \
    -o -iname "*la" \)\
    -delete
}
