From patchwork Sun Jun 20 01:07:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: slg <0x2d@disroot.org> X-Patchwork-Id: 30513 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 203C827BC81; Sun, 20 Jun 2021 02:09:11 +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, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 ESMTPS id E26A627BC78 for ; Sun, 20 Jun 2021 02:09:10 +0100 (BST) Received: from localhost ([::1]:49504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lulxW-0007VY-1J for patchwork@mira.cbaines.net; Sat, 19 Jun 2021 21:09:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lulxP-0007TJ-5a for guix-patches@gnu.org; Sat, 19 Jun 2021 21:09:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49461) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lulxO-0000LJ-UP for guix-patches@gnu.org; Sat, 19 Jun 2021 21:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lulxO-0004Ez-Qj for guix-patches@gnu.org; Sat, 19 Jun 2021 21:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49123] [PATCH 02/24] gnu: libolm: Add python bindings output. Resent-From: slg <0x2d@disroot.org> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 20 Jun 2021 01:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49123 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49123@debbugs.gnu.org Cc: slg <0x2d@disroot.org> Received: via spool by 49123-submit@debbugs.gnu.org id=B49123.162415133016274 (code B ref 49123); Sun, 20 Jun 2021 01:09:02 +0000 Received: (at 49123) by debbugs.gnu.org; 20 Jun 2021 01:08:50 +0000 Received: from localhost ([127.0.0.1]:32773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lulxC-0004EP-5a for submit@debbugs.gnu.org; Sat, 19 Jun 2021 21:08:50 -0400 Received: from knopi.disroot.org ([178.21.23.139]:59356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <0x2d@disroot.org>) id 1lulxA-0004EI-M0 for 49123@debbugs.gnu.org; Sat, 19 Jun 2021 21:08:49 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 1622F5C92F; Sun, 20 Jun 2021 03:08:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pal49BIsF5Cq; Sun, 20 Jun 2021 03:08:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1624151327; bh=qgQ80niAH4raIm+e8BDDMq6L19IQ1XGRO68JSiFSkf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=V8EyLG0nCa9DpEzrUzL9nBcGooSO4gccP0VrkTxvPvoq0FhRZSrVK3REDZfPRuEya GZ3xPWRhVzKpdla9lvN/4OvawCPEv7nfhLfO+fsV6MAeri/GUDvK2livWClhlODC7I 2KJtAqGkxgiDugGZdVqHCLnPADxdBwnSRtS9xnB/1I283dWrBtzZxMXOOEqzW4Sy+T VZbsKt1spO2GsYwJgC9mkFgZgrNKGiHe6LvVgwpoR+YNJoVYH0Is1dv2PJVwYVwDLB 0xTgIvZM60ouSWyFitH6jLnEQR1o70Oeg1O96xFfbtQpQ25/3wOBg0FsXnknnwjwSk 9YwIMWLEmltBQ== Date: Sat, 19 Jun 2021 22:07:20 -0300 Message-Id: <20210620010742.4259-2-0x2d@disroot.org> In-Reply-To: <20210620010742.4259-1-0x2d@disroot.org> References: <20210620010742.4259-1-0x2d@disroot.org> Mime-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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" Reply-to: slg <0x2d@disroot.org> X-ACL-Warn: , slg via Guix-patches X-Patchwork-Original-From: slg via Guix-patches via From: slg <0x2d@disroot.org> X-getmail-retrieved-from-mailbox: Patches * gnu/packages/crypto.scm (libolm): Add python bindings --- gnu/packages/crypto.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm index 99455dc632..b1cfd46adc 100644 --- a/gnu/packages/crypto.scm +++ b/gnu/packages/crypto.scm @@ -1310,13 +1310,30 @@ Trusted comments are signed, thus verified, before being displayed.") "0bixly6jqpwfx3p37c1qp1j685yg6m429r1nazwh43w4n527bs3y")) (file-name (git-file-name name version)))) (build-system cmake-build-system) + (outputs '("out" "python")) + (propagated-inputs + `(("python-cffi" ,python-cffi))) + (native-inputs + `(("python" ,python-wrapper))) (arguments `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ (with-directory-excursion "tests" - (invoke "ctest" "."))))))) + (invoke "ctest" ".")))) + (add-after 'install 'install-python-binding + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion "../source/python" + (invoke "make" "headers" "CPP=cpp") ;; Somehow default $(CPP) is cc? + (invoke "python" "setup.py" "build_ext" + (string-append "--library-dirs=" + (assoc-ref outputs "out") + "/lib")) + (invoke "python" "setup.py" "install" + (string-append "--prefix=" + (assoc-ref outputs "python")) + "--root=/"))))))) (synopsis "Implementation of the olm and megolm cryptographic ratchets") (description "The libolm library implements the Double Ratchet cryptographic ratchet. It is written in C and C++11, and exposed as a C