From a67d10648c39f7d35fdc24a88a10733b97d7f4a6 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 6 Aug 2018 13:03:50 +1000
Subject: Fix build for Haiku


diff --git a/src/main.cpp b/src/main.cpp
index b17d203..4310a44 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -23,7 +23,7 @@
 #include "dbus_interface.h"
 #include "version.h"
 
-#if !defined (WIN32)
+#if !defined (WIN32) && !defined(__HAIKU__)
 	#include <QtDBus/QtDBus>
 #endif
 
@@ -70,7 +70,7 @@ int main( int argc, char ** argv )
 	// Configuration
 	pConfig = new Config();
 
-#if !defined (WIN32) && !defined(Q_WS_MAC)
+#if !defined (WIN32) && !defined(Q_WS_MAC) && !defined(__HAIKU__)
 	if ( QDBusConnection::sessionBus().isConnected() )
 	{
 		if ( QDBusConnection::sessionBus().registerService(SERVICE_NAME) )
diff --git a/src/src.pro b/src/src.pro
index ae4222a..d1bca3b 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -102,7 +102,13 @@ win32-*: {
     LIBS += -lwsock32 -loleaut32
 }
 
-unix:!macx: {
+haiku {
+	LIBS += -lnetwork
+    LIBS += ../lib/libebook/libebook.a
+    POST_TARGETDEPS += ../lib/libebook/libebook.a
+}
+
+unix:!macx:!haiku: {
 
     QT += dbus
     HEADERS += dbus_interface.h
@@ -114,7 +120,7 @@ unix:!macx: {
 
 greaterThan(QT_MAJOR_VERSION, 4) {
     # Qt 5
-    greaterThan(QT_MINOR_VERSION, 5) {
+    greaterThan(QT_MINOR_VERSION, 5):!haiku: {
         # Qt 5.6+
         error("You use Qt5.6+ - QWebEngine is not yet suitable for kchmviewer and is not supported")
         QT += webengine webenginewidgets
-- 
2.16.4

