From patchwork Tue Nov 15 20:03:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 44524 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 D985027BBED; Tue, 15 Nov 2022 20:04:26 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6431027BBE9 for ; Tue, 15 Nov 2022 20:04:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ov2AL-0007SA-DZ; Tue, 15 Nov 2022 15:04:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ov2A7-0007PP-Hn for guix-patches@gnu.org; Tue, 15 Nov 2022 15:04:15 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ov2A6-0007m3-9c for guix-patches@gnu.org; Tue, 15 Nov 2022 15:04:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ov2A6-0000d7-57 for guix-patches@gnu.org; Tue, 15 Nov 2022 15:04:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59281] [PATCH] gnu: Add python-dm-tree. References: <20221115083852.8994-1-ngraves@ngraves.fr> In-Reply-To: <20221115083852.8994-1-ngraves@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 15 Nov 2022 20:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59281 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59281@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 59281-submit@debbugs.gnu.org id=B59281.16685425952367 (code B ref 59281); Tue, 15 Nov 2022 20:04:02 +0000 Received: (at 59281) by debbugs.gnu.org; 15 Nov 2022 20:03:15 +0000 Received: from localhost ([127.0.0.1]:55330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ov29L-0000c7-0j for submit@debbugs.gnu.org; Tue, 15 Nov 2022 15:03:15 -0500 Received: from 8.mo560.mail-out.ovh.net ([188.165.52.147]:49779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ov29I-0000bx-1q for 59281@debbugs.gnu.org; Tue, 15 Nov 2022 15:03:13 -0500 Received: from player793.ha.ovh.net (unknown [10.111.208.129]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 40DEA23C93 for <59281@debbugs.gnu.org>; Tue, 15 Nov 2022 20:03:09 +0000 (UTC) Received: from ngraves.fr (81-67-140-142.rev.numericable.fr [81.67.140.142]) (Authenticated sender: ngraves@ngraves.fr) by player793.ha.ovh.net (Postfix) with ESMTPSA id 80FD530BFCAE2; Tue, 15 Nov 2022 20:03:07 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-100R003b93988ad-d5a2-4204-8c0f-00aa564267c3, 2F6105918EBEC42D628EBADD442E48203073A816) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 Date: Tue, 15 Nov 2022 21:03:05 +0100 Message-Id: <20221115200305.17761-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Ovh-Tracer-Id: 17328725469777814242 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvgedrgeeggddufeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeelueehgfevfeevhffftdetgedugeevveehteeileeuueejhfegffetteffhffhvdenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeehledvkeduseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-xyz.scm (python-dm-tree): New variable. --- gnu/packages/python-xyz.scm | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 1758450c2f..fafacc4d94 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -131,6 +131,7 @@ ;;; Copyright © 2022 Mathieu Laparie ;;; Copyright © 2022 Garek Dyszel ;;; Copyright © 2022 Baptiste Strazzulla +;;; Copyright © 2022 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -159,6 +160,7 @@ (define-module (gnu packages python-xyz) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) #:use-module (gnu packages crypto) #:use-module (gnu packages databases) #:use-module (gnu packages dbm) @@ -4618,6 +4620,72 @@ (define-public autokey flexibility and power of the Python language.") (license license:gpl3+))) +(define-public python-dm-tree + (package + (name "python-dm-tree") + (version "0.1.7") + (source + (origin + (method url-fetch) + (uri (pypi-uri "dm-tree" version)) + (sha256 + (base32 "0apxfxgmqh22qpk92zmmf3acqkavhwxz78lnwz026a5rlnncizih")))) + (build-system python-build-system) + (inputs (list pybind11 abseil-cpp python)) + (propagated-inputs (list python-wheel + python-absl-py + python-attrs + python-numpy + python-wrapt)) + (arguments + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'build-shared-lib + (lambda _ + (let* ((pybind11 #$(this-package-input "pybind11")) + (python #$(this-package-input "python")) + (abseil-cpp #$(this-package-input "abseil-cpp"))) + ;; Delete default cmake build. + (substitute* "setup.py" + (("ext_modules.*") "") + (("cmdclass.*") "")) + ;; Actual build phase. + (mkdir-p "build/temp/tree/") + (invoke + "gcc" "-pthread" "-Wno-unused-result" "-Wsign-compare" + "-DNDEBUG" "-g" "-fwrapv" "-O3" "-Wall" + "-fno-semantic-interposition" "-fPIC" + "-I" (string-append + pybind11 "/lib/python3.9/site-packages/pybind11/include") + "-I" (string-append python "/include/python3.9") + "-I" (string-append abseil-cpp "/include") + "-c" "tree/tree.cc" + "-o" "build/temp/tree/tree.o" + "-fvisibility=hidden" "-g0") + (mkdir-p "build/lib/tree") + (invoke + "g++" "-pthread" "-shared" + (string-append "-Wl," "-rpath=" python "/lib") + "-fno-semantic-interposition" + "build/temp/tree/tree.o" + "-L" (string-append python "/lib") + "-L" (string-append abseil-cpp "/lib") + "-l" "absl_int128" + "-l" "absl_raw_hash_set" + "-l" "absl_raw_logging_internal" + "-l" "absl_strings" + "-l" "absl_throw_delegate" + "-o" "build/lib/tree/_tree.so"))))))) + (home-page "https://github.com/deepmind/tree") + (synopsis "Work with nested data structures in python.") + (description "Tree is a python library for working with nested +data structures. In a way, @code{tree} generalizes the builtin map +function which only supports flat sequences, and allows to apply a +function to each leaf preserving the overall structure.") + (license license:asl2.0))) + (define-public python-docutils (package (name "python-docutils")