. "$GRIMOIRE"/CMAKE_DEPENDS &&
depends LIBAVCODEC          &&
depends OPENGL              &&
depends curl                &&
depends libxcb              &&
depends x264                &&
depends jansson             &&
depends uthash              &&
depends qt6base &&
depends qt6svg &&
depends libxkbcommon &&
depends rnnoise &&
depends mbedtls &&
depends zlib &&

optional_depends luajit                                        \
                 '-DENABLE_SCRIPTING_LUA=ON'                   \
                 '-DENABLE_SCRIPTING_LUA=OFF'                  \
                 'for lua script support'                      &&

optional_depends python3                                       \
                 '-DENABLE_SCRIPTING_PYTHON=ON'                \
                 '-DENABLE_SCRIPTING_PYTHON=OFF'               \
                 'for python script support'                   &&

if is_depends_enabled $SPELL luajit || is_depends_enabled $SPELL python3; then
  depends swig '-DENABLE_SCRIPTING=ON'
fi &&

optional_depends JACK-DRIVER                                   \
                 '-DENABLE_JACK=ON'                            \
                 '-DENABLE_JACK=OFF'                           \
                 'for JACK audio support'                      &&

optional_depends LIBPULSE                                      \
                 '-DENABLE_PULSEAUDIO=ON'                      \
                 '-DENABLE_PULSEAUDIO=OFF'                     \
                 'for PulseAudio support'                      &&

optional_depends alsa-lib                                      \
                 '-DENABLE_ALSA=ON'                            \
                 '-DENABLE_ALSA=OFF'                           \
                 'for ALSA audio support'                      &&

optional_depends pipewire                                      \
                 '-DENABLE_PIPEWIRE=ON'                        \
                 '-DENABLE_PIPEWIRE=OFF'                       \
                 'for pipewire support'                        &&

optional_depends glib2 '' '' 'for D-Bus & XDG portal support'  &&

# TODO: add missing libdatachannel package
optional_depends libdatachannel \
                 -DENABLE_WEBRTC=ON \
                 -DENABLE_WEBRTC=OFF \
                 'for WebRTC output support' &&

# TODO: add missing libvpl package
optional_depends libvpl \
                 -DENABLE_QSV11=ON \
                 -DENABLE_QSV11=OFF \
                 'for Intel QSV11 hardware encoder support' &&

optional_depends vlc                                           \
                 '-DENABLE_VLC=ON'                             \
                 '-DENABLE_VLC=OFF'                            \
                 'for VLC support'                             &&

optional_depends speexdsp                                      \
                 '-DENABLE_SPEEXDSP=ON'                        \
                 '-DENABLE_SPEEXDSP=OFF'                       \
                 'for SpeexDSP-based noise suppression filter' &&

optional_depends v4l-utils                                     \
                 '-DENABLE_V4L2=ON'                            \
                 '-DENABLE_V4L2=OFF'                           \
                 'for V4L device support'                      &&
                
if is_depends_enabled "$SPELL" v4l-utils; then
  optional_depends DEVICE-MANAGER                             \
                   '-DENABLE_UDEV=ON'                         \
                   '-DENABLE_UDEV=OFF'                        \
                   'for device hotplug support in V4L plugin'
fi &&

optional_depends sndio                                         \
                 '-DENABLE_SNDIO=ON'                           \
                 '-DENABLE_SNDIO=OFF'                          \
                 'for Sndio audio support'                     &&

optional_depends wayland                                       \
                 '-DENABLE_WAYLAND=ON'                         \
                 '-DENABLE_WAYLAND=OFF'                        \
                 'enable wayland support'
