# Description: A C/C++ MIME creation and parser library with support for S/MIME, PGP, and Unix mbox spools
# URL: https://github.com/jstedfast/gmime
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: glib-introspection gpgme libidn2
# Optional: vala

name=gmime3
version=3.2.15
release=3
source=(https://github.com/jstedfast/gmime/releases/download/$version/gmime-$version.tar.xz
  gmime-3.2.15-headers.patch)

build() {
  cd gmime-$version

  patch -Np1 -i $SRC/gmime-3.2.15-headers.patch
  aclocal -I m4
  libtoolize --force
  autoheader
  automake --add-missing
  autoconf -fvi

  prt-get isinst vala && PKGMK_GMIME+=' --enable-vala'
  ./configure --prefix=/usr $PKGMK_GMIME \
    --program-prefix=gmime3 \
    --enable-largefile \
    --enable-crypto \
    --enable-smime \
    --disable-gtk-doc \
    --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
  make DESTDIR=$PKG install

  rm -rf $PKG/usr/share/gtk-doc
}
