From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 13 00:17:30 2021 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 To: 47741@debbugs.gnu.org Subject: [PATCH 1/3] gnu: opendht: Add Python bindings, tools. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 47741 Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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 -- 2.31.1