# Description: Secure PinEntry Dialog
# URL: https://gnupg.org/related_software/pinentry/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: libassuan libcap util-linux
# Optional: gcr3 gtk libsecret qt5 qt6-base

name=pinentry
version=1.3.0
release=1
source=(https://gnupg.org/ftp/gcrypt/$name/$name-$version.tar.bz2
  pinentry)

build() {
  cd $name-$version

  prt-get isinst gcr3 || PKGMK_PINENTRY+=' --disable-gnome3'
  prt-get isinst gtk || PKGMK_PINENTRY+=' --disable-gtk2'
  prt-get isinst qt5 || PKGMK_PINENTRY+=' --disable-pinentry-qt5'
  prt-get isinst qt6-base || PKGMK_PINENTRY+=' --disable-pinentry-qt'

  CXXFLAGS+=" -fPIC" \
  ./configure $PKGMK_PINENTRY \
    --prefix=/usr \
    --enable-pinentry-curses \
    --enable-pinentry-tty \
    --disable-pinentry-qt4

  make
  make DESTDIR=$PKG install

  rm -rf $PKG/usr/share
  rm $PKG/usr/bin/pinentry
  install -m 755 $SRC/pinentry $PKG/usr/bin/pinentry
}