summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-03-06 00:07:07 -0500
committerMark H Weaver <mhw@netris.org>2014-03-06 10:23:45 -0500
commit8b3099cf03b2d1ebcd233b4a35d132cd73b5728d (patch)
treeb7b0936db24f4d7399948f716ffa053ba7259600 /gnu
parent7c706558f564e878415a14d32286c31c5ef370fb (diff)
downloadguix-8b3099cf03b2d1ebcd233b4a35d132cd73b5728d.tar.gz
gnu: Add bitlbee.
* gnu/packages/messaging.scm (bitlbee): New variable.
* gnu/packages/patches/bitlbee-fix-tests.patch: New file.
* gnu/packages/patches/bitlbee-memset-fix.patch: New file.
* gnu-system.am (dist_patch_DATA): Add patches.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/messaging.scm59
-rw-r--r--gnu/packages/patches/bitlbee-fix-tests.patch33
-rw-r--r--gnu/packages/patches/bitlbee-memset-fix.patch15
3 files changed, 105 insertions, 2 deletions
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 34efa85970..c1a755ef84 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -17,11 +17,20 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages messaging)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses)
+                #:select (gpl2+ gpl2 lgpl2.1 bsd-2))
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
-  #:use-module (gnu packages gnupg))
+  #:use-module (gnu packages)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnutls)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages check))
 
 (define-public libotr
   (package
@@ -65,4 +74,50 @@ providing:
               (sha256
                (base32 "1x6dd4rh499hdraiqfhz81igrj0a5rs0gjhc8l4sljwqhjjyla6l"))))))
 
+(define-public bitlbee
+  (package
+    (name "bitlbee")
+    (version "3.2.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://get.bitlbee.org/src/bitlbee-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32 "0n8g5452i5qap43zxb83gxp01d48psf6rr3k1q7z6a3dgpfi3x00"))
+              (patches (list (search-patch "bitlbee-memset-fix.patch")
+                             (search-patch "bitlbee-fix-tests.patch")))))
+    (build-system gnu-build-system)
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("check" ,check)))
+    (inputs `(("glib" ,glib)
+              ("libotr" ,libotr-3)
+              ("gnutls" ,gnutls)
+              ("zlib" ,zlib)  ; Needed to satisfy "pkg-config --exists gnutls"
+              ("python" ,python-2)
+              ("perl" ,perl)))
+    (arguments
+     `(#:phases (alist-cons-after
+                 'install 'install-etc
+                 (lambda* (#:key (make-flags '()) #:allow-other-keys)
+                   (zero? (apply system* "make" "install-etc" make-flags)))
+                 (alist-replace
+                  'configure
+                  ;; bitlbee's configure script does not tolerate many of the
+                  ;; variable settings that Guix would pass to it.
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (zero? (system* "./configure"
+                                    (string-append "--prefix="
+                                                   (assoc-ref outputs "out"))
+                                    "--otr=1")))
+                  %standard-phases))))
+    (synopsis "IRC to instant messaging gateway")
+    (description "BitlBee brings IM (instant messaging) to IRC clients, for
+people who have an IRC client running all the time and don't want to run an
+additional IM client.  BitlBee currently supports XMPP/Jabber (including
+Google Talk), MSN Messenger, Yahoo!  Messenger, AIM and ICQ, and the Twitter
+microblogging network (plus all other Twitter API compatible services like
+identi.ca and status.net).")
+    (home-page "http://www.bitlbee.org/")
+    (license (list gpl2+ bsd-2))))
+
 ;;; messaging.scm ends here
diff --git a/gnu/packages/patches/bitlbee-fix-tests.patch b/gnu/packages/patches/bitlbee-fix-tests.patch
new file mode 100644
index 0000000000..52bb6c605d
--- /dev/null
+++ b/gnu/packages/patches/bitlbee-fix-tests.patch
@@ -0,0 +1,33 @@
+Pass the correct number of arguments to 'nick_strip' and 'nick_ok' in tests.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- bitlbee/tests/check_nick.c.orig	2013-11-27 17:54:54.000000000 -0500
++++ bitlbee/tests/check_nick.c	2014-03-05 23:41:45.761230468 -0500
+@@ -30,7 +30,7 @@ START_TEST(test_nick_strip)
+ 	for (i = 0; get[i]; i++) {
+ 		char copy[60];
+ 		strcpy(copy, get[i]);
+-		nick_strip(copy);
++		nick_strip(NULL, copy);
+ 		fail_unless (strcmp(copy, expected[i]) == 0, 
+ 					 "(%d) nick_strip broken: %s -> %s (expected: %s)", 
+ 					 i, get[i], copy, expected[i]);
+@@ -45,7 +45,7 @@ START_TEST(test_nick_ok_ok)
+ 	int i;
+ 
+ 	for (i = 0; nicks[i]; i++) {
+-		fail_unless (nick_ok(nicks[i]) == 1,
++		fail_unless (nick_ok(NULL, nicks[i]) == 1,
+ 					 "nick_ok() failed: %s", nicks[i]);
+ 	}
+ }
+@@ -58,7 +58,7 @@ START_TEST(test_nick_ok_notok)
+ 	int i;
+ 
+ 	for (i = 0; nicks[i]; i++) {
+-		fail_unless (nick_ok(nicks[i]) == 0,
++		fail_unless (nick_ok(NULL, nicks[i]) == 0,
+ 					 "nick_ok() succeeded for invalid: %s", nicks[i]);
+ 	}
+ }
diff --git a/gnu/packages/patches/bitlbee-memset-fix.patch b/gnu/packages/patches/bitlbee-memset-fix.patch
new file mode 100644
index 0000000000..1d801e0070
--- /dev/null
+++ b/gnu/packages/patches/bitlbee-memset-fix.patch
@@ -0,0 +1,15 @@
+Fix the size argument to 'memset'.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- bitlbee/lib/md5.c.orig	2013-11-27 17:54:54.000000000 -0500
++++ bitlbee/lib/md5.c	2014-03-05 21:39:04.739746093 -0500
+@@ -159,7 +159,7 @@ void md5_finish(struct MD5Context *ctx,
+ 	ctx->buf[2] = cvt32(ctx->buf[2]);
+ 	ctx->buf[3] = cvt32(ctx->buf[3]);
+ 	memcpy(digest, ctx->buf, 16);
+-	memset(ctx, 0, sizeof(ctx));	/* In case it's sensitive */
++	memset(ctx, 0, sizeof(*ctx));	/* In case it's sensitive */
+ }
+ 
+ void md5_finish_ascii(struct MD5Context *context, char *ascii)