From patchwork Tue Apr 13 04:17:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 28479 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 7481727BC72; Tue, 13 Apr 2021 05:18:14 +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_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,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 1608027BC74 for ; Tue, 13 Apr 2021 05:18:10 +0100 (BST) Received: from localhost ([::1]:40436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWAV7-0007fZ-9P for patchwork@mira.cbaines.net; Tue, 13 Apr 2021 00:18:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWAV0-0007e1-7t for guix-patches@gnu.org; Tue, 13 Apr 2021 00:18:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWAUz-00064u-W8 for guix-patches@gnu.org; Tue, 13 Apr 2021 00:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWAUz-0004jM-PL for guix-patches@gnu.org; Tue, 13 Apr 2021 00:18:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47741] [PATCH 1/3] gnu: opendht: Add Python bindings, tools. References: <20210413041500.1223-1-maxim.cournoyer@gmail.com> In-Reply-To: <20210413041500.1223-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Apr 2021 04:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47741 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47741@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 47741-submit@debbugs.gnu.org id=B47741.161828745018115 (code B ref 47741); Tue, 13 Apr 2021 04:18:01 +0000 Received: (at 47741) by debbugs.gnu.org; 13 Apr 2021 04:17:30 +0000 Received: from localhost ([127.0.0.1]:58705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWAUT-0004i7-Sq for submit@debbugs.gnu.org; Tue, 13 Apr 2021 00:17:30 -0400 Received: from mail-qt1-f171.google.com ([209.85.160.171]:47000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWAUR-0004hs-GM for 47741@debbugs.gnu.org; Tue, 13 Apr 2021 00:17:28 -0400 Received: by mail-qt1-f171.google.com with SMTP id y2so11761077qtw.13 for <47741@debbugs.gnu.org>; Mon, 12 Apr 2021 21:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tjcgDKaysCTsqq2UEVGi8TFD248kZSPkD9pieNvR94M=; b=GKntYoj7gaQr/KYaE9N4Mi0TfA/uyte06STo/jtNdkaI0uzlOQEtGg9nIicXq7+MJq LIvMzFPG8RKstonkeV1tuDzS4K1/GbvWkI2uD3IU1XLVOkUA3FAZE1BYmp9nqcN91gAi jjiVLAyg4i184RjT3CvEjDKB5ftAx3/69HOTSB3A7kpS6pLIQuJDeiIHIeYhu9f+65yT YOIN5kSGlJpnrghaz/CNDE8To+a5XgA1CT5E2RpSNy6AP2vhs+LN5JcGC9UqMQF088oK JExxpioBFESqgbFtusN4Rtg35V3qVwjiyDaCGoKBeAn9pxdDpTWLDwtPmBCEO2IaovHd Roow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tjcgDKaysCTsqq2UEVGi8TFD248kZSPkD9pieNvR94M=; b=bgqyOm1rJdsCaWd6pumhJDOjeoolfSKKD1YsBKgeSOWfNReLMmAsvALI5GosDCquwl VteYm+3WnS2gXb/PeItB0DhWZMPYrKi3x0i3aMmzlPVqQGYTu3oifzwIbMV8pppTuDTx dLZmsshfp1yxwcKafbMq6Crmrx1f7ssn4Mul5oou04Rl5uMnmM0at2tPDz+bdcHxDkfi bFASC/nY1vwV3R0q6x+Mxy+mvRJZ0yc3BQgpzR9I4GmiqGnRZgdz21SFYsTBskdRjGVt a3oQy+PalluHqbh5J0JDQi0g1tRg/RCciN8fUgzG0S5ThMh/HKahH77qzU+Om5gSB9by A0tA== X-Gm-Message-State: AOAM530cjFF4kcAONbNHXFtmhoMY/8+hTW90vn1CSiSc9/aQdwsaxUQ0 drdtZW7NDVbmeff0yf6P860V9KcV0mc= X-Google-Smtp-Source: ABdhPJwnZHqR9VzhEaXrUe1VcrsrTrq0XfqlYQm3z99tn6DjTK2lquZWo/m97NsJ29UVERx9Au6H3Q== X-Received: by 2002:ac8:7dce:: with SMTP id c14mr28401005qte.82.1618287441822; Mon, 12 Apr 2021 21:17:21 -0700 (PDT) Received: from localhost.localdomain (dsl-10-128-209.b2b2c.ca. [72.10.128.209]) by smtp.gmail.com with ESMTPSA id w1sm7414074qto.85.2021.04.12.21.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 21:17:21 -0700 (PDT) From: Maxim Cournoyer Date: Tue, 13 Apr 2021 00:17:08 -0400 Message-Id: <20210413041710.1708-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.31.1 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/networking.scm (opendht) [outputs]: Add tools and debug outputs. [native-inputs]: Add python and python-cython. [imported-modules, modules, phases]: New arguments. [configure-flags]: Disable static compilation. Enable Python support and the tools. [synopsis]: Update synopsis. [description]: Expound description. --- gnu/packages/networking.scm | 75 ++++++++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 9 deletions(-) diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index baaa9c5707..b3a51c4b82 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -3436,6 +3436,7 @@ and targeted primarily for asynchronous processing of HTTP-requests.") (base32 "1wc0f6cnvnlmhxnx64nxqgsx93k4g7ljdaqjl40ml74jg3nqrzcl")))) ;; Since 2.0, the gnu-build-system does not seem to work anymore, upstream bug? + (outputs '("out" "tools" "debug")) (build-system cmake-build-system) (inputs `(("argon2" ,argon2) @@ -3452,23 +3453,79 @@ and targeted primarily for asynchronous processing of HTTP-requests.") `(("autoconf" ,autoconf) ("automake" ,automake) ("pkg-config" ,pkg-config) + ("python" ,python) + ("python-cython" ,python-cython) ("libtool" ,libtool) ("cppunit" ,cppunit))) (arguments - `(#:tests? #f ; Tests require network connection. + `(#:imported-modules ((guix build python-build-system) ;for site-packages + ,@%cmake-build-system-modules) + #:modules (((guix build python-build-system) #:prefix python:) + (guix build cmake-build-system) + (guix build utils)) + #:tests? #f ; Tests require network connection. #:configure-flags - '(;;"-DOPENDHT_TESTS=on" - "-DOPENDHT_TOOLS=off" - "-DOPENDHT_PYTHON=off" + '( ;;"-DOPENDHT_TESTS=on" + "-DOPENDHT_STATIC=off" + "-DOPENDHT_TOOLS=on" + "-DOPENDHT_PYTHON=on" "-DOPENDHT_PROXY_SERVER=on" "-DOPENDHT_PUSH_NOTIFICATIONS=on" "-DOPENDHT_PROXY_SERVER_IDENTITY=on" - "-DOPENDHT_PROXY_CLIENT=on"))) + "-DOPENDHT_PROXY_CLIENT=on") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-python-installation-prefix + ;; Specify the installation prefix for the compiled Python module + ;; that would otherwise attempt to installs itself to Python's own + ;; site-packages directory. + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "python/CMakeLists.txt" + (("--root=\\\\\\$ENV\\{DESTDIR\\}") + (string-append "--root=/ --single-version-externally-managed " + "--prefix=${CMAKE_INSTALL_PREFIX}"))))) + (add-after 'unpack 'specify-runpath-for-python-module + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "python/setup.py.in" + (("extra_link_args=\\[(.*)\\]" _ args) + (string-append "extra_link_args=[" args + ", '-Wl,-rpath=" out "/lib']")))))) + (add-after 'install 'move-and-wrap-tools + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (tools (assoc-ref outputs "tools")) + (site-packages (python:site-packages inputs outputs))) + (mkdir tools) + (rename-file (string-append out "/bin") + (string-append tools "/bin")) + (wrap-program (string-append tools "/bin/dhtcluster") + `("PYTHONPATH" prefix (,site-packages))))))))) (home-page "https://github.com/savoirfairelinux/opendht/") - (synopsis "Distributed Hash Table (DHT) library") - (description "OpenDHT is a Distributed Hash Table (DHT) library. It may -be used to manage peer-to-peer network connections as needed for real time -communication.") + (synopsis "Lightweight Distributed Hash Table (DHT) library") + (description "OpenDHT provides an easy to use distributed in-memory data +store. Every node in the network can read and write values to the store. +Values are distributed over the network, with redundancy. It includes the +following features: +@itemize +@item Lightweight and scalable, designed for large networks and small devices; +@item High resilience to network disruption; +@item Public key cryptography layer providing optional data signature and +encryption (using GnuTLS); +@item IPv4 and IPv6 support; +@item Clean and powerful C++14 map API; +@item Bindings for C, Rust & Python 3; +@item REST API with an optional HTTP client and server with push notification +support. +@end itemize +The following tools are also included: +@table @command +@item dhtnode +A command line tool to run a DHT node and perform operations supported by the +library (get, put, etc.) with text values. +@item dhtchat +A very simple IM client working over the DHT. +@end table") (license license:gpl3+))) (define-public frrouting