Psi-plus: bump version

This commit is contained in:
Gerasim Troeglazov
2018-08-15 23:15:24 +10:00
parent c058ec8568
commit 5236757cb7
2 changed files with 505 additions and 157 deletions

View File

@@ -1,28 +1,28 @@
From 6244ed29c821eb5f231dbf3470d90982f86f03ce Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Wed, 15 Nov 2017 13:36:45 +0300
Subject: Haiku fixes
From 5f48b3bf32165c06cd6c660665569da875a05bb9 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Tue, 7 Aug 2018 22:35:46 +1000
Subject: Fix build for Haiku
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38821af..e84a453 100644
index db00db2..a4eb14b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,7 +185,7 @@ elseif( NOT IS_PSIPLUS AND APP_VERSION )
@@ -201,7 +201,7 @@ if(WIN32)
endif()
# Define LINUX on Linux like as WIN32 on Windows and APPLE on Mac OS X
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT( APPLE OR HAIKU ))
set(LINUX ON)
add_definitions(
-DHAVE_X11
set(LINUX ON)
add_definitions(
-DHAVE_X11
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5567acd..43fd934 100644
index cffc745..7250acc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -467,6 +467,28 @@ if(LINUX)
endif()
@@ -487,6 +487,27 @@ if(LINUX)
endif()
endif()
+if(HAIKU)
@@ -45,52 +45,51 @@ index 5567acd..43fd934 100644
+ install(FILES ${QM} DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF}/translations)
+ endif()
+endif()
+
+
if(WIN32)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${PROJECT_SOURCE_DIR}/client_icons.txt DESTINATION ${CMAKE_INSTALL_PREFIX})
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX})
if(NOT ONLY_BINARY AND INSTALL_EXTRA_FILES)
diff --git a/src/applicationinfo.cpp b/src/applicationinfo.cpp
index 66624aa..0f0ce0b 100644
index dcff9d9..548d732 100644
--- a/src/applicationinfo.cpp
+++ b/src/applicationinfo.cpp
@@ -150,7 +150,7 @@ QString ApplicationInfo::getCertificateStoreSaveDir()
@@ -148,7 +148,7 @@ QString ApplicationInfo::getCertificateStoreSaveDir()
QString ApplicationInfo::resourcesDir()
{
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) || defined(Q_OS_HAIKU)
return qApp->applicationDirPath();
return qApp->applicationDirPath();
#elif defined(Q_OS_MAC)
// FIXME: Clean this up (remko)
@@ -196,7 +196,7 @@ QString ApplicationInfo::resourcesDir()
// FIXME: Clean this up (remko)
@@ -194,7 +194,7 @@ QString ApplicationInfo::resourcesDir()
QString ApplicationInfo::libDir()
{
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_HAIKU)
return PSI_LIBDIR;
return PSI_LIBDIR;
#else
return QString();
@@ -295,6 +295,10 @@ QString ApplicationInfo::homeDir(ApplicationInfo::HomedirType type)
QMessageBox::information(0, QObject::tr("Conversion Error"), QObject::tr("Configuration data for a previous version of Psi was found, but it was not possible to convert it to work with the current version. Ensure you have appropriate permission and that another copy of Psi is not running, and try again."));
exit(0);
}
return QCoreApplication::applicationDirPath();
@@ -283,6 +283,10 @@ QString ApplicationInfo::homeDir(ApplicationInfo::HomedirType type)
QMessageBox::information(0, QObject::tr("Conversion Error"), QObject::tr("Configuration data for a previous version of Psi was found, but it was not possible to convert it to work with the current version. Ensure you have appropriate permission and that another copy of Psi is not running, and try again."));
exit(0);
}
+#elif defined Q_OS_HAIKU
+ QDir configDir(QDir::homePath() + "/config/settings/Qt/.config/" + sname());
+ QDir cacheDir(QDir::homePath() + "/config/cache/" + sname());
+ QDir dataDir(configDir);
#endif
configDir_ = configDir.path();
cacheDir_ = cacheDir.path();
configDir_ = configDir.path();
cacheDir_ = cacheDir.path();
diff --git a/src/libpsi/tools/CMakeLists.txt b/src/libpsi/tools/CMakeLists.txt
index 9f83472..a6de073 100644
index 183a518..974538f 100644
--- a/src/libpsi/tools/CMakeLists.txt
+++ b/src/libpsi/tools/CMakeLists.txt
@@ -124,6 +124,23 @@ elseif(WIN32)
# spellchecker
spellchecker/hunspellchecker.cpp
)
@@ -136,6 +136,22 @@ elseif(WIN32)
# spellchecker
spellchecker/hunspellchecker.cpp
)
+elseif(HAIKU)
+ list(APPEND HEADERS
+ # systemwatch
@@ -104,15 +103,14 @@ index 9f83472..a6de073 100644
+ # systemwatch
+ systemwatch/systemwatch_unix.cpp
+
+
+ # globalshortcut
+ globalshortcut/globalshortcutmanager_haiku.cpp
+ )
else()
list(APPEND HEADERS
# systemwatch
list(APPEND HEADERS
# systemwatch
diff --git a/src/libpsi/tools/globalshortcut/globalshortcut.pri b/src/libpsi/tools/globalshortcut/globalshortcut.pri
index 0c788ac..9a0a1a2 100644
index 7a26216..aa19fa7 100644
--- a/src/libpsi/tools/globalshortcut/globalshortcut.pri
+++ b/src/libpsi/tools/globalshortcut/globalshortcut.pri
@@ -2,7 +2,7 @@ HEADERS += $$PWD/globalshortcutmanager.h $$PWD/globalshortcuttrigger.h
@@ -120,16 +118,16 @@ index 0c788ac..9a0a1a2 100644
DEPENDPATH += $$PWD
-unix:!mac {
+unix:!mac!haiku {
SOURCES += $$PWD/globalshortcutmanager_x11.cpp
+unix:!mac:!haiku: {
SOURCES += $$PWD/globalshortcutmanager_x11.cpp
}
win32: {
diff --git a/src/libpsi/tools/globalshortcut/globalshortcutmanager_haiku.cpp b/src/libpsi/tools/globalshortcut/globalshortcutmanager_haiku.cpp
new file mode 100644
index 0000000..0c4985a
index 0000000..5c90064
--- /dev/null
+++ b/src/libpsi/tools/globalshortcut/globalshortcutmanager_haiku.cpp
@@ -0,0 +1,337 @@
@@ -0,0 +1,336 @@
+/*
+ * globalshortcutmanager_haiku.cpp - Haiku implementation of global shortcuts by Vitaly (Diger)
+ * Based on X11 implementation of global shortcuts
@@ -202,10 +200,10 @@ index 0000000..0c4985a
+ // reimplemented
+ bool eventFilter(QObject* o, QEvent* e)
+ {
+ if(e->type() == QEvent::KeyPress) {
+ if(e->type() == QEvent::KeyPress) {
+ QKeyEvent* k = static_cast<QKeyEvent*>(e);
+ int qkey = k->key();
+ if (k->modifiers() & Qt::ShiftModifier)
+ if (k->modifiers() & Qt::ShiftModifier)
+ qkey |= Qt::SHIFT;
+ if (k->modifiers() & Qt::ControlModifier)
+ qkey |= Qt::CTRL;
@@ -217,7 +215,7 @@ index 0000000..0c4985a
+ foreach(HKeyTrigger* trigger, triggers_) {
+ if (trigger->isAccepted(qkey)) {
+ trigger->activate();
+ return true;
+ return true;
+ }
+ }
+ }
@@ -254,7 +252,7 @@ index 0000000..0c4985a
+ static void ensureModifiers()
+ {
+ if (haveMods)
+ return;
+ return;
+ }
+
+public:
@@ -285,11 +283,11 @@ index 0000000..0c4985a
+ kg = qt_hk_table[n].hk;
+ found = true;
+ break;
+ }
+ }
+ }
+
+ if (!found) {
+ // try latin1
+ // try latin1
+ if (code >= 0x20 && code <= 0x7f) {
+ kg.num = 1;
+ kg.sym[0] = code;
@@ -456,7 +454,6 @@ index 0000000..0c4985a
+
+ { Qt::Key_unknown, {0, { 0 }}},
+};
+
+GlobalShortcutManager::KeyTrigger::KeyTrigger(const QKeySequence& key)
+{
+ d = new Impl(this, key);
@@ -467,120 +464,458 @@ index 0000000..0c4985a
+ delete d;
+ d = 0;
+}
diff --git a/src/libpsi/tools/systemwatch/systemwatch_unix.cpp b/src/libpsi/tools/systemwatch/systemwatch_unix.cpp
index f7b4001..b7f108a 100644
--- a/src/libpsi/tools/systemwatch/systemwatch_unix.cpp
+++ b/src/libpsi/tools/systemwatch/systemwatch_unix.cpp
@@ -20,6 +20,11 @@
#include <unistd.h>
#include "systemwatch_unix.h"
+
+#ifdef __HAIKU__
+#undef USE_DBUS
+#endif
+
#ifdef USE_DBUS
# include <QDBusConnection>
# include <QDBusReply>
diff --git a/src/libpsi/tools/systemwatch/systemwatch_unix.h b/src/libpsi/tools/systemwatch/systemwatch_unix.h
index 8be1f90..117df09 100644
--- a/src/libpsi/tools/systemwatch/systemwatch_unix.h
+++ b/src/libpsi/tools/systemwatch/systemwatch_unix.h
@@ -20,6 +20,11 @@
#ifndef SYSTEMWATCH_UNIX_H
#define SYSTEMWATCH_UNIX_H
+
+#ifdef __HAIKU__
+#undef USE_DBUS
+#endif
+
#ifdef USE_DBUS
#include <QDBusUnixFileDescriptor>
#endif
diff --git a/src/libpsi/tools/zip/minizip/ioapi.h b/src/libpsi/tools/zip/minizip/ioapi.h
index 54a6e25..544a0e9 100644
--- a/src/libpsi/tools/zip/minizip/ioapi.h
+++ b/src/libpsi/tools/zip/minizip/ioapi.h
@@ -45,7 +45,7 @@
#include <stdlib.h>
#include "zlib.h"
-#if defined(USE_FILE32API)
+#if defined(USE_FILE32API) || defined(__HAIKU__)
#define fopen64 fopen
#define ftello64 ftell
#define fseeko64 fseek
diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt
index 61524bb..4bc6a0d 100644
--- a/src/plugins/generic/CMakeLists.txt
+++ b/src/plugins/generic/CMakeLists.txt
@@ -26,7 +26,7 @@ set( plugins_list
jabberdiskplugin
juickplugin
messagefilterplugin
- omemoplugin
+# omemoplugin
otrplugin
pepchangenotifyplugin
qipxstatusesplugin
@@ -35,7 +35,7 @@ set( plugins_list
stopspamplugin
storagenotesplugin
translateplugin
- videostatusplugin
+
watcherplugin
)
diff --git a/src/plugins/generic/generic.pro b/src/plugins/generic/generic.pro
index 6929e18..60fa7ed 100644
--- a/src/plugins/generic/generic.pro
+++ b/src/plugins/generic/generic.pro
@@ -21,7 +21,7 @@ imagepreviewplugin \
jabberdiskplugin \
juickplugin \
messagefilterplugin \
-omemoplugin \
+#omemoplugin \
otrplugin \
pepchangenotifyplugin \
qipxstatusesplugin \
diff --git a/src/plugins/generic/screenshotplugin/CMakeLists.txt b/src/plugins/generic/screenshotplugin/CMakeLists.txt
index f487c2a..6ccfa25 100644
index 5b29281..b2d5fb9 100644
--- a/src/plugins/generic/screenshotplugin/CMakeLists.txt
+++ b/src/plugins/generic/screenshotplugin/CMakeLists.txt
@@ -28,7 +28,7 @@ include_directories(
${CMAKE_CURRENT_LIST_DIR}/qxt/core
${CMAKE_CURRENT_LIST_DIR}/qxt/gui
@@ -31,7 +31,7 @@ include_directories(
${CMAKE_CURRENT_LIST_DIR}/qxt/core
${CMAKE_CURRENT_LIST_DIR}/qxt/gui
)
-if( UNIX AND NOT( APPLE OR CYGWIN ) )
+if( UNIX AND NOT( APPLE OR CYGWIN OR HAIKU ) )
find_package( X11 REQUIRED )
add_definitions( -DX11 )
set( qxt_X11_SRCS
@@ -110,7 +110,7 @@ set(QT_DEPLIBS
Qt5::Network
Qt5::PrintSupport
find_package( X11 REQUIRED )
set(EXTRA_LIBS ${X11_LIBRARIES})
add_definitions( -DX11 )
@@ -114,7 +114,7 @@ set(QT_DEPLIBS
Qt5::Network
Qt5::PrintSupport
)
-if( UNIX AND NOT( APPLE OR CYGWIN ) )
+if( UNIX AND NOT( APPLE OR CYGWIN OR HAIKU ) )
find_package( Qt5 COMPONENTS X11Extras REQUIRED )
set(QT_DEPLIBS
${QT_DEPLIBS}
find_package( Qt5 COMPONENTS X11Extras REQUIRED )
set(QT_DEPLIBS
${QT_DEPLIBS}
diff --git a/src/plugins/generic/videostatusplugin/CMakeLists.txt b/src/plugins/generic/videostatusplugin/CMakeLists.txt
index b57dfd2..b76f4cb 100644
index 05115a1..b49cf82 100644
--- a/src/plugins/generic/videostatusplugin/CMakeLists.txt
+++ b/src/plugins/generic/videostatusplugin/CMakeLists.txt
@@ -20,7 +20,7 @@ else()
Please set path to this file to PLUGINS_ROOT_DIR variable")
@@ -23,7 +23,7 @@ else()
Please set path to this file to PLUGINS_ROOT_DIR variable")
endif()
-if( NOT WIN32 )
+if( NOT WIN32 AND NOT HAIKU)
add_definitions( -Ddbus -DHAVE_DBUS )
find_package( X11 REQUIRED )
endif()
@@ -31,7 +31,7 @@ include_directories(
${PLUGINS_ROOT_DIR}/include
${CMAKE_CURRENT_LIST_DIR}
add_definitions( -Ddbus -DHAVE_DBUS )
find_package( X11 REQUIRED )
set(EXTRA_LIBS ${X11_LIBRARIES})
@@ -35,7 +35,7 @@ include_directories(
${PLUGINS_ROOT_DIR}/include
${CMAKE_CURRENT_LIST_DIR}
)
-if( NOT WIN32 )
+if( NOT WIN32 AND NOT HAIKU)
set( x11_SRCS
x11info.cpp
)
@@ -55,7 +55,7 @@ set(QT_DEPLIBS
Qt5::Widgets
Qt5::Xml
set( x11_SRCS
x11info.cpp
)
@@ -59,7 +59,7 @@ set(QT_DEPLIBS
Qt5::Widgets
Qt5::Xml
)
-IF( UNIX AND NOT( APPLE OR CYGWIN ) )
+IF( UNIX AND NOT( APPLE OR CYGWIN OR HAIKU ) )
find_package( Qt5 COMPONENTS DBus X11Extras REQUIRED )
find_package( XCB REQUIRED )
add_definitions(
@@ -78,7 +78,7 @@ add_library(
${UIS}
${RSCS}
)
-if( UNIX AND NOT( APPLE OR CYGWIN ) )
+if( UNIX AND NOT( APPLE OR CYGWIN OR HAIKU ) )
target_link_libraries(
${PLUGIN}
${X11_LIBRARIES}
find_package( Qt5 COMPONENTS DBus X11Extras REQUIRED )
find_package( XCB REQUIRED )
add_definitions(
diff --git a/src/plugins/generic/videostatusplugin/videostatusplugin.cpp b/src/plugins/generic/videostatusplugin/videostatusplugin.cpp
old mode 100755
new mode 100644
index 57acce8..071c345
index 4b36af2..df8afd6
--- a/src/plugins/generic/videostatusplugin/videostatusplugin.cpp
+++ b/src/plugins/generic/videostatusplugin/videostatusplugin.cpp
@@ -648,7 +648,11 @@ void VideoStatusChanger::fullSTTimeout()
@@ -648,6 +648,8 @@ void VideoStatusChanger::fullSTTimeout()
XFree(data);
#elif defined (Q_OS_WIN)
bool full = isFullscreenWindow();
#endif
- if(full) {
+#elif defined (Q_OS_WIN)
+ bool full = isFullscreenWindow();
+#elif defined (Q_OS_HAIKU)
+ bool full = false;
+#endif
+ bool full = false;
#endif
if(full) {
if(!isStatusSet) {
setStatusTimer(setDelay, true);
}
diff --git a/src/popupmanager.cpp b/src/popupmanager.cpp
index 531eb80..4db79fd 100644
--- a/src/popupmanager.cpp
+++ b/src/popupmanager.cpp
@@ -28,6 +28,9 @@
#include <QPluginLoader>
#include <QtPlugin>
+#ifdef __HAIKU__
+#undef USE_DBUS
+#endif
static const int defaultTimeout = 5;
static const QString defaultType = "Classic";
diff --git a/src/psicon.cpp b/src/psicon.cpp
index 84a47b5..a203c74 100644
--- a/src/psicon.cpp
+++ b/src/psicon.cpp
@@ -131,6 +131,10 @@
#include "mac_dock/mac_dock.h"
#endif
+#ifdef __HAIKU__
+#undef USE_DBUS
+#endif
+
static const char *tunePublishOptionPath = "options.extended-presence.tune.publish";
static const char *tuneUrlFilterOptionPath = "options.extended-presence.tune.url-filter";
static const char *tuneTitleFilterOptionPath = "options.extended-presence.tune.title-filter";
diff --git a/src/src.cmake b/src/src.cmake
index 9703fa1..5a95af7 100644
index c3fd6d6..f29acda 100644
--- a/src/src.cmake
+++ b/src/src.cmake
@@ -9,7 +9,7 @@ add_definitions(
-DQT_STATICPLUGIN
)
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT (APPLE OR HAIKU))
add_definitions(
-DUSE_DBUS
)
@@ -238,7 +238,7 @@ list(APPEND SOURCES
xdata_widget.cpp
)
xdata_widget.cpp
)
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT (APPLE OR HAIKU))
list(APPEND SOURCES
dbus.cpp
)
@@ -275,6 +275,10 @@ elseif(WIN32)
list(APPEND PLAIN_SOURCES
activeprofiles_win.cpp
)
+if(UNIX AND NOT APPLE AND NOT HAIKU)
list(APPEND SOURCES
dbus.cpp
)
@@ -272,6 +272,10 @@ elseif(APPLE)
# list(APPEND HEADERS
# psigrowlnotifier.h
# )
+elseif(HAIKU)
+ list(APPEND PLAIN_SOURCES
+ activeprofiles_stub.cpp
+ )
+ list(APPEND PLAIN_SOURCES
+ activeprofiles_stub.cpp
+ )
elseif(WIN32)
list(APPEND PLAIN_SOURCES
activeprofiles_win.cpp
diff --git a/src/src.pri b/src/src.pri
index 975cb19..1de96b1 100644
--- a/src/src.pri
+++ b/src/src.pri
@@ -4,7 +4,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets multimedia concurrent
DEFINES += HAVE_QT5
- unix:!mac {
+ unix:!mac:!haiku {
LIBS += -lxcb
QT += x11extras
}
@@ -14,7 +14,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
DEFINES += HAVE_KEYCHAIN
}
}
-unix:!mac {
+unix:!mac:!haiku {
DEFINES += HAVE_X11
DEFINES += HAVE_FREEDESKTOP
}
@@ -56,7 +56,7 @@ pep {
CONFIG += tc_psifile
mac { CONFIG += tc_itunes }
windows { CONFIG += tc_aimp tc_winamp }
- unix:dbus:!mac { CONFIG += tc_mpris }
+ unix:dbus:!mac:!haiku { CONFIG += tc_mpris }
}
include($$PWD/tools/tunecontroller/tunecontroller.pri)
@@ -604,7 +604,7 @@ psi_plugins {
include($$PWD/plugins/plugins.pri)
}
-dbus {
+dbus:!haiku {
HEADERS += $$PWD/dbus.h \
$$PWD/psidbusnotifier.h
SOURCES += $$PWD/dbus.cpp
@@ -628,6 +628,10 @@ unix:!dbus {
SOURCES += $$PWD/activeprofiles_stub.cpp
}
+haiku {
+ SOURCES += $$PWD/activeprofiles_stub.cpp
+}
+
qtwebengine|qtwebkit {
HEADERS += $$PWD/chatview_webkit.h \
$$PWD/webview.h \
diff --git a/src/tools/tunecontroller/tunecontrollermanager.cpp b/src/tools/tunecontroller/tunecontrollermanager.cpp
index 9dae38b..d8e45e7 100644
--- a/src/tools/tunecontroller/tunecontrollermanager.cpp
+++ b/src/tools/tunecontroller/tunecontrollermanager.cpp
@@ -25,6 +25,10 @@
#include <QtCore>
#include <QPluginLoader>
+#ifdef __HAIKU__
+#undef USE_DBUS
+#endif
+
#include "tunecontroller.h"
#include "tunecontrollermanager.h"
#include "tunecontrollerplugin.h"
--
2.16.4
From c016baf30d999f84e34334dc1a0ea164c4a01fe6 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 10 Aug 2018 19:16:17 +1000
Subject: Add systeminfo for haiku platform
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7250acc..298e845 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -83,6 +83,10 @@ if(LINUX)
include_directories(${X11_INCLUDE_DIR})
endif()
list(APPEND PLAIN_HEADERS
+if(HAIKU)
+ list(APPEND EXTRA_LIBS root be)
+endif()
+
if(USE_ENCHANT)
find_package(Enchant REQUIRED)
list(APPEND EXTRA_LIBS ${Enchant_LIBRARY})
diff --git a/src/systeminfo.cpp b/src/systeminfo.cpp
index 2468e91..f6340d3 100644
--- a/src/systeminfo.cpp
+++ b/src/systeminfo.cpp
@@ -26,6 +26,14 @@
#include <windows.h>
#endif
+#if defined(Q_OS_HAIKU)
+#include <sys/utsname.h>
+#include <Path.h>
+#include <FindDirectory.h>
+#include <AppFileInfo.h>
+#include <File.h>
+#endif
+
#include "systeminfo.h"
#if defined(HAVE_X11)
@@ -304,6 +312,20 @@ SystemInfo::SystemInfo() : QObject(QCoreApplication::instance())
os_str_ += (" " + os_version_str_);
}
#endif
+
+#if defined(Q_OS_HAIKU)
+ os_name_str_ = "Haiku";
+ os_str_ = os_name_str_;
+ os_version_str_ = "";
+
+ utsname uname_info;
+ if (uname(&uname_info) == 0) {
+ os_str_ = QLatin1String(uname_info.sysname);
+ os_version_str_ = (QLatin1String(uname_info.machine) + " ");
+ os_version_str_ += QLatin1String(uname_info.version);
+ os_str_ += (" " + os_version_str_);
+ }
+#endif
}
SystemInfo* SystemInfo::instance()
--
2.14.2
2.16.4
From 6ec2647991b8d869820960f8e6689076a27d08c1 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 15 Aug 2018 23:04:56 +1000
Subject: Fix build jdns library
diff --git a/iris/src/jdns/src/jdns/CMakeLists.txt b/iris/src/jdns/src/jdns/CMakeLists.txt
index 37741f3..b15441f 100644
--- a/iris/src/jdns/src/jdns/CMakeLists.txt
+++ b/iris/src/jdns/src/jdns/CMakeLists.txt
@@ -24,6 +24,10 @@ if(WIN32)
target_link_libraries(jdns ws2_32 advapi32)
endif(WIN32)
+if(HAIKU)
+ target_link_libraries(jdns network)
+endif(HAIKU)
+
if(NOT android)
set_target_properties(jdns PROPERTIES
VERSION ${JDNS_LIB_MAJOR_VERSION}.${JDNS_LIB_MINOR_VERSION}.${JDNS_LIB_PATCH_VERSION}
diff --git a/iris/src/jdns/src/jdns/jdns_p.h b/iris/src/jdns/src/jdns/jdns_p.h
index 0fe1aa5..0ae7e94 100644
--- a/iris/src/jdns/src/jdns/jdns_p.h
+++ b/iris/src/jdns/src/jdns/jdns_p.h
@@ -42,6 +42,8 @@
# define JDNS_OS_NETBSD
#elif defined(__OpenBSD__)
# define JDNS_OS_OPENBSD
+#elif defined(__HAIKU__)
+# define JDNS_OS_HAIKU
#elif defined(sun) || defined(__sun)
# define JDNS_OS_SOLARIS
#elif defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
diff --git a/iris/src/jdns/src/jdns/jdns_sys.c b/iris/src/jdns/src/jdns/jdns_sys.c
index b7edf85..d755c1c 100644
--- a/iris/src/jdns/src/jdns/jdns_sys.c
+++ b/iris/src/jdns/src/jdns/jdns_sys.c
@@ -727,7 +727,7 @@ static int my_res_init()
// specify the platforms that have __res_state_ext
//#ifdef __res_state_ext
#if defined(JDNS_OS_MAC) || defined(JDNS_OS_FREEBSD) || \
- defined(JDNS_OS_NETBSD) || defined (JDNS_OS_SOLARIS)
+ defined(JDNS_OS_NETBSD) || defined (JDNS_OS_SOLARIS) || defined (JDNS_OS_HAIKU)
# define USE_EXTEXT
#endif
#if defined(JDNS_OS_OPENBSD)
diff --git a/iris/src/jdns/src/qjdns/qjdns_sock.cpp b/iris/src/jdns/src/qjdns/qjdns_sock.cpp
index 71c9715..28fe11c 100644
--- a/iris/src/jdns/src/qjdns/qjdns_sock.cpp
+++ b/iris/src/jdns/src/qjdns/qjdns_sock.cpp
@@ -44,6 +44,10 @@
# include <arpa/inet.h>
#endif
+#ifdef Q_OS_HAIKU
+#define QT_NO_IPV6 1
+#endif
+
#ifndef QT_NO_IPV6
# define HAVE_IPV6
# ifndef s6_addr
@@ -83,6 +87,7 @@ static int get_last_error()
bool qjdns_sock_setMulticast4(int s, unsigned long int addr, int *errorCode)
{
+#ifndef Q_OS_HAIKU
int ret;
struct ip_mreq mc;
@@ -98,6 +103,12 @@ bool qjdns_sock_setMulticast4(int s, unsigned long int addr, int *errorCode)
return false;
}
return true;
+#else
+ Q_UNUSED(s);
+ Q_UNUSED(addr);
+ Q_UNUSED(errorCode);
+ return false;
+#endif
}
bool qjdns_sock_setMulticast6(int s, unsigned char *addr, int *errorCode)
@@ -128,6 +139,7 @@ bool qjdns_sock_setMulticast6(int s, unsigned char *addr, int *errorCode)
bool qjdns_sock_setTTL4(int s, int ttl)
{
+#ifndef Q_OS_HAIKU
unsigned char cttl;
int ret, ittl;
@@ -143,6 +155,11 @@ bool qjdns_sock_setTTL4(int s, int ttl)
return false;
}
return true;
+#else
+ Q_UNUSED(s);
+ Q_UNUSED(ttl);
+ return false;
+#endif
}
bool qjdns_sock_setTTL6(int s, int ttl)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 298e845..333753b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -84,7 +84,7 @@ if(LINUX)
endif()
if(HAIKU)
- list(APPEND EXTRA_LIBS root be)
+ list(APPEND EXTRA_LIBS root be network)
endif()
if(USE_ENCHANT)
--
2.16.4

View File

@@ -1,22 +1,22 @@
SUMMARY="A development branch of Psi IM XMPP/Jabber client"
DESCRIPTION="Psi is a cross-platform powerful XMPP/Jabber client (Qt, C++) \
designed for the Jabber power users."
HOMEPAGE="https://psi-plus.com/"
COPYRIGHT="2005-2018, Psi+ Project"
LICENSE="GNU GPL v2"
REVISION="5"
HOMEPAGE="http://psi-plus.com/"
SOURCE_URI="https://github.com/psi-plus/psi-plus-snapshots/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="53e795b97956a8260da9b6b920b5bf9a21c553c26d4504463c25bce906b786aa"
SOURCE_DIR="psi-plus-snapshots-$portVersion"
SOURCE_URI_2="https://github.com/psi-plus/psi-plus-l10n/archive/1.2.156.tar.gz"
CHECKSUM_SHA256_2="2701242e72bd765c4be0f98f82da6688c4d9a01da6c2bfe73e29dbdbc5792ffb"
SOURCE_FILENAME_2="psi-plus-l10n-1.2.156.tar.gz"
SOURCE_DIR_2="psi-plus-l10n-1.2.156"
PATCHES="psi_plus-$portVersion.patchset"
ADDITIONAL_FILES="psi-plus.rdef.in"
CHECKSUM_SHA256="4c6d172b4d3e4475bf129531b6f4b925951a25c3a6e5f6ff6c8172733157905b"
SOURCE_URI_2="https://github.com/psi-plus/psi-plus-l10n/archive/$portVersion.tar.gz"
SOURCE_FILENAME_2="psi-plus-l10n-$portVersion.tar.gz"
SOURCE_DIR_2="psi-plus-l10n-$portVersion"
CHECKSUM_SHA256_2="1c10b1732eb3fd39fe4bf8036ca6a015fcb27b748b5659c5832d39943b2d935a"
REVISION="1"
LICENSE="GNU GPL v2"
COPYRIGHT="2005-2018, Psi+ Project"
ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"
ADDITIONAL_FILES="psi-plus.rdef.in"
PATCHES="psi_plus-$portVersion.patchset"
PROVIDES="
psi_plus$secondaryArchSuffix = $portVersion
@@ -24,26 +24,21 @@ PROVIDES="
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libgcrypt$secondaryArchSuffix
lib:libhunspell_1.6$secondaryArchSuffix
lib:libidn$secondaryArchSuffix
lib:libqca$secondaryArchSuffix
lib:libqt5$secondaryArchSuffix
lib:libqca_qt5$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Network$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:libQt5WebKit$secondaryArchSuffix
lib:libQt5WebKitWidgets$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libgcrypt$secondaryArchSuffix
devel:libhunspell_1.6$secondaryArchSuffix
devel:libidn$secondaryArchSuffix
devel:libotr$secondaryArchSuffix
devel:libqca$secondaryArchSuffix >= 2.1.3
devel:libqt5$secondaryArchSuffix
devel:libQt5WebKit$secondaryArchSuffix
devel:libtidys$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
BUILD_PREREQUIRES="
cmd:cmake
cmd:g++$secondaryArchSuffix
cmd:make
@@ -51,11 +46,30 @@ BUILD_PREREQUIRES="
cmd:pkg_config$secondaryArchSuffix
cmd:which
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix
devel:libgcrypt$secondaryArchSuffix
devel:libhunspell_1.6$secondaryArchSuffix
devel:libidn$secondaryArchSuffix
devel:libotr$secondaryArchSuffix
devel:libqca$secondaryArchSuffix >= 2.1.3
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Network$secondaryArchSuffix
devel:libQt5Widgets$secondaryArchSuffix
devel:libQt5WebKit$secondaryArchSuffix
devel:libQt5WebKitWidgets$secondaryArchSuffix
devel:libtidys$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD()
{
# disable videostatusplugin as it doesn't build
# disable plugins
sed -i 's/videostatusplugin//' src/plugins/generic/CMakeLists.txt
sed -i 's/screenshotplugin//' src/plugins/generic/CMakeLists.txt
sed -i 's/juickplugin//' src/plugins/generic/CMakeLists.txt
ln -sf ../../sources-2/psi-plus-l10n-$portVersion/translations .
@@ -70,9 +84,10 @@ BUILD()
-DCMAKE_BUILD_TYPE=RELEASE \
-DBUNDLED_IRIS=ON \
-DUSE_HUNSPELL=ON \
-DENABLE_WEBKIT=OFF \
-DENABLE_WEBKIT=ON \
-DENABLE_PLUGINS=ON \
-DONLY_PLUGINS=OFF \
-DUSE_QJDNS=ON \
-DBUILD_PLUGINS="ALL"
make $jobArgs
@@ -83,13 +98,11 @@ INSTALL()
cd build
make install
# cleanup
rm -rf $appsDir/Psi-plus/{applications,pixmaps}
# crashes Psi-plus on launch
rm -rf $appsDir/Psi-plus/plugins/libjuickplugin.so
mv -f $appsDir/Psi-plus/data/psi-plus/* $appsDir/Psi-plus
mv $appsDir/Psi-plus/psi-plus $appsDir/Psi-plus/Psi-plus
rm -rf $appsDir/Psi-plus/data
local APP_SIGNATURE="application/x-vnd.Psi-plus"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"