# Twinkle installieren trotz qt4 etc.

## jodalein

Hi,

ich habe es inzwischen hinbekommen Twinkle wieder benutzbar zu machen unter einem aktuellem System.

Ich poste hier auch mal alle Patches die zusätzlich benötigt werden.

System:

gentoo x64

Kernel: 3.17.4 

GCC 4.8.4

qt 4.8.6

X = lxde

Anleitung:

Abhängigkeiten: 

qt-meta 3.3.8b

>=net-libs/ccrtp-1.6.0

ln -s /usr/lib64/pkgconfig/libccrtp.pc /usr/lib64/pkgconfig/libccrtp1.pc

qt-meta

http://gpo.zugaina.org/x11-libs/qt-meta

qt-meta-3.3.8b-r4.ebuild

```

--- qt-meta-3.3.8b-r3.ebuild    2013-02-21 17:10:56.000000000 +0100

+++ qt-meta-3.3.8b-r4.ebuild    2015-01-14 10:43:15.305488354 +0100

@@ -180,6 +180,12 @@

        sed -i -e "s:CXXFLAGS.*=:CXXFLAGS=${CXXFLAGS} :" \

                   -e "s:LFLAGS.*=:LFLAGS=${LDFLAGS} :" \

                "${S}"/qmake/Makefile.unix || die

+

+    # error: 'ptrdiff_t' does not name a type

+    epatch "${FILESDIR}"/qt-3.3.8b-gcc-4.6-ptrdiff_t.patch

+    # Fix detection of >=freetype-2.5.1

+    epatch "${FILESDIR}"/qt-3.3.8b-freetype251.patch

+

 }
```

qt-3.3.8b-freetype251.patch

```
--- qt-x11-free-3.3.8b/config.tests/x11/xfreetype.test

+++ qt-x11-free-3.3.8b/config.tests/x11/xfreetype.test

@@ -116,29 +116,32 @@

 # check for freetype2 headers

 FREETYPE2_INCDIR=

 if [ "$XFT" = "yes" ]; then

-    INC="freetype2/freetype/freetype.h"

+    INC_OLD="freetype2/freetype/freetype.h"

+    INC_NEW="freetype2/freetype.h"

     XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[      ]*=/ { s/[^=]*=[         ]*//; s/-I/ /g; p; }' $XCONFIG`

     LDIRS=`sed -n -e '/^QMAKE_INCDIR[  ]*=/ { s/[^=]*=[         ]*//; s/-I/ /g; p; }' $XCONFIG`

     INCDIRS="$IN_INCDIRS $XDIRS $LDIRS /usr/include /include"

     F=

     for INCDIR in $INCDIRS; do

-       if [ -f $INCDIR/$INC ]; then

-           # detect major version of freetype2

-           FREETYPE_MAJOR=`grep "#define FREETYPE_MAJOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`

-           FREETYPE_MINOR=`grep "#define FREETYPE_MINOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`

-           FREETYPE_PATCH=`grep "#define FREETYPE_PATCH" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`

-           test -z "$FREETYPE_PATCH" && FREETYPE_PATCH="0"

-           [ "$VERBOSE" = "yes" ] && \

-               echo "  Found Freetype version $FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH"

-           if [ "$FREETYPE_MAJOR" -eq "2" ] \

-               && [ "$FREETYPE_MINOR" -ge "0" -a "$FREETYPE_PATCH" -ge "9" ] \

-               || [ "$FREETYPE_MINOR" -ge "1" ]; then

-               F=yes

-               FREETYPE2_INCDIR=$INCDIR/freetype2

-               [ "$VERBOSE" = "yes" ] && echo "  Found $INC in $INCDIR"

-               break

+       for INC in $INC_OLD $INC_NEW; do

+           if [ -f $INCDIR/$INC ]; then

+               # detect major version of freetype2

+               FREETYPE_MAJOR=`grep "#define FREETYPE_MAJOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`

+               FREETYPE_MINOR=`grep "#define FREETYPE_MINOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`

+               FREETYPE_PATCH=`grep "#define FREETYPE_PATCH" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`

+               test -z "$FREETYPE_PATCH" && FREETYPE_PATCH="0"

+               [ "$VERBOSE" = "yes" ] && \

+                   echo "  Found Freetype version $FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH"

+               if [ "$FREETYPE_MAJOR" -eq "2" ] \

+                  && [ "$FREETYPE_MINOR" -ge "0" -a "$FREETYPE_PATCH" -ge "9" ] \

+                  || [ "$FREETYPE_MINOR" -ge "1" ]; then

+                   F=yes

+                   FREETYPE2_INCDIR=$INCDIR/freetype2

+                   [ "$VERBOSE" = "yes" ] && echo "  Found $INC in $INCDIR"

+                   break

+               fi

            fi

-       fi

+       done

     done

     if [ -z "$F" ]; then

        XFT=no
```

qt-3.3.8b-gcc-4.6-ptrdiff_t.patch

```
--- qt-x11-free-3.3.8b/src/tools/qvaluelist.h 2012-10-29 20:59:03.000000000 +0100

+++ qt-x11-free-3.3.8b/src/tools/qvaluelist.h 2012-10-29 20:44:41.000000000 +0100

@@ -52,6 +52,8 @@

 #include <list>

 #endif

+#include <stddef.h>

+

 //#define QT_CHECK_VALUELIST_RANGE

 #if defined(Q_CC_MSVC)
```

ccrtp

>=net-libs/ccrtp-1.6.0

ccrtp unter 2.0.9 lässt sich nicht mehr installieren. 

Twinkle benötigt zum emergen aber libccrtp1.pc diese existiert in der 2.0.9 nicht mehr.

In einem freebsd Forum bin dann auf den Tipp gestoßen einfach einen link zur aktuellen libccrtp.pc  zu setzen.

```
ln -s /usr/lib64/pkgconfig/libccrtp.pc /usr/lib64/pkgconfig/libccrtp1.pc
```

Twinkle

http://gpo.zugaina.org/net-voip/twinkle

twinkle-1.4.2-r1.ebuild 

```
--- twinkle-1.4.2.ebuild        2013-06-06 10:47:35.000000000 +0200

+++ twinkle-1.4.2-r1.ebuild     2015-01-14 10:48:19.437214032 +0100

@@ -28,6 +28,7 @@

 

 src_prepare() {

        epatch "${FILESDIR}"/${PN}-1.4.1-kdedetect.patch

+       epatch "${FILESDIR}"/log.cpp.patch

        eautoreconf

 }
```

log.cpp.patch

```
--- src/log.cpp_orig    2015-01-14 06:48:01.899915921 +0100

+++ src/log.cpp 2015-01-14 06:48:24.229916248 +0100

@@ -161,7 +161,7 @@

        gettimeofday(&t, NULL);

        date = t.tv_sec;

-       localtime_r(&date, &tm);

+       ost::localtime_r(&date, &tm);

        *log_stream << "+++ ";

        *log_stream << tm.tm_mday;
```

damit lässt sich nun der schöne Twinkle wieder installieren.

----------

## vktRus

Wow. Nice!

How to compile on Ubuntu 14.04.1 64bit?

----------

## jodalein

 *vktRus wrote:*   

> Wow. Nice!
> 
> How to compile on Ubuntu 14.04.1 64bit?

 

I can't answer  :Smile:  we only use Gentoo Systems at work.

----------

## jodalein

Hi,

ich habe gerade den ersten sauberen Port von Twinkle zu qt4/5 gefunden und er mach noch mehr arbeiten am Client.

http://twinkle.dolezel.info/

https://github.com/LubosD/twinkle

Ehre, wem Ehre gebührt!!!

----------

## jodalein

Habe mit dem Entwickler ein paar bugs behoben und es sind ein paar neue Features dabei.

```

# Copyright 1999-2015 Gentoo Foundation 

# Distributed under the terms of the GNU General Public License v2

# $Header: 

EAPI="5"

inherit  cmake-utils  git-r3 

DESCRIPTION="Softphone for VoIP communcations using SIP protocol"

HOMEPAGE="http://twinkle.dolezel.info/"

EGIT_REPO_URI="https://github.com/lubosd/twinkle.git"

LICENSE="GPL-2"

SLOT="0"

IUSE="alsa diamondcard g729 ilbc speex +qt4 qt5 zrtp"

RDEPEND="media-libs/fontconfig

   dev-libs/boost

   speex? ( media-libs/speex )

   ilbc? ( dev-libs/ilbc-rfc3951 )

   zrtp? ( net-libs/libzrtpcpp )

    g729? ( media-plugins/mediastreamer-bcg729 )

   alsa? (   media-libs/alsa-lib )

   dev-cpp/commoncpp2

   dev-libs/ucommon

   media-libs/libsndfile

   "

REQUIRED_USE="

    ?? ( qt4 qt5 )

"

src_configure() {

 local mycmakeargs=(

    -DCMAKE_INSTALL_PREFIX=/usr/local

   $(cmake-utils_use_with alsa ALSA)  

   $(cmake-utils_use_with speex SPEEX)  

   $(cmake-utils_use_with ilbc ILBC)  

   $(cmake-utils_use_with zrtp ZRTP)  

    $(cmake-utils_use_with qt4 QT4)  

   $(cmake-utils_use_with qt5 QT5)  

   $(cmake-utils_use_with diamondcard DIAMONDCARD)  

   $(cmake-utils_use_with g729 G729)

   )

   cmake-utils_src_configure

}

S="${WORKDIR}"/${P}

```

----------

