persistent_remove HEXCHAT_PYTHON &&
. "$GRIMOIRE"/MESON_DEPENDS &&
depends glib2 &&
depends GETTEXT &&

optional_depends SSL \
		 tls={enabled,disabled} \
                 "for TLS connections support" &&

optional_depends gtk+2 \
		 gtk-frontend={true,false} \
                 "for building the graphical interface" &&

if list_find "$HEXCHAT_OPTS" "text-frontend=false" &&
    ! is_depends_enabled "$SPELL" gtk+2
then
  message "${PROBLEM_COLOR}No frontend selected, aborting...${DEFAULT_COLOR}" &&
  return 1
fi &&

if list_find "$HEXCHAT_OPTS" plugin=true; then
  optional_depends python3 \
		   with-python={python3,false} \
		   "for Python scripting support" &&
  optional_depends perl \
		   with-perl={perl,false} \
                   "for Perl scripting support" &&
  # FIXME enable using lua too
  optional_depends luajit \
		   with-lua={luajit,false} \
                   "for Lua scripting support"
else
  list_add HEXCHAT_OPTS 'with-lua=false' &&
  list_add HEXCHAT_OPTS 'with-python=false' &&
  list_add HEXCHAT_OPTS 'with-perl=false'
fi &&

optional_depends dbus \
		 dbus={enabled,disabled} \
                 "for singe-instance and scripting" &&

optional_depends libcanberra \
		 libcanberra={enabled,disabled} \
                 "for sound alerts" &&

optional_depends monodevelop \
		 theme-manager={true,false} \
                 "to compile the theme manager"
