From e9b83405afe7e1133832377103c9126275f3474b Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Tue, 15 Dec 2020 14:06:17 +0300
Subject: Fix build on Haiku


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 89e3314..16c53e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,11 +53,14 @@ set_package_properties(Qt5OpenGL PROPERTIES
 set(QT_QTOPENGL_FOUND Qt5OpenGL_FOUND)
 
 set(REQUIRED_QT_VERSION 5.2.0)
+
+if (NOT HAIKU)
 find_package(Qt5X11Extras ${REQUIRED_QT_VERSION})
 set_package_properties(Qt5OpenGL PROPERTIES
     TYPE OPTIONAL
     PURPOSE "Qt5X11Extras is needed for the x11renderer"
     URL "http://doc.qt.io/qt-5/qtx11extras-index.html")
+endif ()
 
 include(ECMPoQmTools)
 
diff --git a/gstreamer/CMakeLists.txt b/gstreamer/CMakeLists.txt
index 4368cb5..80c6da2 100644
--- a/gstreamer/CMakeLists.txt
+++ b/gstreamer/CMakeLists.txt
@@ -20,8 +20,7 @@ include_directories(
       ${GSTREAMER_PLUGIN_AUDIO_INCLUDE_DIR}
       ${GSTREAMER_PLUGIN_PBUTILS_INCLUDE_DIR}
       ${GLIB2_INCLUDE_DIR}
-      ${LIBXML2_INCLUDE_DIR}
-      ${X11_X11_INCLUDE_PATH})
+      ${LIBXML2_INCLUDE_DIR})
 
 if(${PHONON_VERSION} VERSION_GREATER "4.6.49") # Pre-release 4.7 starts at 4.6.50
     message(STATUS "Building against Phonon 4.7 API")
@@ -78,13 +77,13 @@ if (OPENGL_FOUND)
     list(APPEND phonon_gstreamer_SRCS glrenderer.cpp)
 endif ()
 
-set(BUILD_X11RENDERER TRUE)
+set(BUILD_X11RENDERER FALSE)
 if (PHONON_BUILD_PHONON4QT5)
     if (Qt5X11Extras_FOUND)
-        set(BUILD_X11RENDERER TRUE)
+        set(BUILD_X11RENDERER FALSE)
     endif()
 elseif (NOT WIN32)
-    set(BUILD_X11RENDERER TRUE)
+    set(BUILD_X11RENDERER FALSE)
 endif()
 
 if (BUILD_X11RENDERER)
diff --git a/gstreamer/videowidget.cpp b/gstreamer/videowidget.cpp
index bd27b21..e94764f 100644
--- a/gstreamer/videowidget.cpp
+++ b/gstreamer/videowidget.cpp
@@ -80,10 +80,12 @@ VideoWidget::~VideoWidget()
 
 void VideoWidget::updateWindowID()
 {
+#ifndef Q_OS_HAIKU
     X11Renderer *render = dynamic_cast<X11Renderer*>(m_renderer);
     if (render) {
         render->setOverlay();
     }
+#endif
 }
 
 void Gstreamer::VideoWidget::syncX()
-- 
2.28.0

