From patchwork Sat Oct 27 14:35:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 33 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C4B8E1662E; Sat, 27 Oct 2018 15:36:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 44CDD165C0 for ; Sat, 27 Oct 2018 15:36:11 +0100 (BST) Received: from localhost ([::1]:36725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGPhC-00045B-L4 for patchwork@mira.cbaines.net; Sat, 27 Oct 2018 10:36:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGPh6-00044y-6k for guix-patches@gnu.org; Sat, 27 Oct 2018 10:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGPh4-0005H9-Ub for guix-patches@gnu.org; Sat, 27 Oct 2018 10:36:04 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:41308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGPh4-0005Gt-Ot for guix-patches@gnu.org; Sat, 27 Oct 2018 10:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGPh4-0002U3-Lk for guix-patches@gnu.org; Sat, 27 Oct 2018 10:36:02 -0400 Subject: bug#32727: [PATCH] gnu: Add telegram-purple. Resent-From: ludo@gnu.org (Ludovic =?utf-8?q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Sat, 27 Oct 2018 14:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 32727 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: =?utf-8?b?VG9tw6HFoSDEjGVjaA==?= Mail-Followup-To: 32727@debbugs.gnu.org, ludo@gnu.org, sleep_walker@gnu.org Received: via spool by 32727-done@debbugs.gnu.org id=D32727.15406509169489 (code D ref 32727); Sat, 27 Oct 2018 14:36:02 +0000 Received: (at 32727-done) by debbugs.gnu.org; 27 Oct 2018 14:35:16 +0000 Received: from localhost ([127.0.0.1]:45565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGPgK-0002Sy-0r for submit@debbugs.gnu.org; Sat, 27 Oct 2018 10:35:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGPgJ-0002Sn-87 for 32727-done@debbugs.gnu.org; Sat, 27 Oct 2018 10:35:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGPgB-0003t1-F7 for 32727-done@debbugs.gnu.org; Sat, 27 Oct 2018 10:35:10 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGPgB-0003sU-3z for 32727-done@debbugs.gnu.org; Sat, 27 Oct 2018 10:35:07 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=58906 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gGPg8-0006Lr-Dt; Sat, 27 Oct 2018 10:35:05 -0400 From: ludo@gnu.org (Ludovic =?utf-8?q?Court=C3=A8s?=) References: <20180916005815.GA4866@jasmine.lan> <20181021161813.3141-1-sleep_walker@gnu.org> Date: Sat, 27 Oct 2018 16:35:03 +0200 In-Reply-To: <20181021161813.3141-1-sleep_walker@gnu.org> (" =?utf-8?b?VG9t?= =?utf-8?b?w6HFoSDEjGVjaA==?= "'s message of "Sun, 21 Oct 2018 18:18:13 +0200") Message-ID: <87h8h7a25k.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 32727-done@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Tomáš, Tomáš Čech skribis: > * gnu/packages/messaging.scm (telegram-purple): New variable. I’ve applied this patch but I ended up making substantial changes (patch attached), in particular: • Arrange to run “make install” so that all the files get installed (locales, icons, etc.) and not just the .so; • Adjust the test/loadtest.c so that it actually runs; • Arrange to keep the standard ‘configure’ phase rather than overriding it. The other changes are more cosmetic. Are we really more picky than openSuSE? :-) Thank you, Ludo’. diff --git a/gnu/local.mk b/gnu/local.mk index c46f3a8c4a..ba86d556a0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1166,6 +1166,7 @@ dist_patch_DATA = \ %D%/packages/patches/tcsh-fix-out-of-bounds-read.patch \ %D%/packages/patches/teensy-loader-cli-help.patch \ %D%/packages/patches/teeworlds-use-latest-wavpack.patch \ + %D%/packages/patches/telegram-purple-adjust-test.patch \ %D%/packages/patches/texi2html-document-encoding.patch \ %D%/packages/patches/texi2html-i18n.patch \ %D%/packages/patches/thefuck-test-environ.patch \ diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index dd937ef53e..0d818514a7 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -1767,15 +1767,35 @@ messaging that aren’t available to clients that connect over XMPP.") (package (name "telegram-purple") (version "1.3.1") + (home-page "https://github.com/majn/telegram-purple") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/majn/telegram-purple") + (url home-page) (commit (string-append "v" version)) (recursive? #t))) (sha256 (base32 - "0p93jpjpx7hszwffzgixw04zkrpsiyzz4za3gfr4j07krc4771fp")))) + "0p93jpjpx7hszwffzgixw04zkrpsiyzz4za3gfr4j07krc4771fp")) + (modules '((guix build utils))) + (snippet + '(begin + (substitute* "Makefile.in" + ;; By default these two directories point to Pidgin's own + ;; prefix. + (("^PLUGIN_DIR_PURPLE=.*") + (string-append + "exec_prefix := @exec_prefix@\n" + "PLUGIN_DIR_PURPLE := @libdir@/purple-2\n")) + (("^DATA_ROOT_DIR_PURPLE=.*") + "DATA_ROOT_DIR_PURPLE := @datarootdir@\n") + + ;; Honor sysconfdir instead of trying to write to /etc. + (("DESTDIR\\)/etc/telegram-purple") + "DESTDIR)@sysconfdir@/telegram-purple")) + #t)) + (patches (search-patches "telegram-purple-adjust-test.patch")) + (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) @@ -1791,7 +1811,7 @@ messaging that aren’t available to clients that connect over XMPP.") (arguments `(;; disable tests for now - tests are failing on pidgin path ;; verification but it seems to be harmless - #:tests? #f + #:tests? #t #:phases (modify-phases %standard-phases ;; We're using release tag for repository checkout - let's prepare @@ -1808,32 +1828,24 @@ messaging that aren’t available to clients that connect over XMPP.") "#ifndef GIT_COMMIT\n" "# define GIT_COMMIT \"v" ,version "\"\n" - "#endif\n")))))) - (replace 'configure - ;; configure does not work followed by both "SHELL=..." and - ;; "CONFIG_SHELL=..."; set environment variables instead - (lambda* (#:key outputs configure-flags #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bash (which "bash")) - (flags `(,(string-append "--prefix=" out) - ,@configure-flags))) + "#endif\n")))) + #t)) + (add-before 'configure 'set-SHELL-variables + ;; Set these environment variables so that 'tgl/configure' uses the + ;; right shell and not /bin/sh. + (lambda _ + (let ((bash (which "bash"))) (setenv "SHELL" bash) (setenv "CONFIG_SHELL" bash) - (apply invoke "./configure" flags)))) - (replace 'install - ;; install is trying to use pidgin's lib directory instead of - ;; its own - (lambda* (#:key outputs configure-flags #:allow-other-keys) - (let* ((tgt (string-append (assoc-ref outputs "out") - "/lib/purple-2/"))) - (mkdir-p tgt) - (install-file "bin/telegram-purple.so" - tgt))))))) - ;; gettext - (home-page "https://github.com/majn/telegram-purple") - (synopsis "Telegram support for pidgin") - (description "Telegram-purple is a Libpurple protocol plugin that adds -support for the Telegram messenger.") + #t)))))) + (synopsis "Telegram messaging support for Pidgin") + (description + "Telegram-purple is a plugin for Libpurple, the communication library +used by the Pidgin instant messaging client, that adds support for the +Telegram messenger.") + + ;; Code under tgl/ (the Telegram library) is LGPLv2.1+, but the plugin + ;; itself is GPLv2+. (license license:gpl2+))) ;;; messaging.scm ends here diff --git a/gnu/packages/patches/telegram-purple-adjust-test.patch b/gnu/packages/patches/telegram-purple-adjust-test.patch new file mode 100644 index 0000000000..db3b497d5d --- /dev/null +++ b/gnu/packages/patches/telegram-purple-adjust-test.patch @@ -0,0 +1,14 @@ +This test incorrectly expects the libpurple search path to initially +contain exactly one element. Remove this incorrect assertion. + +--- telegram-purple-1.3.1-checkout/test/loadtest.c 2018-10-27 16:25:06.258459600 +0200 ++++ telegram-purple-1.3.1-checkout/test/loadtest.c 2018-10-27 16:25:11.830434770 +0200 +@@ -156,7 +156,7 @@ static void tdf_inject_plugin (void) { + printf ("Injecting our module into purple_plugins_* ...\n"); + purple_plugins_init (); + GList *search_paths = purple_plugins_get_search_paths (); +- assert (!search_paths->prev && !search_paths->next && search_paths->data); ++ assert (!search_paths->prev && search_paths->data); + GList *new_paths = g_list_append (search_paths, g_strdup ("bin/")); + assert (new_paths == search_paths); + // Load "my" path before the default.