# Description: a fork of Mutt with added features
# URL: https://neomutt.org/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: libidn2
# Optional: cyrus-sasl gpgme krb5 lua notmuch

name=neomutt
version=20230517
release=1
source=(https://github.com/neomutt/neomutt/archive/$version/$name-$version.tar.gz)

build() {
  cd $name-$version

  prt-get isinst cyrus-sasl && PKGMK_NEOMUTT+=' --sasl'
  prt-get isinst gpgme && PKGMK_NEOMUTT+=' --gpgme'
  prt-get isinst krb5 && PKGMK_NEOMUTT+=' --gss'
  prt-get isinst lua && PKGMK_NEOMUTT+=' --enable-lua'
  prt-get isinst notmuch && PKGMK_NEOMUTT+=' --notmuch'

  ./configure $PKGMK_NEOMUTT \
    --prefix=/usr \
    --sysconfdir=/etc \
    --libexecdir=/usr/lib \
    --gdbm \
    --idn2=1 \
    --with-idn2=/usr \
    --ssl \
    --with-ui=ncurses \
    --idn=0 \
    --doc=0
  make
  make DESTDIR=$PKG install

  rm -fr $PKG/usr/share/
}
