about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/twinkle
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-08-20 21:27:43 +0200
committerVladimír Čunát <vcunat@gmail.com>2014-08-20 21:32:19 +0200
commitc198a3689890e5b9395480aaae644acd7d3bd675 (patch)
tree0cadb3855de447ec138c99e98b8e432473a8d87a /pkgs/applications/networking/instant-messengers/twinkle
parent128039217e1d674dcce60817e5c5adc7badbb39a (diff)
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.
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/twinkle')
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/boost_regex.patch17
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/default.nix33
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/libgsm.patch70
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/localetime_r_conflict.diff13
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/newer-libccrtp.diff22
5 files changed, 144 insertions, 11 deletions
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/boost_regex.patch b/pkgs/applications/networking/instant-messengers/twinkle/boost_regex.patch
new file mode 100644
index 0000000000000..3d4c46b2431d7
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/twinkle/boost_regex.patch
@@ -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()
+ 	
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/default.nix b/pkgs/applications/networking/instant-messengers/twinkle/default.nix
index 060c844980bb2..830e4715f159b 100644
--- a/pkgs/applications/networking/instant-messengers/twinkle/default.nix
+++ b/pkgs/applications/networking/instant-messengers/twinkle/default.nix
@@ -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;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/libgsm.patch b/pkgs/applications/networking/instant-messengers/twinkle/libgsm.patch
new file mode 100644
index 0000000000000..1574273feb532
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/twinkle/libgsm.patch
@@ -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
+ 
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/localetime_r_conflict.diff b/pkgs/applications/networking/instant-messengers/twinkle/localetime_r_conflict.diff
new file mode 100644
index 0000000000000..3fbc2eb0cb1e6
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/twinkle/localetime_r_conflict.diff
@@ -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;
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/newer-libccrtp.diff b/pkgs/applications/networking/instant-messengers/twinkle/newer-libccrtp.diff
new file mode 100644
index 0000000000000..9d07b3dbd6aea
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/twinkle/newer-libccrtp.diff
@@ -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