From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mEoPBEJKz18fTgAA0tVLHw (envelope-from ) for ; Tue, 08 Dec 2020 09:41:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id qCdyO0FKz18kLgAAB5/wlQ (envelope-from ) for ; Tue, 08 Dec 2020 09:41:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A70629402DD for ; Tue, 8 Dec 2020 09:41:21 +0000 (UTC) Received: from localhost ([::1]:55178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmZUm-000322-KQ for larch@yhetil.org; Tue, 08 Dec 2020 04:41:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmZUU-00031l-0d for guix-patches@gnu.org; Tue, 08 Dec 2020 04:41:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kmZUT-0005ua-ME for guix-patches@gnu.org; Tue, 08 Dec 2020 04:41:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kmZUT-0008AV-Iv for guix-patches@gnu.org; Tue, 08 Dec 2020 04:41:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44978] [PATCH] gnu: packages: Add tiny-bignum. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Dec 2020 09:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44978 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ryan Prior Cc: 44978@debbugs.gnu.org Received: via spool by 44978-submit@debbugs.gnu.org id=B44978.160742043931362 (code B ref 44978); Tue, 08 Dec 2020 09:41:01 +0000 Received: (at 44978) by debbugs.gnu.org; 8 Dec 2020 09:40:39 +0000 Received: from localhost ([127.0.0.1]:56593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmZU6-00089m-Ke for submit@debbugs.gnu.org; Tue, 08 Dec 2020 04:40:39 -0500 Received: from mira.cbaines.net ([212.71.252.8]:48262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmZU1-00089a-GD for 44978@debbugs.gnu.org; Tue, 08 Dec 2020 04:40:36 -0500 Received: from localhost (188.29.103.89.threembb.co.uk [188.29.103.89]) by mira.cbaines.net (Postfix) with ESMTPSA id 4622827BC01; Tue, 8 Dec 2020 09:40:32 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 33f7b003; Tue, 8 Dec 2020 09:40:29 +0000 (UTC) References: <20201201014454.18663-1-rprior@protonmail.com> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines In-reply-to: <20201201014454.18663-1-rprior@protonmail.com> Date: Tue, 08 Dec 2020 09:40:27 +0000 Message-ID: <87o8j4iqk4.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.90 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: A70629402DD X-Spam-Score: -1.90 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: QoWTcNn17KDC --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hey, I've pushed this to master as ab58b2cc32068fc9e5f0a7c7ae112349943b7dfd with a few changes. Ryan Prior via Guix-patches via writes: > * gnu/packages/maths.scm (tiny-bignum): New variable. I removed packages: from the commit message, I think just gnu: Add foo. is the convention. > --- > gnu/packages/maths.scm | 46 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 46 insertions(+) > > diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm > index d3f3539e26..a0dd9a761c 100644 > --- a/gnu/packages/maths.scm > +++ b/gnu/packages/maths.scm > @@ -4984,6 +4984,52 @@ be fed to @command{tcalc} through the command line= .") > (home-page "https://sites.google.com/site/mohammedisam2000/tcalc") > (license license:gpl3+))) >=20=20 > +(define-public tiny-bignum > + (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4")) > + (package > + (name "tiny-bignum") > + (version (git-version "0" "0" commit)) > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/kokke/tiny-bignum-c") > + (commit commit))) > + (file-name (git-file-name "tiny-bignum" commit)) > + (sha256 > + (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6")= ))) > + (build-system gnu-build-system) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (delete 'configure) > + (replace 'check > + (lambda _ > + (substitute* "scripts/test_rand.py" > + (("\t") " ") > + (("\" % (\\w+)" _ symbol) (string-append "\" % int(" sym= bol ")"))) > + (invoke "make" "test"))) I split this phase, so 'check just does the testing, and I tweaked it to use the tests? argument. > + (replace 'install > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((share (string-append (assoc-ref outputs "out") "/sh= are")) > + (doc (string-append (assoc-ref outputs "out") "/doc"= ))) > + (mkdir-p share) > + (install-file "bn.c" share) > + (install-file "bn.h" share) > + (mkdir-p doc) > + (install-file "LICENSE" doc) > + (install-file "README.md" doc))))))) The build output showed: ## WARNING: phase `install' returned `#'. Return values other= than #t ## are deprecated. Please migrate this package so that its phase ## procedures report errors by raising an exception, and otherwise ## always return #t. So I added #t at the end. > + (native-inputs > + `(("python" ,python-wrapper))) > + (home-page "https://github.com/kokke/tiny-bignum-c") > + (synopsis "Small portable multiple-precision unsigned integer arith= metic in C") > + (description > + "This library provides portable Arbitrary-precision unsigned integ= er > +arithmetic in C, for calculating with large numbers. Basic arithmetic (= +, -, > +*, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decre= ments > +and comparisons are supported.") > + (license license:unlicense)))) > + > (define-public sundials > (package > (name "sundials") Final thing, I'm not sure the location of the bn.c and bn.h files in the output are particularly conventional. I'd expect the .h file to be in include I think, rather than share. Also, with a C library, I think you'd expect to have a .so file in lib, and the .c file not to be included. Looking ahead to where you're using this, I think I see why you've done it this way, but it could mean that using this package is harder in other packages. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/PSgtfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XetPxAAp4cgnVZ1ShS9rgs5f9nFKTKcU8Ld8bvV G3Rm8d+MD+SIf+PGA7LyaeujM1fmkfIbtysxSRSBPAX8jKhiBKgBWh+UVTbl9Qsq mxljvbBXdKFpg2qQykHFPcjlp7EYssGjrMVDBR9AK+SYw77l5dh+nE37gO3YwRr+ KKl4xYQpe0wRD8bSlkJUuVhQWeg1Y4e+7AZGHAJ2zKleIomY4maAtS+hc8jCMZTE CbzLiuhrD84PalLzfEU/U86YtSAMX1zQfi1gFJySdqwxX2+VcWqF+QZIQLvrvT4g Lo+S4lDu7ejbOUb7/L3hidPGCjkH5d50ORlVWK339Top2TjIFy4oysZKdq2mA7zs PnCHr1p7CXVeXLHCB5L2nOMwWpaHmALSmlej6u7QeEzLrZQN/gN3FimHsKAhiYdn GW4bsB3S6h4E3eNvAZLdLR9/3wRmDVfzbKKJGJb9jiO9RP3Ja4PWe3n8N4akioO9 Ey10YuQQo+Gni9h90UUDqizRjhgZ7wukJijgy92OvfzK1093bUvxzBUFaN2BtSZS j8/tmipoWkuUqlZajQzMqo8BRoL0vkZ9fDs0nDniLUO4w1lRHd4VrjQB0ovo2VYm Tu9iiUjX+uYHVwxfJyYcRaWV0Tl7OO/uwJyArfX3gsUqVEsLQr+flLYUA/RGlInf 2NIOenacdwM= =CyDV -----END PGP SIGNATURE----- --=-=-=--