折腾kde-telepathy

今天折腾kde-telepathy遇到了好几个问题,这里记录下。

1、telepathy-qt安装问题,导致net-im/ktp-common-internals-9999编译失败

net-im/ktp-common-internals-9999在编译的时候提示找不到DBusError头文件,这个文件应该由telepathy-qt提供。用equery查看了下telepathy-qt安装的文件,的确没有发现这个目录。因为本机装的telepathy-qt也是9999版本,去本地git源里面clone了一份,发现里面是有这个文件的,仔细查看了TelepathyQt/CMakeLists.txt文件,发现如果要安装DBusError这个头文件,必须在cmake配置的时候开启ENABLE_EXPERIMENTAL_SERVICE_SUPPORT。搜索这个变量,可以发现最外层的CMakeLists.txt文件定义了:
[cce lang="cmake"]
option(ENABLE_EXPERIMENTAL_SERVICE_SUPPORT "Enable compilation of experimental and unstable service side bindings for Telepathy-Qt" FALSE)
[/cce]
然后就是去改ebuild文件了。修改很简单,就是在configure的时候增加这个开关,这里的方式是增加了一个USE:
[cce lang="diff"]
--- /var/lib/layman/kde/net-libs/telepathy-qt/telepathy-qt-9999.ebuild 2012-01-25 12:04:05.791432392 +0800
+++ /usr/local/portage/net-libs/telepathy-qt/telepathy-qt-9999.ebuild 2012-04-06 17:16:13.313718014 +0800
@@ -15,7 +15,7 @@
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS=""
-IUSE="debug farsight glib"
+IUSE="debug farsight glib experimental_service"

RDEPEND="
dev-python/dbus-python
@@ -54,6 +54,7 @@
$(cmake-utils_use_enable debug DEBUG_OUTPUT)
$(cmake-utils_use_with glib)
$(cmake-utils_use_with farsight)
+ $(cmake-utils_use_enable experimental_service EXPERIMENTAL_SERVICE_SUPPORT)
)
cmake-utils_src_configure
}
[/cce]

2、ktp-text-ui编译失败

ktp-text-ui编译的时候提示:
[cce]
usr/include/boost-1_48/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"
automoc4: process for /chroot/local/portage/net-im/ktp-text-ui-9999/work/ktp-text-ui-9999_build/logviewer/moc_entity-model.cpp failed: Unknown error
pid to wait for: 0
returning failed..
[/cce]
的问题,发现这个是qt的moc的问题,已经有相关的bug了:
https://bugs.kde.org/show_bug.cgi?id=296137
https://bugreports.qt-project.org/browse/QTBUG-22829
解决方案参照http://cgit.freedesktop.org/gstreamer/qt-gstreamer/commit/?id=2cc5399d70d4d6caf8d05df9ca51f5448d545b67这里的,给所有提示moc失败的类的头文件上加上Boost相关宏定义BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
具体补丁:
[cce lang="diff"]
diff --git a/logviewer/conversation-date-picker.h b/logviewer/conversation-date-picker.h
index dd177cc..c6e6f26 100644
--- a/logviewer/conversation-date-picker.h
+++ b/logviewer/conversation-date-picker.h
@@ -20,6 +20,11 @@
#ifndef CONVERSATIONDATEPICKER_H
#define CONVERSATIONDATEPICKER_H

+// workaround for https://bugreports.qt-project.org/browse/QTBUG-22829
+#if defined(Q_MOC_RUN) && !defined(BOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
+#define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
+#endif
+
#include <KDatePicker>

#include <TelepathyLoggerQt4/Entity>
diff --git a/logviewer/entity-model.h b/logviewer/entity-model.h
index cd6649e..47050e3 100644
--- a/logviewer/entity-model.h
+++ b/logviewer/entity-model.h
@@ -21,6 +21,11 @@
#ifndef ENTITYMODEL_H
#define ENTITYMODEL_H

+// workaround for https://bugreports.qt-project.org/browse/QTBUG-22829
+#if defined(Q_MOC_RUN) && !defined(BOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
+#define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
+#endif
+
#include <QAbstractListModel>

#include <TelepathyQt/Types>
diff --git a/logviewer/message-view.h b/logviewer/message-view.h
index e4b9b88..e84395f 100644
--- a/logviewer/message-view.h
+++ b/logviewer/message-view.h
@@ -20,6 +20,11 @@
#ifndef MESSAGEVIEW_H
#define MESSAGEVIEW_H

+// workaround for https://bugreports.qt-project.org/browse/QTBUG-22829
+#if defined(Q_MOC_RUN) && !defined(BOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
+#define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
+#endif
+
#include "adium-theme-view.h"

#include <QDate>
[/cce]
自己改下ebuild文件,打上这个补丁就OK了。

另外还有一个问题,就是msn用xmpp方式连接,总是提示network error,无法连接到messenger.live.com,找到http://blogs.fsfe.org/drdanz/?p=632&cpage=1#comment-14534 这篇博客的评论。但是gentoo仓库最新的telepathy-gabble只有0.14.1,还得自己写ebuild,明天再说了。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据