GNU bug report logs - #34615
[PATCH] gnu: Add libtommath.

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Fri, 22 Feb 2019 12:22:02 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34615 in the body.
You can then email your comments to 34615 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Fri, 22 Feb 2019 12:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 22 Feb 2019 12:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: guix-patches <at> gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH] gnu: Add libtommath.
Date: Fri, 22 Feb 2019 14:20:14 +0200
* gnu/packages/algebra.scm (libtommath): New variable.
---
 gnu/packages/algebra.scm | 47 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index f9ae22b3f3..98dc414ac5 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2016, 2017, 2018, 2019 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
 ;;; Copyright © 2014, 2018 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado <at> elephly.net>
-;;; Copyright © 2017 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2017, 2019 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2017 Marius Bakke <mbakke <at> fastmail.com>
 ;;; Copyright © 2017, 2019 Eric Bavier <bavier <at> member.fsf.org>
@@ -1000,3 +1000,48 @@ objects.")
     ;; means that the gpl2+ licence of GAP itself applies, but to be on the
     ;; safe side, we drop them for now.
     (license license:gpl2+)))
+
+(define-public libtommath
+  (package
+    (name "libtommath")
+    (version "1.1.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://github.com/libtom/libtommath/releases/"
+                            "download/v" version "/ltm-" version ".tar.xz"))
+        (sha256
+         (base32
+          "1bbyagqzfdbg37k1n08nsqzdf44z8zsnjjinqbsyj7rxg246qilh"))
+        (patches (search-patches "libtommath-fix-linkage.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure) ; no configure
+         (add-after 'unpack 'prepare-build
+           (lambda _
+             ;; Don't pull in coreutils.
+             (substitute* "makefile_include.mk"
+               (("arch") "uname -m"))
+             (delete-file "makefile")
+             (symlink "makefile.shared" "makefile")
+             #t))
+         (replace 'check
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (apply invoke "make" "test_standalone" make-flags)
+             (invoke "sh" "test")))
+         (add-after 'check 'make-static
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (apply invoke "make" "-f" "makefile.unix" "install" make-flags))))
+       #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+                          "CC=gcc")))
+    (native-inputs
+     `(("libtool" ,libtool)))
+    (home-page "https://www.libtom.net/LibTomMath/")
+    (synopsis "portable number theoretic multiple-precision integer library")
+    (description "LibTomMath is a portable number theoretic multiple-precision
+integer library written entirely in C.  The library is designed to provide a
+simple to work with API that provides fairly efficient routines that build out
+of the box without configuration.")
+    (license license:unlicense)))
-- 
2.20.1





Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Fri, 22 Feb 2019 12:28:01 GMT) Full text and rfc822 format available.

Message #8 received at 34615 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 34615 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add libtommath.
Date: Fri, 22 Feb 2019 14:27:37 +0200
[Message part 1 (text/plain, inline)]
Looks like I sent the email and forgot to add the patch to the package
definition patch.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[0001-gnu-Add-libtommath.patch (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Fri, 22 Feb 2019 18:58:02 GMT) Full text and rfc822 format available.

Message #11 received at 34615 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <somebody <at> not-sent-or-endorsed-by.tobias.gr>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 34615 <at> debbugs.gnu.org
Subject: Re: [bug#34615] [PATCH] gnu: Add libtommath.
Date: Fri, 22 Feb 2019 19:57:25 +0100
Efraim,

Thanks!

Efraim Flashner wrote:
> * gnu/packages/algebra.scm (libtommath): New variable.

> + (add-after 'unpack 'prepare-build
> +   (lambda _
> +     ;; Don't pull in coreutils.
> +     (substitute* "makefile_include.mk"
> +       (("arch") "uname -m"))

I'd add an empty line here or separate this into two fases just to 
be very clear, since…

> +     (delete-file "makefile")
> +     (symlink "makefile.shared" "makefile")
> +     #t))

…I got a bit lost between all these makefiles.  Could you explain 
exactly what's going on?

Is this to avoid repeating ‘-f makefile.shared’ elsewhere?

> + (add-after 'check 'make-static

More accurate: 'install-static-library.

While libtommath.a is ‘only’ 332K, that's almost half of the 
entire output size.  Is it worth moving to a separate :static 
output?

> + (synopsis "portable number theoretic multiple-precision 
> integer library")

s/p/P/

multiprecision.scm is a better fit and already has sister package 
tomsfastmath to keep this one company.

> +integer library written entirely in C.  The library is designed 
> to provide a

s/The library is/It's/ IMO.

> +simple to work with API

‘simple-to-work-with API’, unfortunately.

Kind regards,

T G-R




Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Fri, 22 Feb 2019 22:32:02 GMT) Full text and rfc822 format available.

Message #14 received at 34615 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 34615 <at> debbugs.gnu.org
Subject: Re: [bug#34615] [PATCH] gnu: Add libtommath.
Date: Fri, 22 Feb 2019 23:30:54 +0100
Efraim,

I noticed some PDF documentation that isn't currently installed. 
How about:

 (add-after 'build 'install-documentation
   (lambda* (#:key outputs #:allow-other-keys)
     (let* ((out (assoc-ref outputs "out"))
            (doc (string-append out "/share/doc/" ,name "-" 
            ,version)))
       (for-each (lambda (file) (install-file file doc))
                 (find-files "doc" "\\.pdf$"))
       #t))))

(This mail was supposed to be longer because it *is* possible to 
regenerate al least bn.pdf from the .tex sources, but an hour and 
6 GiB of texlive grafting later I don't have the energy to remove 
the non-determininstic date on their front page.  Foo.)

Kind regards,

T G-R




Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Sat, 23 Feb 2019 09:07:02 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: swedebugia <swedebugia <at> riseup.net>
To: guix-patches <at> gnu.org,
 Tobias Geerinckx-Rice <somebody <at> not-sent-or-endorsed-by.tobias.gr>,
 Efraim Flashner <efraim <at> flashner.co.il>
Cc: 34615 <at> debbugs.gnu.org
Subject: Re: [bug#34615] [PATCH] gnu: Add libtommath.
Date: Sat, 23 Feb 2019 10:06:07 +0100
Tobias Geerinckx-Rice <somebody <at> not-sent-or-endorsed-by.tobias.gr> skrev: (22 februari 2019 19:57:25 CET)
>Efraim,
>
>Thanks!
>
>Efraim Flashner wrote:

>
>> +integer library written entirely in C.  The library is designed 
>> to provide a
>
>s/The library is/It's/ IMO.
>
>> +simple to work with API
>
>‘simple-to-work-with API’, unfortunately.

I suggest:. ..an API that is simple to work with.


-- 
Sent from my k-9 mail for Android.




Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Sat, 23 Feb 2019 09:07:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Sun, 24 Feb 2019 07:46:01 GMT) Full text and rfc822 format available.

Message #23 received at 34615 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 34615 <at> debbugs.gnu.org
Subject: Re: [bug#34615] [PATCH] gnu: Add libtommath.
Date: Sun, 24 Feb 2019 09:45:07 +0200
[Message part 1 (text/plain, inline)]
On Fri, Feb 22, 2019 at 11:30:54PM +0100, Tobias Geerinckx-Rice wrote:
> Efraim,
> 
> I noticed some PDF documentation that isn't currently installed. How about:
> 
>  (add-after 'build 'install-documentation
>    (lambda* (#:key outputs #:allow-other-keys)
>      (let* ((out (assoc-ref outputs "out"))
>             (doc (string-append out "/share/doc/" ,name "-"
> ,version)))
>        (for-each (lambda (file) (install-file file doc))
>                  (find-files "doc" "\\.pdf$"))
>        #t))))
> 
> (This mail was supposed to be longer because it *is* possible to regenerate
> al least bn.pdf from the .tex sources, but an hour and 6 GiB of texlive
> grafting later I don't have the energy to remove the non-determininstic date
> on their front page.  Foo.)
> 

I wanted to keep the install size smaller so I hadn't planned on
installing the documentation. Considering we don't build the
documentation currently, if there are PDFs that are shipped with the
source I should probably delete those in a snippet.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Sun, 24 Feb 2019 07:48:02 GMT) Full text and rfc822 format available.

Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: swedebugia <swedebugia <at> riseup.net>
Cc: Tobias Geerinckx-Rice <somebody <at> not-sent-or-endorsed-by.tobias.gr>,
 34615 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#34615] [PATCH] gnu: Add libtommath.
Date: Sun, 24 Feb 2019 09:47:05 +0200
[Message part 1 (text/plain, inline)]
On Sat, Feb 23, 2019 at 10:06:07AM +0100, swedebugia wrote:
> Tobias Geerinckx-Rice <somebody <at> not-sent-or-endorsed-by.tobias.gr> skrev: (22 februari 2019 19:57:25 CET)
> >Efraim,
> >
> >Thanks!
> >
> >Efraim Flashner wrote:
> 
> >
> >> +integer library written entirely in C.  The library is designed 
> >> to provide a
> >
> >s/The library is/It's/ IMO.
> >
> >> +simple to work with API
> >
> >‘simple-to-work-with API’, unfortunately.
> 
> I suggest:. ..an API that is simple to work with.
> 

This sounds good. I checked Debian's description¹ and it's much longer,
although they do manage to skip discussing the API.

¹ https://sources.debian.org/src/libtommath/1.1.0-3/debian/control/

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Sun, 24 Feb 2019 07:48:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#34615; Package guix-patches. (Sun, 24 Feb 2019 07:51:02 GMT) Full text and rfc822 format available.

Message #32 received at 34615 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Tobias Geerinckx-Rice <somebody <at> not-sent-or-endorsed-by.tobias.gr>
Cc: 34615 <at> debbugs.gnu.org
Subject: Re: [bug#34615] [PATCH] gnu: Add libtommath.
Date: Sun, 24 Feb 2019 09:50:28 +0200
[Message part 1 (text/plain, inline)]
On Fri, Feb 22, 2019 at 07:57:25PM +0100, Tobias Geerinckx-Rice wrote:
> Efraim,
> 
> Thanks!
> 
> Efraim Flashner wrote:
> > * gnu/packages/algebra.scm (libtommath): New variable.
> 
> > + (add-after 'unpack 'prepare-build
> > +   (lambda _
> > +     ;; Don't pull in coreutils.
> > +     (substitute* "makefile_include.mk"
> > +       (("arch") "uname -m"))
> 
> I'd add an empty line here or separate this into two fases just to be very
> clear, since…
> 

Sounds good. I didn't want to toss in a couple of one-liner phases, so
I'll make it clearer.

> > +     (delete-file "makefile")
> > +     (symlink "makefile.shared" "makefile")
> > +     #t))
> 
> …I got a bit lost between all these makefiles.  Could you explain exactly
> what's going on?
> 
> Is this to avoid repeating ‘-f makefile.shared’ elsewhere?

Yeah, basically. Pkgsrc has a keyword to use makefile.shared and Debian
passes '-f makefile.shared' in all its phases, this seemed much eaiser.

> 
> > + (add-after 'check 'make-static
> 
> More accurate: 'install-static-library.

Sounds good

> 
> While libtommath.a is ‘only’ 332K, that's almost half of the entire output
> size.  Is it worth moving to a separate :static output?
> 

As far as size goes I decided against it since it is so small, but by
putting libtommath.a in a separate output it does prevent other packages
from picking up the wrong one. Sounds good.

> > + (synopsis "portable number theoretic multiple-precision integer
> > library")
> 
> s/p/P/
> 
> multiprecision.scm is a better fit and already has sister package
> tomsfastmath to keep this one company.

I didn't see that one. I'll stick it next to that one.

> 
> > +integer library written entirely in C.  The library is designed to
> > provide a
> 
> s/The library is/It's/ IMO.
> 
> > +simple to work with API
> 
> ‘simple-to-work-with API’, unfortunately.
> 
> Kind regards,
> 
> T G-R

Thanks

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Sun, 24 Feb 2019 08:53:01 GMT) Full text and rfc822 format available.

Notification sent to Efraim Flashner <efraim <at> flashner.co.il>:
bug acknowledged by developer. (Sun, 24 Feb 2019 08:53:01 GMT) Full text and rfc822 format available.

Message #37 received at 34615-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 34615-done <at> debbugs.gnu.org
Subject: Re: [bug#34615] [PATCH] gnu: Add libtommath.
Date: Sun, 24 Feb 2019 10:52:03 +0200
[Message part 1 (text/plain, inline)]
Pushed with changes suggested

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 24 Mar 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.