Psi-plus: bump version

This commit is contained in:
Gerasim Troeglazov
2019-03-26 22:16:16 +10:00
parent 82d0b72c90
commit e48c1ce206
3 changed files with 93 additions and 929 deletions

View File

@@ -1,921 +0,0 @@
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 db00db2..a4eb14b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cffc745..7250acc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -487,6 +487,27 @@ if(LINUX)
endif()
endif()
+if(HAIKU)
+ if(IS_PSIPLUS)
+ set(SHARE_SUFF "data/psi-plus")
+ install(FILES ${PROJECT_SOURCE_DIR}/psi.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/data/applications RENAME psi-plus.desktop)
+ install(FILES ${PROJECT_SOURCE_DIR}/iconsets/system/default/psiplus/logo_128.png DESTINATION ${CMAKE_INSTALL_PREFIX}/data/pixmaps RENAME psi-plus.png)
+ else()
+ set(SHARE_SUFF "data/psi")
+ install(FILES ${PROJECT_SOURCE_DIR}/psi.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/data/applications)
+ install(FILES ${PROJECT_SOURCE_DIR}/iconsets/system/default/logo_128.png DESTINATION ${CMAKE_INSTALL_PREFIX}/data/pixmaps RENAME psi.png)
+ endif()
+ install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX})
+ install(FILES ${PROJECT_SOURCE_DIR}/client_icons.txt DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF})
+ install(DIRECTORY ${OTHER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF})
+ if(ENABLE_WEBKIT)
+ install(DIRECTORY ${PROJECT_SOURCE_DIR}/themes DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF})
+ endif()
+ if(LANGS_EXISTS)
+ install(FILES ${QM} DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF}/translations)
+ endif()
+endif()
+
if(WIN32)
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 dcff9d9..548d732 100644
--- a/src/applicationinfo.cpp
+++ b/src/applicationinfo.cpp
@@ -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();
#elif defined(Q_OS_MAC)
// 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;
#else
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();
diff --git a/src/libpsi/tools/CMakeLists.txt b/src/libpsi/tools/CMakeLists.txt
index 183a518..974538f 100644
--- a/src/libpsi/tools/CMakeLists.txt
+++ b/src/libpsi/tools/CMakeLists.txt
@@ -136,6 +136,22 @@ elseif(WIN32)
# spellchecker
spellchecker/hunspellchecker.cpp
)
+elseif(HAIKU)
+ list(APPEND HEADERS
+ # systemwatch
+ systemwatch/systemwatch_unix.h
+ )
+
+ list(APPEND PLAIN_SOURCES
+ #idle
+ idle/idle_x11.cpp
+
+ # systemwatch
+ systemwatch/systemwatch_unix.cpp
+
+ # globalshortcut
+ globalshortcut/globalshortcutmanager_haiku.cpp
+ )
else()
list(APPEND HEADERS
# systemwatch
diff --git a/src/libpsi/tools/globalshortcut/globalshortcut.pri b/src/libpsi/tools/globalshortcut/globalshortcut.pri
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
SOURCES += $$PWD/globalshortcutmanager.cpp
DEPENDPATH += $$PWD
-unix:!mac {
+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..5c90064
--- /dev/null
+++ b/src/libpsi/tools/globalshortcut/globalshortcutmanager_haiku.cpp
@@ -0,0 +1,336 @@
+/*
+ * globalshortcutmanager_haiku.cpp - Haiku implementation of global shortcuts by Vitaly (Diger)
+ * Based on X11 implementation of global shortcuts
+ * Copyright (C) 2003-2006 Justin Karneges, Maciej Niedzielski
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "globalshortcutmanager.h"
+#include "globalshortcuttrigger.h"
+
+#include <InterfaceDefs.h>
+
+#include <QWidget>
+#include <QKeyEvent>
+#include <QCoreApplication>
+#ifdef HAVE_QT5
+# include <QAbstractNativeEventFilter>
+# include <QApplication>
+#endif
+
+class HKeyTrigger
+{
+public:
+ virtual ~HKeyTrigger() {}
+ virtual void activate() = 0;
+ virtual bool isAccepted(int qkey) const = 0;
+};
+
+class HKeyTriggerManager : public QObject
+{
+public:
+ static HKeyTriggerManager* instance()
+ {
+ if(!instance_)
+ instance_ = new HKeyTriggerManager();
+ return instance_;
+ }
+
+ void addTrigger(HKeyTrigger* trigger)
+ {
+ triggers_ << trigger;
+ }
+
+ void removeTrigger(HKeyTrigger* trigger)
+ {
+ triggers_.removeAll(trigger);
+ }
+
+ struct Qt_HK_Keygroup
+ {
+ char num;
+ int sym[3];
+ };
+
+protected:
+ // reimplemented
+ bool eventFilter(QObject* o, QEvent* e)
+ {
+ if(e->type() == QEvent::KeyPress) {
+ QKeyEvent* k = static_cast<QKeyEvent*>(e);
+ int qkey = k->key();
+ if (k->modifiers() & Qt::ShiftModifier)
+ qkey |= Qt::SHIFT;
+ if (k->modifiers() & Qt::ControlModifier)
+ qkey |= Qt::CTRL;
+ if (k->modifiers() & Qt::AltModifier)
+ qkey |= Qt::ALT;
+ if (k->modifiers() & Qt::MetaModifier)
+ qkey |= Qt::META;
+
+ foreach(HKeyTrigger* trigger, triggers_) {
+ if (trigger->isAccepted(qkey)) {
+ trigger->activate();
+ return true;
+ }
+ }
+ }
+
+ return QObject::eventFilter(o, e);
+ }
+
+private:
+ HKeyTriggerManager()
+ : QObject(QCoreApplication::instance())
+ {
+ QCoreApplication::instance()->installEventFilter(this);
+ }
+
+ static HKeyTriggerManager* instance_;
+ QList<HKeyTrigger*> triggers_;
+
+private:
+ struct Qt_HK_Keymap
+ {
+ int key;
+ Qt_HK_Keygroup hk;
+ };
+
+ static Qt_HK_Keymap qt_hk_table[];
+ static long alt_mask;
+ static long meta_mask;
+ static long super_mask;
+ static long hyper_mask;
+ static long numlock_mask;
+ static bool haveMods;
+
+ // adapted from qapplication_x11.cpp
+ static void ensureModifiers()
+ {
+ if (haveMods)
+ return;
+ }
+
+public:
+ static bool convertKeySequence(const QKeySequence& ks, unsigned int* _mod, Qt_HK_Keygroup* _kg)
+ {
+ int code = ks[0];
+ ensureModifiers();
+
+ unsigned int mod = 0;
+ /*
+ if (code & Qt::META)
+ mod |= meta_mask;
+ if (code & Qt::SHIFT)
+ mod |= ShiftMask;
+ if (code & Qt::CTRL)
+ mod |= ControlMask;
+ if (code & Qt::ALT)
+ mod |= alt_mask;
+ */
+ Qt_HK_Keygroup kg;
+ kg.num = 0;
+ kg.sym[0] = 0;
+ code &= ~Qt::KeyboardModifierMask;
+
+ bool found = false;
+ for (int n = 0; qt_hk_table[n].key != Qt::Key_unknown; ++n) {
+ if (qt_hk_table[n].key == code) {
+ kg = qt_hk_table[n].hk;
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ // try latin1
+ if (code >= 0x20 && code <= 0x7f) {
+ kg.num = 1;
+ kg.sym[0] = code;
+ }
+ }
+
+ if (!kg.num)
+ return false;
+
+ if (_mod)
+ *_mod = mod;
+ if (_kg)
+ *_kg = kg;
+
+ return true;
+ }
+
+ static QList<long> ignModifiersList()
+ {
+ QList<long> ret;
+ /*
+ if (numlock_mask) {
+ ret << 0 << LockMask << numlock_mask << (LockMask | numlock_mask);
+ }
+ else {
+ ret << 0 << LockMask;
+ }
+ */
+ return ret;
+ }
+};
+
+
+HKeyTriggerManager* HKeyTriggerManager::instance_ = NULL;
+class GlobalShortcutManager::KeyTrigger::Impl : public HKeyTrigger
+{
+private:
+ KeyTrigger* trigger_;
+ int qkey_;
+
+ struct GrabbedKey {
+ int code;
+ uint mod;
+ };
+ QList<GrabbedKey> grabbedKeys_;
+
+ static bool failed;
+
+public:
+ /**
+ * Constructor registers the hotkey.
+ */
+ Impl(GlobalShortcutManager::KeyTrigger* t, const QKeySequence& ks)
+ : trigger_(t)
+ , qkey_(ks[0])
+ {
+ HKeyTriggerManager::instance()->addTrigger(this);
+
+ HKeyTriggerManager::Qt_HK_Keygroup kg;
+ unsigned int mod;
+ }
+
+ /**
+ * Destructor unregisters the hotkey.
+ */
+ ~Impl()
+ {
+ HKeyTriggerManager::instance()->removeTrigger(this);
+
+ }
+
+ void activate()
+ {
+ emit trigger_->triggered();
+ }
+
+ bool isAccepted(int qkey) const
+ {
+ return qkey_ == qkey;
+ }
+};
+
+bool GlobalShortcutManager::KeyTrigger::Impl::failed;
+long HKeyTriggerManager::alt_mask = 0;
+long HKeyTriggerManager::meta_mask = 0;
+long HKeyTriggerManager::super_mask = 0;
+long HKeyTriggerManager::hyper_mask = 0;
+long HKeyTriggerManager::numlock_mask = 0;
+bool HKeyTriggerManager::haveMods = false;
+
+
+HKeyTriggerManager::Qt_HK_Keymap
+HKeyTriggerManager::qt_hk_table[] = {
+ { Qt::Key_Escape, {1, { B_ESCAPE }}},
+ { Qt::Key_Tab, {1, { B_TAB }}},
+ { Qt::Key_Backtab, {0, { 0 }}},
+ { Qt::Key_Backspace, {1, { B_BACKSPACE }}},
+ { Qt::Key_Return, {1, { B_RETURN }}},
+ { Qt::Key_Enter, {1, { B_ENTER }}},
+ { Qt::Key_Insert, {1, { B_INSERT }}},
+ { Qt::Key_Delete, {1, { B_DELETE }}},
+ { Qt::Key_Pause, {1, { B_PAUSE_KEY }}},
+ { Qt::Key_Print, {1, { B_PRINT_KEY }}},
+ { Qt::Key_SysReq, {0, { 0 }}},
+ //{ Qt::Key_Clear, B_CLEAR_KEY},
+ { Qt::Key_Home, {1, { B_HOME }}},
+ { Qt::Key_End, {1, { B_END }}},
+ { Qt::Key_Left, {1, { B_LEFT_ARROW }}},
+ { Qt::Key_Up, {1, { B_UP_ARROW }}},
+ { Qt::Key_Right, {1, { B_RIGHT_ARROW }}},
+ { Qt::Key_Down, {1, { B_DOWN_ARROW }}},
+ { Qt::Key_PageUp, {1, { B_PAGE_UP }}},
+ { Qt::Key_PageDown, {1, { B_PAGE_DOWN }}},
+ { Qt::Key_Shift, {1, { B_SHIFT_KEY }}},
+ { Qt::Key_Control, {1, { B_CONTROL_KEY }}},
+ { Qt::Key_Meta, {1, { B_LEFT_OPTION_KEY }}},
+ { Qt::Key_Alt, {1, { B_MENU_KEY }}},
+ { Qt::Key_CapsLock, {1, { B_CAPS_LOCK }}},
+ { Qt::Key_NumLock, {1, { B_NUM_LOCK }}},
+ { Qt::Key_ScrollLock, {1, { B_SCROLL_KEY }}},
+ { Qt::Key_F1, {1, { B_F1_KEY }}},
+ { Qt::Key_F2, {1, { B_F2_KEY }}},
+ { Qt::Key_F3, {1, { B_F3_KEY }}},
+ { Qt::Key_F4, {1, { B_F4_KEY }}},
+ { Qt::Key_F5, {1, { B_F5_KEY }}},
+ { Qt::Key_F6, {1, { B_F6_KEY }}},
+ { Qt::Key_F7, {1, { B_F7_KEY }}},
+ { Qt::Key_F8, {1, { B_F8_KEY }}},
+ { Qt::Key_F9, {1, { B_F9_KEY }}},
+ { Qt::Key_F10, {1, { B_F10_KEY }}},
+ { Qt::Key_F11, {1, { B_F11_KEY }}},
+ { Qt::Key_F12, {1, { B_F12_KEY }}},
+ { Qt::Key_F13, {0, { 0 }}},
+ { Qt::Key_F14, {0, { 0 }}},
+ { Qt::Key_F15, {0, { 0 }}},
+ { Qt::Key_F16, {0, { 0 }}},
+ { Qt::Key_F17, {0, { 0 }}},
+ { Qt::Key_F18, {0, { 0 }}},
+ { Qt::Key_F19, {0, { 0 }}},
+ { Qt::Key_F20, {0, { 0 }}},
+ { Qt::Key_F21, {0, { 0 }}},
+ { Qt::Key_F22, {0, { 0 }}},
+ { Qt::Key_F23, {0, { 0 }}},
+ { Qt::Key_F24, {0, { 0 }}},
+ { Qt::Key_F25, {0, { 0 }}},
+ { Qt::Key_F26, {0, { 0 }}},
+ { Qt::Key_F27, {0, { 0 }}},
+ { Qt::Key_F28, {0, { 0 }}},
+ { Qt::Key_F29, {0, { 0 }}},
+ { Qt::Key_F30, {0, { 0 }}},
+ { Qt::Key_F31, {0, { 0 }}},
+ { Qt::Key_F32, {0, { 0 }}},
+ { Qt::Key_F33, {0, { 0 }}},
+ { Qt::Key_F34, {0, { 0 }}},
+ { Qt::Key_F35, {0, { 0 }}},
+ { Qt::Key_Super_L, {0, { 0 }}},
+ { Qt::Key_Super_R, {0, { 0 }}},
+ { Qt::Key_Menu, {0, { 0 }}},
+ { Qt::Key_Hyper_L, {0, { 0 }}},
+ { Qt::Key_Hyper_R, {0, { 0 }}},
+ { Qt::Key_Help, {0, { 0 }}},
+ { Qt::Key_Direction_L, {0, { 0 }}},
+ { Qt::Key_Direction_R, {0, { 0 }}},
+
+ { Qt::Key_unknown, {0, { 0 }}},
+};
+GlobalShortcutManager::KeyTrigger::KeyTrigger(const QKeySequence& key)
+{
+ d = new Impl(this, key);
+}
+
+GlobalShortcutManager::KeyTrigger::~KeyTrigger()
+{
+ 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 5b29281..b2d5fb9 100644
--- a/src/plugins/generic/screenshotplugin/CMakeLists.txt
+++ b/src/plugins/generic/screenshotplugin/CMakeLists.txt
@@ -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 )
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}
diff --git a/src/plugins/generic/videostatusplugin/CMakeLists.txt b/src/plugins/generic/videostatusplugin/CMakeLists.txt
index 05115a1..b49cf82 100644
--- a/src/plugins/generic/videostatusplugin/CMakeLists.txt
+++ b/src/plugins/generic/videostatusplugin/CMakeLists.txt
@@ -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 )
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
)
@@ -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(
diff --git a/src/plugins/generic/videostatusplugin/videostatusplugin.cpp b/src/plugins/generic/videostatusplugin/videostatusplugin.cpp
old mode 100755
new mode 100644
index 4b36af2..df8afd6
--- a/src/plugins/generic/videostatusplugin/videostatusplugin.cpp
+++ b/src/plugins/generic/videostatusplugin/videostatusplugin.cpp
@@ -648,6 +648,8 @@ void VideoStatusChanger::fullSTTimeout()
XFree(data);
#elif defined (Q_OS_WIN)
bool full = isFullscreenWindow();
+#elif defined (Q_OS_HAIKU)
+ bool full = false;
#endif
if(full) {
if(!isStatusSet) {
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 c3fd6d6..f29acda 100644
--- a/src/src.cmake
+++ b/src/src.cmake
@@ -238,7 +238,7 @@ list(APPEND SOURCES
xdata_widget.cpp
)
-if(UNIX AND NOT APPLE)
+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
+ )
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()
+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.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

@@ -0,0 +1,69 @@
From dd8ea6aef2ada1c6f0b7f0a7cb58690eb757ea6d Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Tue, 26 Mar 2019 19:20:22 +1000
Subject: Fix build for Haiku
diff --git a/src/libpsi/tools/systemwatch/systemwatch_unix.h b/src/libpsi/tools/systemwatch/systemwatch_unix.h
index 992f1b5..9016efc 100644
--- a/src/libpsi/tools/systemwatch/systemwatch_unix.h
+++ b/src/libpsi/tools/systemwatch/systemwatch_unix.h
@@ -19,6 +19,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/popupmanager.cpp b/src/popupmanager.cpp
index 0416b95..4881e41 100644
--- a/src/popupmanager.cpp
+++ b/src/popupmanager.cpp
@@ -27,6 +27,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 10ca94a..0fabb4c 100644
--- a/src/psicon.cpp
+++ b/src/psicon.cpp
@@ -130,6 +130,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/tools/tunecontroller/tunecontrollermanager.cpp b/src/tools/tunecontroller/tunecontrollermanager.cpp
index 88157e4..1ed70f0 100644
--- a/src/tools/tunecontroller/tunecontrollermanager.cpp
+++ b/src/tools/tunecontroller/tunecontrollermanager.cpp
@@ -24,6 +24,10 @@
#include <QtCore>
#include <QPluginLoader>
+#ifdef __HAIKU__
+#undef USE_DBUS
+#endif
+
#include "tunecontroller.h"
#include "tunecontrollermanager.h"
#include "tunecontrollerplugin.h"
--
2.19.1

View File

@@ -2,16 +2,21 @@ 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"
COPYRIGHT="2005-2019, Psi+ Project"
LICENSE="GNU GPL v2"
REVISION="3"
REVISION="1"
SOURCE_URI="https://github.com/psi-plus/psi-plus-snapshots/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="4c6d172b4d3e4475bf129531b6f4b925951a25c3a6e5f6ff6c8172733157905b"
CHECKSUM_SHA256="e46026cdb37cdff91b1f56067e2fb448a87e36c1fea89590006ede57347ccbdd"
SOURCE_DIR="psi-plus-snapshots-$portVersion"
SOURCE_URI_2="https://github.com/psi-plus/psi-plus-l10n/archive/$portVersion.tar.gz"
CHECKSUM_SHA256_2="1c10b1732eb3fd39fe4bf8036ca6a015fcb27b748b5659c5832d39943b2d935a"
CHECKSUM_SHA256_2="b5df119c0c13dde126be2925a59cb4e1db4269381426c1313b2f8471acbf4f7e"
SOURCE_FILENAME_2="psi-plus-l10n-$portVersion.tar.gz"
SOURCE_DIR_2="psi-plus-l10n-$portVersion"
spcVersion="2.3.2"
SOURCE_URI_3="https://github.com/signalapp/libsignal-protocol-c/archive/v$spcVersion.tar.gz"
CHECKSUM_SHA256_3="f3826f3045352e14027611c95449bfcfe39bfd3d093d578c70f70eee0c85000d"
SOURCE_FILENAME_3="libsignal-protocol-c-$spcVersion.tar.gz"
SOURCE_DIR_3="libsignal-protocol-c-$spcVersion"
PATCHES="psi_plus-$portVersion.patchset"
ADDITIONAL_FILES="psi-plus.rdef.in"
@@ -59,18 +64,28 @@ BUILD_REQUIRES="
BUILD_PREREQUIRES="
cmd:cmake
cmd:g++$secondaryArchSuffix
cmd:lrelease$secondaryArchSuffix
cmd:make
cmd:patch
cmd:pkg_config$secondaryArchSuffix
cmd:which
"
PATCH()
{
# disable screenshotplugin plugin
sed -i 's/screenshotplugin//' src/plugins/generic/CMakeLists.txt
}
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
cd $sourceDir3
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$sourceDir/libsignal-protocol-c
make $jobArgs
make install
cd $sourceDir
ln -sf ../../sources-2/psi-plus-l10n-$portVersion/translations .
@@ -81,6 +96,7 @@ BUILD()
-DCMAKE_INSTALL_BINDIR:PATH=$appsDir/Psi-plus \
-DCMAKE_INSTALL_LIBDIR:PATH=$appsDir/Psi-plus/lib \
-DCMAKE_INSTALL_DATAROOTDIR:PATH=$appsDir/Psi-plus \
-DSIGNAL_PROTOCOL_C_ROOT:PATH=$sourceDir/libsignal-protocol-c \
-DPLUGINS_PATH=plugins \
-DCMAKE_BUILD_TYPE=RELEASE \
-DBUNDLED_IRIS=ON \