[SyncEvolution] building with Qt5

Ove Kåven ovek at arcticnet.no
Mon Jan 13 13:49:08 UTC 2014


Well, I'm trying to build a GUI for Sailfish, which is Qt5-based. But 
Qt5 is not really supported by SyncEvolution. Although I've added some 
workarounds in the backends, it would probably be nice if Qt5 was more 
directly supported by the build system.

Most importantly, perhaps, is that I'm not sure how to cleanly build the 
Qt D-Bus bindings. For example, syncevolution-qt-dbus.pc should contain 
"Requires: Qt5DBus" instead of "QtDBus". What's the least hackish way to 
achieve that?

The build patches I've had to make so far include, with comments:

> --- a/src/backends/kcalextended/configure-sub.in
> +++ b/src/backends/kcalextended/configure-sub.in
> @@ -13,5 +13,6 @@ SE_ARG_ENABLE_BACKEND(kcalextended,
>
>  if test "$enable_kcalextended" = "yes"; then
>          AC_DEFINE(ENABLE_KCALEXTENDED, 1, [KCalExtended available])
> -        PKG_CHECK_MODULES(KCALEXTENDED, libmkcal libkcalcoren)
> +        PKG_CHECK_MODULES(KCALEXTENDED, libmkcal-qt5 libkcalcoren-qt5 Qt5Core,,
> +          [PKG_CHECK_MODULES(KCALEXTENDED, libmkcal libkcalcoren)])
>  fi

(Fairly straightforward, but the Qt5Core part would probably not be 
needed if the build system supported Qt5)

> --- a/src/backends/qtcontacts/configure-sub.in
> +++ b/src/backends/qtcontacts/configure-sub.in
> @@ -13,11 +13,11 @@ SE_ARG_ENABLE_BACKEND(qtcontacts,
>
>  if test "$enable_qtcontacts" = "yes"; then
>          AC_DEFINE(ENABLE_QTCONTACTS, 1, [QtContacts available])
> -        # AC_WITH_QT() will be called in configure-post if need_qt_modules is not empty,
> -        # setting QT_* flags.
> -        need_qt_modules="$need_qt_modules +gui" # GUI needed for QVersit
> -        qt_config="$qt_config +mobility"
> -        qt_misc="$qt_misc
> -MOBILITY += contacts versit"
> +        PKG_CHECK_MODULES(QT_CONTACTS, Qt5Contacts Qt5Versit,,[
> +          # AC_WITH_QT() will be called in configure-post if need_qt_modules is not empty,
> +          # setting QT_* flags.
> +          need_qt_modules="$need_qt_modules +gui" # GUI needed for QVersit
> +          qt_config="$qt_config +mobility"
> +          qt_misc="$qt_misc
> +MOBILITY += contacts versit"])
>  fi
> -AC_SUBST(QT_CONTACTS_LIBS)
> --- a/src/backends/qtcontacts/qtcontacts.am
> +++ b/src/backends/qtcontacts/qtcontacts.am
> @@ -19,4 +19,4 @@ src_backends_qtcontacts_syncqtcontacts_la_DEPENDENCIES = src/syncevo/libsyncevol
>  # Allow Qt to set some compile flags, but not the ones normally set via configure.
>  # In particular -W is not compatible with the SyncEvolution header files (we have
>  # unused parameters in some inline functions).
> -src_backends_qtcontacts_syncqtcontacts_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS)) $(SYNCEVO_WFLAGS)
> +src_backends_qtcontacts_syncqtcontacts_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(QT_CONTACTS_CFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS)) $(SYNCEVO_WFLAGS)

(The AC_SUBST is removed because presumably the new PKG_CHECK_MODULES 
already does that)

And some bugfixes for the Qt bindings:

> --- a/src/dbus/qt/qt.am
> +++ b/src/dbus/qt/qt.am
> @@ -69,7 +69,7 @@ src/dbus/qt/syncevo-%-full.cpp src/dbus/qt/syncevo-%-full.h: src/dbus/qt/stamp-%
>
>  # work around #ifndef SYNCEVO-SERVER-FULL_H_1305547804 bug
>  src/dbus/qt/stamp-%: $(top_srcdir)/src/dbus/interfaces/syncevo-%-full.xml
> -       $(AM_V_at)@QDBUSXML_TO_CPP@ -p src/dbus/qt/syncevo-$*-full -i src/dbus/qt/dbustypes.h $< \
> +       $(AM_V_at)@QDBUSXML_TO_CPP@ -p src/dbus/qt/syncevo-$*-full -i dbustypes.h $< \
>         && perl -pi -e 's/SYNCEVO-(\w*)-FULL_H/SYNCEVO_$$1_FULL_H/' src/dbus/qt/syncevo-$*-full.* \
>         && echo 'timestamp' >$@
>

(The -i is for generating the #include, and using the source path 
doesn't work for installed files)

> --- a/src/dbus/interfaces/syncevo-connection-full.xml
> +++ b/src/dbus/interfaces/syncevo-connection-full.xml
> @@ -102,8 +102,8 @@
>              "URL" - the URL for an HTTP POST.
>            </doc:summary>
>          </doc:doc>
> -        <annotation name="com.trolltech.QtDBus.QtTypeName.In2" value="QStringMap"/>
>        </arg>
> +      <annotation name="com.trolltech.QtDBus.QtTypeName.In2" value="QStringMap"/>
>
>        <arg type="b" name="final">
>          <doc:doc>
> --- a/src/dbus/interfaces/syncevo-server-full.xml
> +++ b/src/dbus/interfaces/syncevo-server-full.xml
> @@ -129,8 +129,8 @@
>              "system" - some plain text information about system libraries,
>              "backends" - available backend libraries
>          </doc:summary></doc:doc>
> -        <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QStringMap"/>
>        </arg>
> +      <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QStringMap"/>
>      </method>
>
>      <method name="Attach">
> @@ -585,8 +585,8 @@
>              version of the transport entity.
>            </doc:summary>
>          </doc:doc>
> -        <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QStringMap"/>
>        </arg>
> +      <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QStringMap"/>
>        <arg type="b" name="must_authenticate" direction="in">
>          <doc:doc>
>            <doc:summary>
> --- a/src/dbus/interfaces/syncevo-session-full.xml
> +++ b/src/dbus/interfaces/syncevo-session-full.xml
> @@ -345,8 +345,8 @@
>        </arg>
>        <arg type="a{ss}" name="vars" direction="in">
>          <doc:doc><doc:summary>Environment variables in clients</doc:summary></doc:doc>
> -        <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="QStringMap"/>
>        </arg>
> +      <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="QStringMap"/>
>      </method>
>
>      <signal name="StatusChanged">

(The annotations can't be inside the args, the xml-to-c++ tool doesn't 
recognize them there.)
_______________________________________________
SyncEvolution mailing list
SyncEvolution at syncevolution.org
https://lists.syncevolution.org/mailman/listinfo/syncevolution



More information about the SyncEvolution mailing list