twinkle: fix build (fixes #3673)

Pulled patches from Debian and hacked around linking errors.
I'm able to ring my mobile phone now.
However, on exit the process is stuck and needs kill -9.

CC: maintainer @MarcWeber.
This commit is contained in:
Vladimír Čunát 2014-08-20 21:27:43 +02:00
parent 128039217e
commit c198a36898
6 changed files with 145 additions and 15 deletions

View File

@ -0,0 +1,17 @@
Index: twinkle-1.4.2/configure.in
===================================================================
--- twinkle-1.4.2.orig/configure.in 2013-07-25 11:07:54.160534950 -0400
+++ twinkle-1.4.2/configure.in 2013-07-25 11:07:59.000000000 -0400
@@ -294,7 +294,11 @@
AC_CHECK_LIB(boost_regex-gcc, main, [
LIBS="-lboost_regex-gcc $LIBS"
echo "LIBS += -lboost_regex-gcc" >> $QT_INCL_PRO],
- [AC_MSG_ERROR([libboost_regex library is missing (boost package).])])])
+ [
+ AC_CHECK_LIB(boost_regex, main, [
+ LIBS="-lboost_regex $LIBS"
+ echo "LIBS += -lboost_regex" >> $QT_INCL_PRO],
+ [AC_MSG_ERROR([libboost_regex library is missing (boost package).])])])])
ms_CHECK_LRELEASE()

View File

@ -1,29 +1,40 @@
{ stdenv, fetchurl, pkgconfig, commoncpp2, ccrtp, openssl, boost
{ stdenv, fetchurl, pkgconfig, autoreconfHook, commoncpp2, ccrtp, openssl, boost
, libsndfile, libxml2, libjpeg, readline, qt3, perl, file
, alsaLib, speex, libzrtpcpp, xorg }:
stdenv.mkDerivation {
stdenv.mkDerivation rec {
name = "twinkle-1.4.2";
src = fetchurl {
url = http://www.xs4all.nl/~mfnboer/twinkle/download/twinkle-1.4.2.tar.gz;
url = "http://www.xs4all.nl/~mfnboer/twinkle/download/${name}.tar.gz";
sha256 = "19c9gqam78srsgv0463g7lfnv4mn5lvbxx3zl87bnm0vmk3qcxl0";
};
patches = [ # all from Debian
./newer-libccrtp.diff
./libgsm.patch
./localetime_r_conflict.diff
./boost_regex.patch # modified not to use "-mt" suffix
];
configureFlags = "--with-extra-includes=${libjpeg}/include";
buildInputs =
[ pkgconfig commoncpp2 ccrtp openssl boost libsndfile
[ pkgconfig autoreconfHook commoncpp2 openssl boost libsndfile
libxml2 libjpeg readline qt3 perl file
# optional ? :
alsaLib
speex libzrtpcpp xorg.libX11 xorg.libXaw xorg.libICE xorg.libXext
alsaLib speex
libzrtpcpp xorg.libX11 xorg.libXaw xorg.libICE xorg.libXext
];
meta = {
homepage = http://www.xs4all.nl/~mfnboer/twinkle/index.html;
license = "GPL";
maintainers = [ stdenv.lib.maintainers.marcweber ];
platforms = stdenv.lib.platforms.linux;
NIX_CFLAGS_LINK = "-Wl,--as-needed -lboost_regex -lasound -lzrtpcpp -lspeex -lspeexdsp";
enableParallelBuilding = true;
meta = with stdenv.lib; {
homepage = http://www.twinklephone.com/;
license = licenses.gpl2Plus;
maintainers = [ lib.maintainers.marcweber ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,70 @@
Index: twinkle-1.4.2/configure.in
===================================================================
--- twinkle-1.4.2.orig/configure.in 2013-07-25 11:07:54.264533206 -0400
+++ twinkle-1.4.2/configure.in 2013-07-25 11:07:54.256533340 -0400
@@ -195,22 +195,33 @@
# This check does not work on all platforms
# Check if libgsm is available
-# AC_CHECK_LIB(gsm, sf_open, [
-# AC_CHECK_HEADER(gsm.h, [],
-# [AC_MSG_ERROR([gsm header files missing (gsm.h)])])
-# AC_DEFINE(HAVE_GSM, 1, [Define to 1 if you have the <libgsm> library.])
-# GSM_LIBS="-lgsm"
-# echo "LIBS += -lgsm" >> $QT_INCL_PRO
-# have_gsm="yes" ], [
-# have_gsm="no"
-# GSM_LIBS="\$(top_builddir)/src/audio/gsm/libgsm.a"
-# echo "LIBS += ../audio/gsm/libgsm.a" >> $QT_INCL_PRO ])
-have_gsm="no"
-GSM_LIBS="\$(top_builddir)/src/audio/gsm/libgsm.a"
-echo "LIBS += ../audio/gsm/libgsm.a" >> $QT_INCL_PRO
+AC_CHECK_LIB(gsm, sf_open, [
+ AC_CHECK_HEADER(gsm.h, [],
+ [AC_MSG_ERROR([gsm header files missing (gsm.h)])])
+ AC_DEFINE(HAVE_GSM, 1, [Define to 1 if you have the <libgsm> library.])
+ GSM_LIBS="-lgsm"
+ echo "LIBS += -lgsm" >> $QT_INCL_PRO
+ have_gsm="yes" ], [
+ have_gsm="no"
+ GSM_LIBS="\$(top_builddir)/src/audio/gsm/libgsm.a"
+ echo "LIBS += ../audio/gsm/libgsm.a" >> $QT_INCL_PRO ])
+#have_gsm="no"
+#GSM_LIBS="\$(top_builddir)/src/audio/gsm/libgsm.a"
+#echo "LIBS += ../audio/gsm/libgsm.a" >> $QT_INCL_PRO
AC_SUBST(GSM_LIBS)
+# Check if libgsm is available
+AC_CHECK_LIB(gsm, sf_open, [
+ AC_CHECK_HEADER(gsm.h, [],
+ [AC_MSG_ERROR([gsm header files missing (gsm.h)])])
+ AC_DEFINE(HAVE_GSM, 1, [Define to 1 if you have the <libgsm> library.])
+ LIBS="-lgsm $LIBS"
+ echo "LIBS += -lgsm" >> $QT_INCL_PRO
+ have_gsm="yes" ], [
+ have_gsm="no"
+ echo "$(top_builddir)/src/audio/gsm/libgsm.a" >> $QT_INCL_PRO ])
+
# Check if ALSA is available
AC_CHECK_LIB(asound, main, [
AC_CHECK_HEADER(alsa/asoundlib.h, [],
@@ -348,3 +359,4 @@
AC_MSG_RESULT([Speex: $have_speex])
AC_MSG_RESULT([iLBC: $have_ilbc])
AC_MSG_RESULT([ZRTP: $have_zrtp])
+AC_MSG_RESULT([Libgsm dynamic link: $have_gsm])
Index: twinkle-1.4.2/src/twinkle_config.h.in
===================================================================
--- twinkle-1.4.2.orig/src/twinkle_config.h.in 2013-07-25 11:07:54.264533206 -0400
+++ twinkle-1.4.2/src/twinkle_config.h.in 2013-07-25 11:07:54.256533340 -0400
@@ -19,6 +19,9 @@
/* Define to 1 if you have the <history.h> header file. */
#undef HAVE_HISTORY_H
+/* Define to 1 if you have the <libgsm> library. */
+#undef HAVE_GSM
+
/* Define to 1 if you have the <ilbc> library. */
#undef HAVE_ILBC

View File

@ -0,0 +1,13 @@
Index: twinkle-1.4.2/src/log.cpp
===================================================================
--- twinkle-1.4.2.orig/src/log.cpp 2009-01-18 09:35:28.000000000 -0500
+++ twinkle-1.4.2/src/log.cpp 2013-07-25 11:43:08.901209713 -0400
@@ -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;

View File

@ -0,0 +1,22 @@
Index: twinkle-1.4.2/configure.in
===================================================================
--- twinkle-1.4.2.orig/configure.in 2013-07-25 11:09:16.000000000 -0400
+++ twinkle-1.4.2/configure.in 2013-07-25 11:11:59.512418187 -0400
@@ -66,7 +66,7 @@
export PKG_CONFIG_PATH
-PKG_CHECK_MODULES(CCRTP, libccrtp1 >= 1.6.0)
+PKG_CHECK_MODULES(CCRTP, libccrtp >= 1.6.0)
PKG_CHECK_MODULES(XML2, libxml-2.0)
# AC_CHECK_HEADER(libxml/tree.h, [],
@@ -136,7 +136,7 @@
#echo "INCLUDEPATH += `$CCGNU2_CONFIG --includes`" | sed -e s/-I//g > $QT_INCL_PRO
# libccrtp1(ccrtp) depend from libccgnu2(commoncpp2) and
# should include above flags !
-echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libccrtp1`" | sed -e s/-I//g >> $QT_INCL_PRO
+echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libccrtp`" | sed -e s/-I//g >> $QT_INCL_PRO
echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libxml-2.0`" | sed -e s/-I//g >> $QT_INCL_PRO
# get libraries specified on command line

View File

@ -9838,10 +9838,7 @@ let
twmn = callPackage ../applications/misc/twmn { };
twinkle = callPackage ../applications/networking/instant-messengers/twinkle {
ccrtp = ccrtp_1_8;
libzrtpcpp = libzrtpcpp_1_6;
};
twinkle = callPackage ../applications/networking/instant-messengers/twinkle { };
umurmur = callPackage ../applications/networking/umurmur { };