From f22e620a0a9b93009bf23f1119caaee41df9b130 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Thu, 27 Sep 2018 10:48:01 +0200
Subject: Install adjustments for HAIKU


diff --git a/YACReader/YACReader.pro b/YACReader/YACReader.pro
index 067e78e..44e70ab 100644
--- a/YACReader/YACReader.pro
+++ b/YACReader/YACReader.pro
@@ -209,7 +209,11 @@ DEFINES += "LIBDIR=\\\"$$LIBDIR\\\""  "DATADIR=\\\"$$DATADIR\\\""
 
 #MAKE INSTALL
 
-INSTALLS += bin docs icon desktop translation manpage
+haiku {
+  INSTALLS += bin docs icon desktop translation manpage
+} else {
+  INSTALLS += bin docs translation manpage
+}
 
 bin.path = $$BINDIR
 isEmpty(DESTDIR) {
@@ -218,7 +222,11 @@ isEmpty(DESTDIR) {
   bin.files = $$DESTDIR/YACReader
 }
 
-docs.path = $$DATADIR/doc/yacreader
+isEmpty(DOCDIR) {
+  docs.path = $$DATADIR/doc/yacreader
+} else {
+  docs.path = $$DOCDIR/
+}
 
 #rename docs for better packageability
 docs.extra = cp ../README.md ../README
@@ -230,10 +238,18 @@ icon.files = ../YACReader.svg
 desktop.path = $$DATADIR/applications
 desktop.files = ../YACReader.desktop
 
-translation.path = $$DATADIR/yacreader/languages
+!haiku {
+  translation.path = $$DATADIR/yacreader/languages
+} else {
+  translation.path = $$DATADIR/data/languages
+}
 translation.files = ../release/languages/yacreader_*
 
-manpage.path = $$DATADIR/man/man1
+isEmpty(MANDIR) {
+  manpage.path = $$DATADIR/man/man1
+} else {
+  manpage.path = $$MANDIR/man1
+}
 manpage.files = ../YACReader.1
 
 #remove leftover doc files when 'make clean' is invoked
diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro
index ee810ec..4cf4aea 100644
--- a/YACReaderLibrary/YACReaderLibrary.pro
+++ b/YACReaderLibrary/YACReaderLibrary.pro
@@ -306,7 +306,11 @@ DEFINES += "LIBDIR=\\\"$$LIBDIR\\\""  "DATADIR=\\\"$$DATADIR\\\""
 DEFINES += "LIBDIR=\\\"$$LIBDIR\\\""  "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\""
 
 #MAKE INSTALL
-INSTALLS += bin icon desktop server translation manpage
+!haiku {
+  INSTALLS += bin icon desktop server translation manpage
+} else {
+  INSTALLS += bin server translation manpage
+}
 
 bin.path = $$BINDIR
 isEmpty(DESTDIR) {
@@ -315,7 +319,11 @@ isEmpty(DESTDIR) {
   bin.files = $$DESTDIR/YACReaderLibrary
 }
 
-server.path = $$DATADIR/yacreader
+!haiku {
+  server.path = $$DATADIR/yacreader
+} else {
+  server.path = $$DATADIR/data
+}
 server.files = ../release/server
 
 icon.path = $$DATADIR/icons/hicolor/scalable/apps
@@ -324,9 +332,17 @@ icon.files = ../YACReaderLibrary.svg
 desktop.path = $$DATADIR/applications
 desktop.files = ../YACReaderLibrary.desktop
 
-translation.path = $$DATADIR/yacreader/languages
+!haiku {
+  translation.path = $$DATADIR/yacreader/languages
+} else {
+  translation.path = $$DATADIR/data/languages
+}
 translation.files = ../release/languages/yacreaderlibrary_*
 
-manpage.path = $$DATADIR/man/man1
+isEmpty(MANDIR) {
+  manpage.path = $$DATADIR/man/man1
+} else {
+  manpage.path = $$MANDIR/man1
+}
 manpage.files = ../YACReaderLibrary.1
 }
-- 
2.30.2


From a0788d2c79d95c0f34abf1c283ee7b940fccb64d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Thu, 27 Sep 2018 10:52:38 +0200
Subject: Library can open Reader now


diff --git a/YACReaderLibrary/library_comic_opener.cpp b/YACReaderLibrary/library_comic_opener.cpp
index 36ebf74..62dc91a 100644
--- a/YACReaderLibrary/library_comic_opener.cpp
+++ b/YACReaderLibrary/library_comic_opener.cpp
@@ -40,7 +40,11 @@ bool YACReader::openComic(const ComicDB &comic,
 
 #if defined Q_OS_UNIX && !defined Q_OS_MAC
     QStringList parameters { path, QString("--comicId=%1").arg(comic.id), QString("--libraryId=%1").arg(libraryId), labelParam };
+#if defined Q_OS_HAIKU
+        yacreaderFound = QProcess::startDetached(QString(BINDIR)+"/YACReader",parameters);
+#else
     yacreaderFound = QProcess::startDetached(QStringLiteral("YACReader"), parameters);
+#endif
 #endif
 
     return yacreaderFound;
-- 
2.30.2

