# Maintainer: Chris Zheng <chriszheng99@gmail.com>

pkgname=neomutt
pkgver=20250905
pkgrel=1
pkgdesc='a version of mutt with added features'
url='https://neomutt.org/'
msys2_references=(
  'anitya: 10882'
  'archlinux: neomutt'
  'cpe: cpe:2.3:a:neomutt:neomutt'
  'gentoo: mail-client/neomutt'
)
license=('GPL')
arch=('i686' 'x86_64')
depends=('libidn2' 'libgpgme' 'libsasl' 'libgdbm' 'ncurses' 'libiconv' 'libopenssl' 'libintl' 'heimdal-libs')
makedepends=(
  'libgpgme-devel'
  'libsasl-devel'
  'libgdbm-devel'
  'ncurses-devel'
  'libidn2-devel'
  'libiconv-devel'
  'openssl-devel'
  'gettext-devel'
  'heimdal-devel'
  'gcc'
  'libxslt'
  'docbook-xsl'
  'pkgconf'
)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/neomutt/neomutt/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('f409fa3803bfc540869b78719400bceda216842e4da024f83ca3060241d9c516')

build() {
  cd "${pkgname}-${pkgver}"

  CFLAGS+=" -Wno-incompatible-pointer-types"

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --libexecdir=/usr/lib \
    --gpgme \
    --gss \
    --ssl \
    --sasl \
    --with-ui=ncurses \
    --with-idn2=/usr \
    --idn=0 \
    --idn2=1 \
    --gdbm \

  make
}

package() {
  cd "${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
}
