git: b4c5f10e7375 - main - math/mate-calc: Update to 1.26.0

From: Neel Chauhan <nc_at_FreeBSD.org>
Date: Sat, 09 Oct 2021 23:33:49 UTC
The branch main has been updated by nc:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b4c5f10e73750c5f259955cedab867d6aed5f43f

commit b4c5f10e73750c5f259955cedab867d6aed5f43f
Author:     Neel Chauhan <nc@FreeBSD.org>
AuthorDate: 2021-10-09 20:05:15 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2021-10-09 23:33:25 +0000

    math/mate-calc: Update to 1.26.0
---
 math/mate-calc/Makefile                        |  4 +-
 math/mate-calc/distinfo                        |  6 +-
 math/mate-calc/files/patch-src_mate-calc-cmd.c | 12 ++--
 math/mate-calc/files/patch-src_mp-convert.c    | 20 +++++++
 math/mate-calc/files/patch-src_mp.c            | 81 ++++++++++++++++++++++++++
 math/mate-calc/files/patch-src_mp.h            | 29 +++++++++
 6 files changed, 142 insertions(+), 10 deletions(-)

diff --git a/math/mate-calc/Makefile b/math/mate-calc/Makefile
index d189fc1f7e30..7478d55fe613 100644
--- a/math/mate-calc/Makefile
+++ b/math/mate-calc/Makefile
@@ -1,7 +1,7 @@
 # Created by: Joe Marcus Clarke <marcus@FreeBSD.org>
 
 PORTNAME=	mate-calc
-PORTVERSION=	1.24.2
+PORTVERSION=	1.26.0
 CATEGORIES=	math mate
 MASTER_SITES=	MATE
 DIST_SUBDIR=	mate
@@ -13,6 +13,8 @@ LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/COPYING
 
 BUILD_DEPENDS=	itstool:textproc/itstool
+LIB_DEPENDS=	libmpc.so:math/mpc \
+		libmpfr.so:math/mpfr
 
 PORTSCOUT=	limitw:1,even
 
diff --git a/math/mate-calc/distinfo b/math/mate-calc/distinfo
index bd8d03333106..e31327da1c47 100644
--- a/math/mate-calc/distinfo
+++ b/math/mate-calc/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1623536041
-SHA256 (mate/mate-calc-1.24.2.tar.xz) = d4a4c8ff51c4611b32a129b7cad33c3bb8a1ec6b9d5f209aa4ee0c8f1b90e8f9
-SIZE (mate/mate-calc-1.24.2.tar.xz) = 969912
+TIMESTAMP = 1633808415
+SHA256 (mate/mate-calc-1.26.0.tar.xz) = 7eb826801dda5d7b070e41d9e831df2ad24459be6c96fe9c0506c21e1374ad55
+SIZE (mate/mate-calc-1.26.0.tar.xz) = 983272
diff --git a/math/mate-calc/files/patch-src_mate-calc-cmd.c b/math/mate-calc/files/patch-src_mate-calc-cmd.c
index 86806b5f0b01..86d91a8d7f28 100644
--- a/math/mate-calc/files/patch-src_mate-calc-cmd.c
+++ b/math/mate-calc/files/patch-src_mate-calc-cmd.c
@@ -1,5 +1,5 @@
---- src/mate-calc-cmd.c.orig	2013-03-24 20:56:44.000000000 -0500
-+++ src/mate-calc-cmd.c	2013-03-24 20:58:28.000000000 -0500
+--- src/mate-calc-cmd.c.orig	2021-08-04 12:19:50 UTC
++++ src/mate-calc-cmd.c
 @@ -8,10 +8,12 @@
   * license.
   */
@@ -13,10 +13,11 @@
  #include <time.h>
  #include <locale.h>
  
-@@ -22,6 +24,77 @@
+@@ -21,6 +23,77 @@
+ #define MAXLINE 1024
  
  static MpSerializer *result_serializer;
- 
++
 +#if __FreeBSD_version < 800067
 +static ssize_t
 +getline (char **lineptr, size_t *n, FILE *stream)
@@ -87,7 +88,6 @@
 +	return p - *lineptr;
 +}
 +#endif
-+
+ 
  static void
  solve(const char *equation)
- {
diff --git a/math/mate-calc/files/patch-src_mp-convert.c b/math/mate-calc/files/patch-src_mp-convert.c
new file mode 100644
index 000000000000..46d23a217636
--- /dev/null
+++ b/math/mate-calc/files/patch-src_mp-convert.c
@@ -0,0 +1,20 @@
+--- src/mp-convert.c.orig	2021-10-09 20:03:44 UTC
++++ src/mp-convert.c
+@@ -40,7 +40,7 @@ mp_set_from_integer(long x, MPNumber *z)
+ 
+ 
+ void
+-mp_set_from_unsigned_integer(ulong x, MPNumber *z)
++mp_set_from_unsigned_integer(unsigned long x, MPNumber *z)
+ {
+     mpc_set_ui(z->num, x, MPC_RNDNN);
+ }
+@@ -95,7 +95,7 @@ mp_to_integer(const MPNumber *x)
+ }
+ 
+ 
+-ulong
++unsigned long
+ mp_to_unsigned_integer(const MPNumber *x)
+ {
+     return mpfr_get_ui(mpc_realref(x->num), MPFR_RNDN);
diff --git a/math/mate-calc/files/patch-src_mp.c b/math/mate-calc/files/patch-src_mp.c
new file mode 100644
index 000000000000..af5c5de16a25
--- /dev/null
+++ b/math/mate-calc/files/patch-src_mp.c
@@ -0,0 +1,81 @@
+--- src/mp.c.orig	2021-08-04 12:19:50 UTC
++++ src/mp.c
+@@ -59,7 +59,7 @@ mp_new(void)
+ }
+ 
+ MPNumber
+-mp_new_from_unsigned_integer(ulong x)
++mp_new_from_unsigned_integer(unsigned long x)
+ {
+     MPNumber z;
+     mpc_init2(z.num, PRECISION);
+@@ -413,16 +413,16 @@ mp_reciprocal(const MPNumber *x, MPNumber *z)
+ void
+ mp_root(const MPNumber *x, long n, MPNumber *z)
+ {
+-    ulong p;
++    unsigned long p;
+ 
+     if (n < 0)
+     {
+         mpc_ui_div(z->num, 1, x->num, MPC_RNDNN);
+ 
+         if (n == LONG_MIN)
+-            p = (ulong) LONG_MAX + 1;
++            p = (unsigned long) LONG_MAX + 1;
+         else
+-            p = (ulong) -n;
++            p = (unsigned long) -n;
+     }
+     else if (n > 0)
+     {
+@@ -490,7 +490,7 @@ mp_factorial(const MPNumber *x, MPNumber *z)
+     else
+     {
+         /* Convert to integer - if couldn't be converted then the factorial would be too big anyway */
+-        ulong value = mp_to_unsigned_integer(x);
++        unsigned long value = mp_to_unsigned_integer(x);
+         mpfr_fac_ui(mpc_realref(z->num), value, MPFR_RNDN);
+         mpfr_set_zero(mpc_imagref(z->num), MPFR_RNDN);
+     }
+@@ -656,11 +656,11 @@ mp_zeta(const MPNumber *x, MPNumber *z)
+  * Returns TRUE if @n is probable prime and FALSE otherwise.
+  */
+ static bool
+-mp_is_pprime(MPNumber *n, ulong rounds)
++mp_is_pprime(MPNumber *n, unsigned long rounds)
+ {
+     MPNumber tmp = mp_new();
+     MPNumber two = mp_new_from_unsigned_integer(2);
+-    ulong l = 0;
++    unsigned long l = 0;
+     bool is_pprime = TRUE;
+ 
+     /* Write t := n-1 = 2^l * q with q odd */
+@@ -680,7 +680,7 @@ mp_is_pprime(MPNumber *n, ulong rounds)
+     MPNumber a = mp_new_from_unsigned_integer(1);
+     MPNumber b = mp_new();
+ 
+-    for (ulong i = 1; (i < mp_to_integer(&t)) && (i <= rounds+1); i++)
++    for (unsigned long i = 1; (i < mp_to_integer(&t)) && (i <= rounds+1); i++)
+     {
+         mp_add_integer(&a, 1, &a);
+         mp_modular_exponentiation(&a, &q, n, &b);
+@@ -752,7 +752,7 @@ mp_gcd (const MPNumber *a, const MPNumber *b, MPNumber
+  * Returns FALSE otherwise.
+  */
+ static bool
+-mp_pollard_rho (const MPNumber *n, ulong i, MPNumber *z)
++mp_pollard_rho (const MPNumber *n, unsigned long i, MPNumber *z)
+ {
+     MPNumber one = mp_new_from_unsigned_integer(1);
+     MPNumber two = mp_new_from_unsigned_integer(2);
+@@ -809,7 +809,7 @@ static void
+ find_big_prime_factor (const MPNumber *n, MPNumber *z)
+ {
+     MPNumber tmp = mp_new();
+-    ulong i = 2;
++    unsigned long i = 2;
+ 
+     while (TRUE)
+     {
diff --git a/math/mate-calc/files/patch-src_mp.h b/math/mate-calc/files/patch-src_mp.h
new file mode 100644
index 000000000000..e039e6f89d73
--- /dev/null
+++ b/math/mate-calc/files/patch-src_mp.h
@@ -0,0 +1,29 @@
+--- src/mp.h.orig	2021-10-09 19:59:01 UTC
++++ src/mp.h
+@@ -69,7 +69,7 @@ void        mperr(const char *format, ...) __attribute
+ /* Returns initialized MPNumber object */
+ MPNumber    mp_new(void);
+ 
+-MPNumber    mp_new_from_unsigned_integer(ulong x);
++MPNumber    mp_new_from_unsigned_integer(unsigned long x);
+ 
+ MPNumber*   mp_new_ptr(void);
+ 
+@@ -236,7 +236,7 @@ void   mp_set_from_double(double x, MPNumber *z);
+ void   mp_set_from_integer(long x, MPNumber *z);
+ 
+ /* Sets z = x */
+-void   mp_set_from_unsigned_integer(ulong x, MPNumber *z);
++void   mp_set_from_unsigned_integer(unsigned long x, MPNumber *z);
+ 
+ /* Sets z = numerator รท denominator */
+ void   mp_set_from_fraction(long numerator, long denominator, MPNumber *z);
+@@ -265,7 +265,7 @@ double mp_to_double(const MPNumber *x);
+ long mp_to_integer(const MPNumber *x);
+ 
+ /* Returns x as a native unsigned integer */
+-ulong mp_to_unsigned_integer(const MPNumber *x);
++unsigned long mp_to_unsigned_integer(const MPNumber *x);
+ 
+ /* Sets z = sin x */
+ void   mp_sin(const MPNumber *x, MPAngleUnit unit, MPNumber *z);