. "${GRIMOIRE}/FUNCTIONS" &&
. "${GRIMOIRE}/MESON_DEPENDS" &&
. "${GRIMOIRE}/VDEPENDS" &&

vdepends <<< "at-spi2-core >= 2.45.0" &&
depends gdk-pixbuf2 &&
depends glib2 &&
depends graphene &&
depends pango &&
depends sassc &&

optional_depends cups \
                 "print-cups=enabled" \
                 "print-cups=disabled" \
                 "Enable CUPS print backend support?" &&

if is_depends_enabled "${SPELL}" "cups"; then
  optional_depends colord \
                  "colord=enabled" \
                  "colord=disabled" \
                  "Build colord support for CUPS print backend"
fi &&

optional_depends gobject-introspection \
                 "introspection=enabled" \
                 "introspection=disabled" \
                 "to enable introspection support" &&

optional_depends gstreamer-1.0 \
                 "media-gstreamer=enabled" \
                 "media-gstreamer=disabled" \
                 "for Gstreamer media backend" &&

optional_depends gtk-doc \
                 "documentation=true" \
                 "documentation=false" \
                 "Build documentation with gtk-doc" &&

optional_depends libx11 \
                 "x11-backend=true" \
                 "x11-backend=false" \
                 "to enable X11 backend" &&

if is_depends_enabled "${SPELL}" "libx11"; then
  local XLIB_SUB="X" &&
  depends fontconfig &&
  depends libxcursor &&
  depends libxext &&
  depends libxinerama &&
  depends libxrender &&

  optional_depends libxcomposite \
                   "" \
                   "" \
                   "for X11 Compositing support" &&

  optional_depends libxdamage \
                   "" \
                   "" \
                   "for X11 Damaged region extension support" &&

  optional_depends libxfixes \
                   "" \
                   "" \
                   "for X11 workarounds for various limitations" &&

  optional_depends libxrandr \
                   "" \
                   "" \
                   "for X11 Resize and Rotate support"
fi &&

depends -sub "PDF PS SVG GOBJ ${XLIB_SUB}" cairo &&

optional_depends wayland \
                 "wayland-backend=true" \
                 "wayland-backend=false" \
                 "to enable Wayland backend" &&

if is_depends_enabled "${SPELL}" "wayland"; then
  depends wayland-protocols
fi &&

optional_depends vulkan-loader \
                 "vulkan=enabled" \
                 "vulkan=disabled" \
                 "for Vulkan support including the Vulkan renderer" &&

if is_depends_enabled $SPELL vulkan-loader; then
  depends shaderc
fi
