From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: [PATCHES] Add libotr and bitlbee. Date: Thu, 06 Mar 2014 00:45:51 -0500 Message-ID: <87mwh3lw1c.fsf@yeeloong.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLR9P-0000zt-5A for guix-devel@gnu.org; Thu, 06 Mar 2014 00:47:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLR9K-0002PG-NK for guix-devel@gnu.org; Thu, 06 Mar 2014 00:47:23 -0500 Received: from world.peace.net ([96.39.62.75]:38400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLR9K-0002P5-HD for guix-devel@gnu.org; Thu, 06 Mar 2014 00:47:18 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain These patches add bitlbee and two versions of libotr (the latest and an older version needed by bitlbee). Along the way I discovered and fixed some bugs in bitlbee and will report them upstream soon. Mark --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-libotr.patch Content-Transfer-Encoding: quoted-printable Content-Description: [PATCH 1/2] gnu: Add libotr >From 6ece020375232d3fab6c8c1dc16e1ae0031617ba Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 5 Mar 2014 19:12:19 -0500 Subject: [PATCH 1/2] gnu: Add libotr. * gnu/packages/messaging.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu-system.am | 3 +- gnu/packages/messaging.scm | 68 ++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/messaging.scm diff --git a/gnu-system.am b/gnu-system.am index 7b620c3..8f5e445 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -1,7 +1,7 @@ # GNU Guix --- Functional package management for GNU # Copyright =C2=A9 2012, 2013, 2014 Ludovic Court=C3=A8s # Copyright =C2=A9 2013 Andreas Enge -# Copyright =C2=A9 2013 Mark H Weaver +# Copyright =C2=A9 2013, 2014 Mark H Weaver # # This file is part of GNU Guix. # @@ -144,6 +144,7 @@ GNU_SYSTEM_MODULES =3D \ gnu/packages/mail.scm \ gnu/packages/make-bootstrap.scm \ gnu/packages/maths.scm \ + gnu/packages/messaging.scm \ gnu/packages/mit-krb5.scm \ gnu/packages/moe.scm \ gnu/packages/mpd.scm \ diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm new file mode 100644 index 0000000..34efa85 --- /dev/null +++ b/gnu/packages/messaging.scm @@ -0,0 +1,68 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2014 Mark H Weaver +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages messaging) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages gnupg)) + +(define-public libotr + (package + (name "libotr") + (version "4.0.0") + (source (origin + (method url-fetch) + (uri (string-append "https://otr.cypherpunks.ca/libotr-" + version ".tar.gz")) + (sha256 + (base32 "1d4k0b7v4d3scwm858cmqr9c6xgd6ppla1vk4x2yg64q82a1k4= 9z")))) + (build-system gnu-build-system) + (propagated-inputs + `(("libgcrypt" ,libgcrypt))) ; libotr headers include gcrypt.h + (inputs `(("libgpg-error" ,libgpg-error))) + (arguments + `(#:configure-flags '("--with-pic"))) + (synopsis "Off-the-Record (OTR) Messaging Library and Toolkit") + (description + "OTR allows you to have private conversations over instant messaging = by +providing: +* Encryption: No one else can read your instant messages. +* Authentication: You are assured the correspondent is who you think it is. +* Deniability: The messages you send do not have digital signatures that a= re + checkable by a third party. Anyone can forge messages after a conversat= ion + to make them look like they came from you. However, during a conversati= on, + your correspondent is assured the messages he sees are authentic and + unmodified. +* Perfect forward secrecy: If you lose control of your private keys, no + previous conversation is compromised.") + (home-page "https://otr.cypherpunks.ca/") + (license (list lgpl2.1 gpl2)))) + +(define-public libotr-3 + (package (inherit libotr) + (version "3.2.1") + (source (origin + (method url-fetch) + (uri (string-append "https://otr.cypherpunks.ca/libotr-" + version ".tar.gz")) + (sha256 + (base32 "1x6dd4rh499hdraiqfhz81igrj0a5rs0gjhc8l4sljwqhjjyla= 6l")))))) + +;;; messaging.scm ends here --=20 1.8.4 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-gnu-Add-bitlbee.patch Content-Description: [PATCH 2/2] gnu: Add bitlbee >From f33fa7dda84c90e002a5efa9a173263e910e9c76 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 6 Mar 2014 00:07:07 -0500 Subject: [PATCH 2/2] 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. --- gnu-system.am | 2 + gnu/packages/messaging.scm | 59 ++++++++++++++++++++++++++- gnu/packages/patches/bitlbee-fix-tests.patch | 33 +++++++++++++++ gnu/packages/patches/bitlbee-memset-fix.patch | 15 +++++++ 4 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/bitlbee-fix-tests.patch create mode 100644 gnu/packages/patches/bitlbee-memset-fix.patch diff --git a/gnu-system.am b/gnu-system.am index 8f5e445..5cfa2c9 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -252,6 +252,8 @@ dist_patch_DATA = \ gnu/packages/patches/binutils-ld-new-dtags.patch \ gnu/packages/patches/binutils-loongson-madd-fix.patch \ gnu/packages/patches/binutils-loongson-workaround.patch \ + gnu/packages/patches/bitlbee-fix-tests.patch \ + gnu/packages/patches/bitlbee-memset-fix.patch \ gnu/packages/patches/cdparanoia-fpic.patch \ gnu/packages/patches/cmake-fix-tests.patch \ gnu/packages/patches/cpio-gets-undeclared.patch \ diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 34efa85..c1a755e 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -17,11 +17,20 @@ ;;; along with GNU Guix. If not, see . (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 0000000..52bb6c6 --- /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 . + +--- 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 0000000..1d801e0 --- /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 . + +--- 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) -- 1.8.4 --=-=-=--