From patchwork Tue Apr 21 16:10:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Wielkiewicz X-Patchwork-Id: 21385 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 8CA7527BBE4; Tue, 21 Apr 2020 17:12:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id A9BB627BBEA for ; Tue, 21 Apr 2020 17:12:29 +0100 (BST) Received: from localhost ([::1]:60860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQvVd-0003eO-5F for patchwork@mira.cbaines.net; Tue, 21 Apr 2020 12:12:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52306) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQvVK-0003Nq-D8 for guix-patches@gnu.org; Tue, 21 Apr 2020 12:12:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQvVJ-00046f-NF for guix-patches@gnu.org; Tue, 21 Apr 2020 12:12:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQvVJ-00046P-8B for guix-patches@gnu.org; Tue, 21 Apr 2020 12:12:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jQvVJ-000624-1N for guix-patches@gnu.org; Tue, 21 Apr 2020 12:12:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40677] [PATCH 03/18] gnu: jami.scm: Add and use a generalized procedure for applying patches made by Savoir-faire linux to Jami dependencies. Resent-From: Jan Wielkiewicz Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Apr 2020 16:12:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40677 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 40677@debbugs.gnu.org Cc: Jan Wielkiewicz Received: via spool by 40677-submit@debbugs.gnu.org id=B40677.158748551523050 (code B ref 40677); Tue, 21 Apr 2020 16:12:08 +0000 Received: (at 40677) by debbugs.gnu.org; 21 Apr 2020 16:11:55 +0000 Received: from localhost ([127.0.0.1]:50608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQvV5-0005zc-0m for submit@debbugs.gnu.org; Tue, 21 Apr 2020 12:11:55 -0400 Received: from smtpo.poczta.interia.pl ([217.74.65.158]:40965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQvUT-0005vc-Bc for 40677@debbugs.gnu.org; Tue, 21 Apr 2020 12:11:23 -0400 X-Interia-R: Interia X-Interia-R-IP: 89.64.43.193 X-Interia-R-Helo: Received: from localhost.localdomain (89-64-43-193.dynamic.chello.pl [89.64.43.193]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by poczta.interia.pl (INTERIA.PL) with ESMTPSA; Tue, 21 Apr 2020 18:11:11 +0200 (CEST) From: Jan Wielkiewicz Date: Tue, 21 Apr 2020 18:10:17 +0200 Message-Id: <20200421161032.1847-3-tona_kosmicznego_smiecia@interia.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200421161032.1847-1-tona_kosmicznego_smiecia@interia.pl> References: <20200421161032.1847-1-tona_kosmicznego_smiecia@interia.pl> MIME-Version: 1.0 X-Interia-Antivirus: OK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1587485471; bh=OVPaEgcfbtN7xcjG7i7zO/ZYDsrZD7o312zEZQ2eavQ=; h=X-Interia-R:X-Interia-R-IP:X-Interia-R-Helo:From:To:Cc:Subject: Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Interia-Antivirus; b=T8NZp5idceRsdJ3oZjpGXCtfXPKOLbuG4a6iXD1mg55lBQDHaMoOC+R8xRZqUx3aS ifu0plHhzzTRi36deIPSyzMdVuwy4vuEV7lS2j+SgdCzb0Is/GMG38im8kBvYh0qTn eeV2muLk5wdUSB3kyw++3kTFOXaziELx6UubGV9M= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- gnu/packages/jami.scm | 82 +++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 44a57c9bfb..3a50cef18a 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -77,12 +77,31 @@ (base32 "0kw172w2ccyz438kf5xqw14nhfm4xk6a2libnzib9j2wvhlpf4q0")))) +;; Savoir-Faire Linux modifies many libraries to add features +;; to Jami. This procedure makes applying patches to a given +;; package easy. +(define-public jami-apply-dependency-patches + '(lambda* (#:key inputs dep-name patches) + (let ((patches-directory "SFL-patches")) + (mkdir-p patches-directory) + (invoke "tar" "-xvf" (assoc-ref inputs "SFL-patches") + "-C" patches-directory + "--strip-components=5" + (string-append "ring-project/daemon/contrib/src/" + dep-name)) + (for-each + (lambda (file) + (invoke "patch" "--force" "-p1" "-i" + (string-append patches-directory "/" + file ".patch"))) + patches)))) + (define-public pjproject-jami (package (inherit pjproject) (name "pjproject-jami") (native-inputs - `(("savoir-faire-linux-patches" ,(jami-source)) + `(("SFL-patches" ,(jami-source)) ,@(package-native-inputs pjproject))) (arguments `(#:tests? #f @@ -116,6 +135,8 @@ ;; making a shared object; "CFLAGS=-fPIC" "CXXFLAGS=-fPIC") + #:modules ((guix build utils) + ,@(@@ (guix build-system gnu) %default-modules)) #:phases (modify-phases %standard-phases (add-after 'unpack 'make-git-checkout-writable @@ -124,40 +145,31 @@ #t)) (add-after 'unpack 'apply-patches (lambda* (#:key inputs #:allow-other-keys) - (let ((savoir-faire-linux-patches-directory "Savoir-faire Linux patches") - ;; Comes from - ;; "ring-project/daemon/contrib/src/pjproject/rules.mak". - ;; WARNING: These amount for huge changes in pjproject. - (savoir-faire-linux-patches - '("fix_turn_alloc_failure" - "rfc2466" - "ipv6" - "multiple_listeners" - "pj_ice_sess" - "fix_turn_fallback" - "fix_ioqueue_ipv6_sendto" - "add_dtls_transport" - "rfc6544" - "ice_config" - "sip_config" - "fix_first_packet_turn_tcp" - "fix_ebusy_turn" - "ignore_ipv6_on_transport_check" - "fix_turn_connection_failure" - ;; "uwp_vs" ; for windows - "disable_local_resolution"))) - (mkdir-p savoir-faire-linux-patches-directory) - (invoke "tar" "-xvf" (assoc-ref inputs "savoir-faire-linux-patches") - "-C" savoir-faire-linux-patches-directory - "--strip-components=5" - "ring-project/daemon/contrib/src/pjproject") - (for-each - (lambda (file) - (invoke "patch" "--force" "-p1" "-i" - (string-append savoir-faire-linux-patches-directory "/" - file ".patch"))) - savoir-faire-linux-patches)) - #t)) + (let ((jami-apply-dependency-patches ,jami-apply-dependency-patches)) + ;; Comes from + ;; "ring-project/daemon/contrib/src/pjproject/rules.mak". + ;; WARNING: These amount for huge changes in pjproject. + (jami-apply-dependency-patches + #:inputs inputs + #:dep-name "pjproject" + #:patches + '("fix_turn_alloc_failure" + "rfc2466" + "ipv6" + "multiple_listeners" + "pj_ice_sess" + "fix_turn_fallback" + "fix_ioqueue_ipv6_sendto" + "add_dtls_transport" + "rfc6544" + "ice_config" + "sip_config" + "fix_first_packet_turn_tcp" + "fix_ebusy_turn" + "ignore_ipv6_on_transport_check" + "fix_turn_connection_failure" + "disable_local_resolution")) + #t))) ;; TODO: We could use substitute-keyword-arguments instead of ;; repeating the phases from pjproject, but somehow it does ;; not work.