git: ccb729989bd0 - main - math/lcalc: upgrade to 2.0.5

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Wed, 27 Apr 2022 16:23:12 UTC
The branch main has been updated by thierry:

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

commit ccb729989bd01b5084702152e2d02de3ea5c7984
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-04-27 16:07:47 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-04-27 16:23:07 +0000

    math/lcalc: upgrade to 2.0.5
    
    Changelog at <https://gitlab.com/sagemath/lcalc/-/blob/master/doc/ChangeLog>.
---
 math/lcalc/Makefile                                |  23 +-
 math/lcalc/distinfo                                |   6 +-
 math/lcalc/files/patch-include_L.h                 |  20 --
 math/lcalc/files/patch-include_Lcommandline.h      |  20 --
 .../files/patch-include_Lcommandline__elliptic.h   |  20 --
 .../patch-include_Lcommandline__numbertheory.h     |  18 --
 math/lcalc/files/patch-include_Lcommon.h           |  16 --
 math/lcalc/files/patch-include_Lcommon__ld.h       |  17 --
 math/lcalc/files/patch-include_Lcomplex.h          |  28 ---
 .../lcalc/files/patch-include_Ldirichlet__series.h |  20 --
 math/lcalc/files/patch-include_Ldokchitser.h       |  43 ----
 .../lcalc/files/patch-include_Lexplicit__formula.h |  17 --
 math/lcalc/files/patch-include_Lgamma.h            |  65 ------
 math/lcalc/files/patch-include_Lglobals.h          |  21 --
 math/lcalc/files/patch-src_Lcommandline.cc         |  36 ----
 .../files/patch-src_Lcommandline__elliptic.cc      |  62 ------
 math/lcalc/files/patch-src_Makefile                | 235 ---------------------
 math/lcalc/pkg-descr                               |   2 +-
 math/lcalc/pkg-plist                               |  80 ++++---
 19 files changed, 53 insertions(+), 696 deletions(-)

diff --git a/math/lcalc/Makefile b/math/lcalc/Makefile
index ff0d90cb1d3d..5971dbb8fb96 100644
--- a/math/lcalc/Makefile
+++ b/math/lcalc/Makefile
@@ -1,8 +1,7 @@
 # Created by: thierry@pompo.net
 
 PORTNAME=	lcalc
-PORTVERSION=	1.23
-PORTREVISION=	2
+PORTVERSION=	2.0.5
 CATEGORIES=	math
 MASTER_SITES=	ftp://ftp.fu-berlin.de/unix/misc/sage/spkg/upstream/lcalc/
 
@@ -11,6 +10,7 @@ COMMENT=	L-function c++ class library and the CLI program lcalc
 
 LICENSE=	GPLv2+
 
+BUILD_DEPENDS=	gengetopt:devel/gengetopt
 LIB_DEPENDS=	libgmp.so:math/gmp	\
 		libmpfr.so:math/mpfr	\
 		libpari.so:math/pari
@@ -20,17 +20,20 @@ LIB_DEPENDS=	libgmp.so:math/gmp	\
 #GH_PROJECT=	l-calc
 #GH_TAGNAME=	4c57471
 
-USES=		compiler:c++11-lang gmake localbase tar:bz2
+USES=		compiler:c++11-lang gmake libtool localbase tar:xz
 
-PATCH_WRKSRC=	${WRKDIR}/${DISTNAME}
-WRKSRC_SUBDIR=	src
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--with-pari
+INSTALL_TARGET=	install-strip
+TEST_TARGET=	check
 USE_LDCONFIG=	yes
 
-MAKE_ENV=	MAKE=${GMAKE} STAGEDIR=${STAGEDIR}
+OPTIONS_DEFINE=	DOCS EXAMPLES
 
-post-stage:
-	cd ${STAGEDIR}${PREFIX}/lib && ${MV} libLfunction.so libLfunction.so.0
-	${LN} -sf libLfunction.so.0 ${STAGEDIR}${PREFIX}/lib/libLfunction.so
-	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+pre-configure:
+.for dir in . data
+	${REINPLACE_CMD} -e 's|@docdir@/examples|${EXAMPLESDIR}|'	\
+		${WRKSRC}/doc/examples/${dir}/Makefile.in
+.endfor
 
 .include <bsd.port.mk>
diff --git a/math/lcalc/distinfo b/math/lcalc/distinfo
index 35d57883ac15..23fafd79a282 100644
--- a/math/lcalc/distinfo
+++ b/math/lcalc/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1585493725
-SHA256 (lcalc-1.23.tar.bz2) = 83d4253ec2f38553b21190d6d0c6b71bab7ea14717f6dde5bd18f60775d3cdb0
-SIZE (lcalc-1.23.tar.bz2) = 491589
+TIMESTAMP = 1651073020
+SHA256 (lcalc-2.0.5.tar.xz) = d780c385579cc6ee45fa27ccd2d3a3c4157fbb5ef8cd1b8951d1028bbc64c035
+SIZE (lcalc-2.0.5.tar.xz) = 830360
diff --git a/math/lcalc/files/patch-include_L.h b/math/lcalc/files/patch-include_L.h
deleted file mode 100644
index 005ecdbf3e7a..000000000000
--- a/math/lcalc/files/patch-include_L.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- include/L.h.orig	2012-08-08 21:21:55 UTC
-+++ include/L.h
-@@ -18,6 +18,8 @@
-    with the package; see the file 'COPYING'. If not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-+   Patches borrowed from SageMath.
-+
- */
- 
- 
-@@ -491,7 +493,7 @@ class L_function (public)
- 
-     //#include "Ldirichlet_series.h" //for computing Dirichlet series
-     Complex partial_dirichlet_series(Complex s, long long N1, long long N2);
--    Complex dirichlet_series(Complex s, long long N);
-+    Complex dirichlet_series(Complex s, long long N=-1LL);
- 
-     //#include "Ltaylor_series.h" //for computing taylor series for Dirichlet series
-     //void compute_taylor_series(int N, int K, Complex s_0, Complex *series);
diff --git a/math/lcalc/files/patch-include_Lcommandline.h b/math/lcalc/files/patch-include_Lcommandline.h
deleted file mode 100644
index a9c21ca5ea35..000000000000
--- a/math/lcalc/files/patch-include_Lcommandline.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- include/Lcommandline.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Lcommandline.h
-@@ -18,6 +18,8 @@
-    with the package; see the file 'COPYING'. If not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-+   Patches borrowed from SageMath.
-+
- */
- 
- 
-@@ -39,7 +41,7 @@
- 
- #include "Lcommandline_globals.h"      //command line global variables
- #ifdef INCLUDE_PARI
--#include "pari.h"          //for pari's elliptic curve functions
-+#include "pari/pari.h"          //for pari's elliptic curve functions
- #undef init                //pari has a '#define init pari_init' which
-                            //causes trouble with the stream.h init.
-                            //pari also causes trouble with things like abs.
diff --git a/math/lcalc/files/patch-include_Lcommandline__elliptic.h b/math/lcalc/files/patch-include_Lcommandline__elliptic.h
deleted file mode 100644
index 417c58ee30d1..000000000000
--- a/math/lcalc/files/patch-include_Lcommandline__elliptic.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- include/Lcommandline_elliptic.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Lcommandline_elliptic.h
-@@ -18,6 +18,8 @@
-    with the package; see the file 'COPYING'. If not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-+   Patches borrowed from SageMath.
-+
- */
- 
- 
-@@ -32,7 +34,7 @@
- 
- 
- #ifdef INCLUDE_PARI
--#include "pari.h"          //for pari's elliptic curve functions 
-+#include "pari/pari.h"          //for pari's elliptic curve functions
- #undef init                //pari has a '#define init pari_init' which
-                            //causes trouble with the stream.h init.
-                            //pari also causes trouble with things like abs.
diff --git a/math/lcalc/files/patch-include_Lcommandline__numbertheory.h b/math/lcalc/files/patch-include_Lcommandline__numbertheory.h
deleted file mode 100644
index 16fa639ab987..000000000000
--- a/math/lcalc/files/patch-include_Lcommandline__numbertheory.h
+++ /dev/null
@@ -1,18 +0,0 @@
---- include/Lcommandline_numbertheory.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Lcommandline_numbertheory.h
-@@ -18,12 +18,15 @@
-    with the package; see the file 'COPYING'. If not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-+   Patches borrowed from SageMath.
-+
- */
- 
- 
- #ifndef Lcommandline_numbertheory_H
- #define Lcommandline_numbertheory_H
- 
-+#include <time.h>
- #include <stdlib.h>     //for things like srand
- #include <iostream>     //for input and output
- #include <iomanip>      //for manipulating output such as setprecision
diff --git a/math/lcalc/files/patch-include_Lcommon.h b/math/lcalc/files/patch-include_Lcommon.h
deleted file mode 100644
index d387a197612f..000000000000
--- a/math/lcalc/files/patch-include_Lcommon.h
+++ /dev/null
@@ -1,16 +0,0 @@
---- include/Lcommon.h.orig	2020-03-29 15:43:34 UTC
-+++ include/Lcommon.h
-@@ -1,3 +1,4 @@
-+// Patches borrowed from SageMath.
- // When MPFR is enabled and double is passed to a templated function
- // The function should use precise(ttype) to make sure calculations run
- // within the more precise type
-@@ -48,7 +49,7 @@ const bool outputSeries=true;	  // Whether to output t
- 
- // Loop i from m to n
- // Useful in tidying up most for loops
--#define loop(i,m,n) for(typeof(m) i=(m); i!=(n); i++)
-+#define loop(i,m,n) for(auto i=(m); i!=(n); i++)
- 
- // A class for calculations involving polynomials of small degree
- // Not efficient enough for huge polynomials
diff --git a/math/lcalc/files/patch-include_Lcommon__ld.h b/math/lcalc/files/patch-include_Lcommon__ld.h
deleted file mode 100644
index 96878fcd29da..000000000000
--- a/math/lcalc/files/patch-include_Lcommon__ld.h
+++ /dev/null
@@ -1,17 +0,0 @@
---- include/Lcommon_ld.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Lcommon_ld.h
-@@ -1,3 +1,5 @@
-+// Patches borrowed from SageMath.
-+
- // When MPFR is enabled and double is passed to a templated function
- // The function should use precise(ttype) to make sure calculations run
- // within the more precise type
-@@ -53,7 +55,7 @@ const bool outputSeries=true;	  // Whether to output t
- 
- // Loop i from m to n
- // Useful in tidying up most for loops
--#define loop(i,m,n) for(typeof(m) i=(m); i!=(n); i++)
-+#define loop(i,m,n) for(auto i=(m); i!=(n); i++)
- 
- // A class for calculations involving polynomials of small degree
- // Not efficient enough for huge polynomials
diff --git a/math/lcalc/files/patch-include_Lcomplex.h b/math/lcalc/files/patch-include_Lcomplex.h
deleted file mode 100644
index c84336150ce3..000000000000
--- a/math/lcalc/files/patch-include_Lcomplex.h
+++ /dev/null
@@ -1,28 +0,0 @@
---- include/Lcomplex.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Lcomplex.h
-@@ -34,6 +34,7 @@
- // Initially implemented by Ulrich Drepper <drepper@cygnus.com>
- // Improved by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
- //
-+// Patches borrowed from SageMath.
- 
- /** @file complex
-  *  This is a Standard C++ Library header.  You should @c #include this header
-@@ -45,8 +46,6 @@
- 
- #pragma GCC system_header
- 
--#include <bits/c++config.h>
--
- //no longer include:
- //#include <bits/cpp_type_traits.h>  only thing used was is_floating... 
- //gcc 4.0 cpp_type_traits.h is not compatible with gcc 3.3. 
-@@ -135,7 +134,7 @@ namespace std
-       template<typename _Up>
-         complex<_Tp>& operator/=(const complex<_Up>&);
- 
--      friend reset(complex<_Tp>& C) {
-+      friend void reset(complex<_Tp>& C) {
- 	      reset(C._M_real);
- 	      reset(C._M_imag);
-       }
diff --git a/math/lcalc/files/patch-include_Ldirichlet__series.h b/math/lcalc/files/patch-include_Ldirichlet__series.h
deleted file mode 100644
index 0956c2a34700..000000000000
--- a/math/lcalc/files/patch-include_Ldirichlet__series.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- include/Ldirichlet_series.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Ldirichlet_series.h
-@@ -17,6 +17,8 @@
-    Check the License for details. You should have received a copy of it, along
-    with the package; see the file 'COPYING'. If not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+   
-+   Patches borrowed from SageMath.
- 
- */
- 
-@@ -43,7 +45,7 @@ partial_dirichlet_series(Complex s, long long N1, long
-  //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- template <class ttype>
- Complex L_function <ttype>::
--dirichlet_series(Complex s, long long N=-1)
-+dirichlet_series(Complex s, long long N)
- {
-     Complex z=0.;
-     long long m,n;
diff --git a/math/lcalc/files/patch-include_Ldokchitser.h b/math/lcalc/files/patch-include_Ldokchitser.h
deleted file mode 100644
index 48308ee247da..000000000000
--- a/math/lcalc/files/patch-include_Ldokchitser.h
+++ /dev/null
@@ -1,43 +0,0 @@
---- include/Ldokchitser.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Ldokchitser.h
-@@ -1,3 +1,5 @@
-+// Patches borrowed from SageMath.
-+
- #ifndef Ldokchitser_H
- #define Ldokchitser_H
- 
-@@ -69,7 +71,7 @@ phi_series(int precision)
-     
-     // compute the values m[j] for the respective lambda_k[j]
-     
--    Complex m[N+1];
-+    std::vector<Complex> m(N+1);
-     for (j=1;j<=N;j++)
-     	m[j] = -2*lambda_k[j] + 2;
- 	
-@@ -78,7 +80,8 @@ phi_series(int precision)
- 	
- 	int n,fact_n;
- 	Complex log_Gamma[N+1][a+1][MYDIGITS+1];
--	Complex sum_log_Gamma[N+1][MYDIGITS+1];
-+        std::vector<std::vector<Complex> > sum_log_Gamma(N+1);
-+        for (j=1;j<=N;j++) sum_log_Gamma[j].resize(MYDIGITS+1);
- 	
- 	for (j=1;j<=N;j++)
- 	for (n=0;n<=MYDIGITS;n++)
-@@ -103,8 +106,13 @@ phi_series(int precision)
- 	
- 	// compute the exponential taylor series for gamma = exp(sum_log_Gamma)
- 	
--	Complex exp_sum_log_Gamma[N+1][MYDIGITS+1][MYDIGITS+1]; // symmetric functions
--	Complex gamma[N+1][MYDIGITS+1]; // gamma(s+m[j]) for j = 1 to N
-+        std::vector<std::vector<std::vector<Complex> > > exp_sum_log_Gamma(N+1); // symmetric functions
-+        std::vector<std::vector<Complex> > gamma(N+1); // gamma(s+m[j]) for j = 1 to N
-+        for (j=1;j<=N;j++){
-+            exp_sum_log_Gamma[j].resize(MYDIGITS+1);
-+            gamma[j].resize(MYDIGITS+1);
-+        }
-+        for (j=1;j<=N;j++) for (n=0;n<=MYDIGITS;n++) exp_sum_log_Gamma[j][n].resize(MYDIGITS+1);
- 	Complex temp_gamma[MYDIGITS+1];
- 	Complex temp_mult_gamma[MYDIGITS+1];
- 	Complex temp_exp_sum_log_Gamma[MYDIGITS+1];
diff --git a/math/lcalc/files/patch-include_Lexplicit__formula.h b/math/lcalc/files/patch-include_Lexplicit__formula.h
deleted file mode 100644
index 9f3b029f828f..000000000000
--- a/math/lcalc/files/patch-include_Lexplicit__formula.h
+++ /dev/null
@@ -1,17 +0,0 @@
---- include/Lexplicit_formula.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Lexplicit_formula.h
-@@ -1,4 +1,5 @@
- // This file mainly due to Kevin McGown, with modifications by Michael Rubinstein
-+// Patches borrowed from SageMath.
- 
- #ifndef Lexplicit_formula_H
- #define Lexplicit_formula_H
-@@ -25,7 +26,7 @@ int L_function <ttype>::
- dirichlet_coeffs_log_diff(int num_coeffs, Complex *c)
- {
- 
--  Complex b[num_coeffs+1];
-+  std::vector<Complex> b(num_coeffs+1);
-   int j, n, d1, ind;
-   Complex total, total2, temp;
- 
diff --git a/math/lcalc/files/patch-include_Lgamma.h b/math/lcalc/files/patch-include_Lgamma.h
deleted file mode 100644
index 1f11aaccf5a2..000000000000
--- a/math/lcalc/files/patch-include_Lgamma.h
+++ /dev/null
@@ -1,65 +0,0 @@
---- include/Lgamma.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Lgamma.h
-@@ -18,6 +18,8 @@
-    with the package; see the file 'COPYING'. If not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-+   Patches borrowed from SageMath.
-+
- */
- 
- 
-@@ -77,7 +79,7 @@ Complex exp_recycle();
- //n=0 should just give log_GAMMA(z)... thus making log_GAMMA
- //code obsolete. But leave log_GAMMA intact anyways.
- template <class ttype>
--precise(ttype) log_GAMMA (ttype z,int n=0)
-+precise(ttype) log_GAMMA (ttype z,int n)
- {
-     int M;
-     precise(ttype) log_G,r,r2,y;
-@@ -230,7 +232,7 @@ Complex GAMMA (ttype z1, ttype2 delta)
- //value exp_w which holds exp(-w)
- //computes G(z,w), so there's an extra w^(-z) factor.
- template <class ttype>
--Complex inc_GAMMA (ttype z,ttype w, const char *method="temme", ttype exp_w = 0, bool recycle=false)
-+Complex inc_GAMMA (ttype z,ttype w, const char *method, ttype exp_w, bool recycle)
- {
- 
-     Complex G;
-@@ -334,7 +336,7 @@ Complex inc_GAMMA (ttype z,ttype w, const char *method
- 
- 
- template <class ttype>
--ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w=0, bool recycle=false)  //computes G(z,w) via continued fraction
-+ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w, bool recycle)  //computes G(z,w) via continued fraction
- {
- 
-         ttype G;
-@@ -424,7 +426,7 @@ ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w=0, boo
- }
- 
- template <class ttype>
--ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w = 0, bool recycle=false)  //computes G(z,w) via asymptotic series
-+ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w, bool recycle)  //computes G(z,w) via asymptotic series
- {
- 
-         if(my_verbose>3) cout << "called asympt_GAMMA("<<z<<","<<w<<")"<< endl;
-@@ -446,7 +448,7 @@ ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w = 0, 
- 
- 
- template <class ttype>
--ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w = 0, bool recycle=false)  //computes g(z,w)
-+ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w, bool recycle)  //computes g(z,w)
- {
- 
-     ttype g;
-@@ -604,7 +606,7 @@ ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w = 0,
- }
- 
- template <class ttype>
--Complex gamma_sum(Complex s, int what_type, ttype *coeff, int N, Double g, Complex l, Double Q, Long Period, Complex delta=1, const char *method="temme")
-+Complex gamma_sum(Complex s, int what_type, ttype *coeff, int N, Double g, Complex l, Double Q, Long Period, Complex delta, const char *method)
- {
-     Complex SUM=0;
- 
diff --git a/math/lcalc/files/patch-include_Lglobals.h b/math/lcalc/files/patch-include_Lglobals.h
deleted file mode 100644
index eaf2d25e7824..000000000000
--- a/math/lcalc/files/patch-include_Lglobals.h
+++ /dev/null
@@ -1,21 +0,0 @@
---- include/Lglobals.h.orig	2012-08-08 21:21:55 UTC
-+++ include/Lglobals.h
-@@ -18,15 +18,17 @@
-    with the package; see the file 'COPYING'. If not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-+   Patches borrowed from SageMath.
-+
- */
- 
- 
- #ifndef Lglobals_H
- #define Lglobals_H
- 
-+#include <valarray>
- using namespace std;
- 
--#include <valarray>
- #ifdef USE_MPFR
-     #include "Lgmpfrxx.h"
-     typedef mpfr_class Double;
diff --git a/math/lcalc/files/patch-src_Lcommandline.cc b/math/lcalc/files/patch-src_Lcommandline.cc
deleted file mode 100644
index 3b5dcfe18cc1..000000000000
--- a/math/lcalc/files/patch-src_Lcommandline.cc
+++ /dev/null
@@ -1,36 +0,0 @@
---- src/Lcommandline.cc.orig	2012-08-08 21:21:56 UTC
-+++ src/Lcommandline.cc
-@@ -18,6 +18,8 @@ Check the License for details. You should have receive
- with the package; see the file 'COPYING'. If not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-+   Patches borrowed from SageMath.
-+
- */
- 
- 
-@@ -412,12 +414,7 @@ int main (int argc, char *argv[])
- 
-             t2=.5; //t2=.5 because of the GAMMA(s+1/2)
- 
--            pari_init(1000000000,2);
--            //pari_init_opts(400000000,2,INIT_DFTm); // the last option is to prevent
--            //pari from giving its interrupt signal when its elliptic curve a_p
--            //algorithm is called and interrupted with ctrl-c. Requires a more current
--            //version of pari, so use pari_init above until I have a configure set up
--            //that detects which pari, if any, is installed.
-+            pari_init_opts(16000000, 2, INIT_DFTm);
- 
-             coeff = new Double[3];
-             //compute the conductor which is copied to coeff[1]
-@@ -473,7 +470,9 @@ int main (int argc, char *argv[])
- 
- #ifdef INCLUDE_PARI
-         if(do_elliptic_curve){
--             allocatemoremem((int) N_terms*16+1000000); //XXXXXXXXX this should depend on whether we're double or long double or mpfr double
-+             // Reallocate PARI stack
-+             paristack_setsize((size_t)N_terms*16 + 1000000, 0); //XXXXXXXXX this should depend on whether we're double or long double or mpfr double
-+
-              if (my_verbose>0) cout << "Will precompute " << N_terms << " elliptic L-function dirichlet coefficients..." << endl;
-              initialize_new_L(a1,a2,a3,a4,a6,N_terms); 
-         }
diff --git a/math/lcalc/files/patch-src_Lcommandline__elliptic.cc b/math/lcalc/files/patch-src_Lcommandline__elliptic.cc
deleted file mode 100644
index 3b5afe596d23..000000000000
--- a/math/lcalc/files/patch-src_Lcommandline__elliptic.cc
+++ /dev/null
@@ -1,62 +0,0 @@
---- src/Lcommandline_elliptic.cc.orig	2012-08-08 21:21:56 UTC
-+++ src/Lcommandline_elliptic.cc
-@@ -18,6 +18,8 @@
-    with the package; see the file 'COPYING'. If not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
-+   Patches borrowed from SageMath.
-+
- */
- 
- #include "Lcommandline_elliptic.h"
-@@ -121,11 +123,11 @@ void data_E(char *a1, char *a2, char *a3, char *a4, ch
- 
- 
-     F = cgetg(6, t_VEC);
--    F[1] = lgeti(BIGDEFAULTPREC);
--    F[2] = lgeti(BIGDEFAULTPREC);
--    F[3] = lgeti(BIGDEFAULTPREC);
--    F[4] = lgeti(BIGDEFAULTPREC);
--    F[5] = lgeti(BIGDEFAULTPREC);
-+    F[1] = (long)cgeti(BIGDEFAULTPREC);
-+    F[2] = (long)cgeti(BIGDEFAULTPREC);
-+    F[3] = (long)cgeti(BIGDEFAULTPREC);
-+    F[4] = (long)cgeti(BIGDEFAULTPREC);
-+    F[5] = (long)cgeti(BIGDEFAULTPREC);
- 
-     //gaffsg(a1,(GEN) F[1]);
-     //gaffsg(a2,(GEN) F[2]);
-@@ -133,15 +135,15 @@ void data_E(char *a1, char *a2, char *a3, char *a4, ch
-     //gaffsg(a4,(GEN) F[4]);
-     //gaffsg(a6,(GEN) F[5]);
- 
--    gaffect(strtoGEN(a1), (GEN) F[1]);
--    gaffect(strtoGEN(a2), (GEN) F[2]);
--    gaffect(strtoGEN(a3), (GEN) F[3]);
--    gaffect(strtoGEN(a4), (GEN) F[4]);
--    gaffect(strtoGEN(a6), (GEN) F[5]);
-+    gaffect(gp_read_str(a1), (GEN) F[1]);
-+    gaffect(gp_read_str(a2), (GEN) F[2]);
-+    gaffect(gp_read_str(a3), (GEN) F[3]);
-+    gaffect(gp_read_str(a4), (GEN) F[4]);
-+    gaffect(gp_read_str(a6), (GEN) F[5]);
- 
--    E = initell(F,BIGDEFAULTPREC);
-+    E = ellinit(F, NULL, BIGDEFAULTPREC);
- 
--    C=globalreduction(E);
-+    C=ellglobalred(E);
- 
-     x=gtodouble((GEN) C[1]);
- 
-@@ -167,8 +169,8 @@ void data_E(char *a1, char *a2, char *a3, char *a4, ch
- 
-             p=n;
-             gaffsg(p,y);
--            coeff[p] = Double(1.*llrint(gtodouble(apell(E,y))))/sqrt(Double(1.*p));
--            //coeff[p] = Double(1.*Long(gtodouble(apell(E,y))+.1))/sqrt(Double(1.*p));
-+            coeff[p] = Double(1.*llrint(gtodouble(ellap(E,y))))/sqrt(Double(1.*p));
-+            //coeff[p] = Double(1.*Long(gtodouble(ellap(E,y))+.1))/sqrt(Double(1.*p));
- 
-             if(gtolong(gmod((GEN) E[12],(GEN) y))==0) // if p|discriminant, i.e. bad reduction
-             {
diff --git a/math/lcalc/files/patch-src_Makefile b/math/lcalc/files/patch-src_Makefile
deleted file mode 100644
index 9ca5fcf02d08..000000000000
--- a/math/lcalc/files/patch-src_Makefile
+++ /dev/null
@@ -1,235 +0,0 @@
---- src/Makefile.orig	2012-08-08 21:21:56 UTC
-+++ src/Makefile
-@@ -8,12 +8,13 @@
- #the c compiler, that will generate options which are specific to the
- #compilers, optimization options depending on the chip, etc
- 
-+# + Patches borrowed from SageMath.
- 
- # Comment out the following line to remove the use of pari's
- # elliptic curve routines. Doing so disables the -e option.
- # g++ with -DINCLUDE_PARI sends a #define INCLUDE_PARI to the preprocessor.
- 
--#PARI_DEFINE = -DINCLUDE_PARI
-+PARI_DEFINE = -DINCLUDE_PARI
- #PREPROCESSOR_DEFINE = -DUSE_LONG_DOUBLE
- 
- #OPENMP_FLAG = -fopenmp
-@@ -29,11 +30,21 @@ endif
- 
- OS_NAME := $(shell uname)
- 
--CC = g++
-+#CC = g++
- #cc = /home/mrubinst/local/bin/gcc
- #CC = /home/mrubinst/local/bin/g++
- #LD = /home/mrubinst/local/bin/g++
- 
-+ifneq (,$(findstring CYGWIN,$(OS_NAME)))
-+  OS_NAME := CYGWIN
-+endif
-+
-+# Note: I've also changed various rules to use $CXX instead of $CC,
-+# since we mostly compile C++, not C, and $CC is by convention
-+# used for the *C* compiler.
-+#CC ?= gcc
-+#CXX ?= g++
-+
- #CC = /Users/michaelrubinstein/math/L/packages/gcc4.3/usr/local/bin/g++
- #EXTRA= -pg
- #EXTRA = -ftree-vectorize -ftree-vectorizer-verbose=5 -funroll-loops
-@@ -58,59 +69,27 @@ ifeq ($(G5),TRUE)
-    #MACHINE_SPECIFIC_FLAGS = -mpowerpc -mpowerpc64 -m64
- endif
- 
--CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
--#CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG)  $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
--#CCFLAGS =  -Wa,-W -O2 -fno-exceptions -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
-+CXXFLAGS := $(OPENMP_FLAG) $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA) $(CXXFLAGS)
- 
- #warning- O2 doesn't help with -DUSE_LONG_DOUBLE on mac, and actually seems to hurt, making runtime longer
- #by a factor of 1.5
- 
- 
--ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
--    #location of pari.h.
--    LOCATION_PARI_H = /usr/local/include/pari #usual location
- 
--    #location of libpari.a or of libpari.so
--    #depending on whether static or dynamic libraries are being used.
--    #On mac os x it's the former, on linux I think usually the latter.
--    LOCATION_PARI_LIBRARY = /usr/local/lib #usual location
--else
--    #supplied as a dummy so as to avoid more ifeq's below
--    LOCATION_PARI_H = .
--    LOCATION_PARI_LIBRARY = .
--endif
--
--
--
- #INCLUDEFILES= -I../include -I../../packages/gcc4.3/usr/local/include
- INCLUDEFILES= -I../include
- 
- #For Mac os x we omit shared library options
- 
- ifeq ($(OS_NAME),Darwin)
--    LDFLAGS2 =
--    DYN_OPTION=dynamiclib
-+    DYN_OPTION=dynamiclib -Wl,-headerpad_max_install_names
- else
--    LDFLAGS1 = -Xlinker -export-dynamic #not sure why pari calls these when linking but on the web I found
--    #'Libtool provides the `-export-dynamic' link flag (see section Link mode), which does this declaration.
--    #You need to use this flag if you are linking a shared library that will be dlopened'
--    #see notes below
--    #ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
--       LDFLAGS2 = $(LDFLAGS1) -Xlinker -rpath -Xlinker $(LOCATION_PARI_LIBRARY)
--    #else
--    #    LDFLAGS2 = $(LDFLAGS1)
--    #endif
-     DYN_OPTION=shared
- endif
- 
--ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
--    LDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
--else
--    LDFLAGS = $(LDFLAGS2)
--endif
-+PARI_LIBS = -L$(LOCALBASE)/lib -lpari -lgmp -lm
- 
- 
--
- #NOTES:
- #for caedmon: the shared pari library is in a funny location: /usr/local/pari/pari-2.1.5/lib
- #At compile time we need to specify that location with:
-@@ -129,47 +108,63 @@ endif
- #become clear which libraries the computer can find.
- 
- 
--INSTALL_DIR= /usr/local
-+INSTALL_DIR = $(STAGEDIR)$(PREFIX)
- 
-+#binary and library files extensions
-+LIBEXT := .so
-+EXEEXT :=
-+
-+ifeq ($(OS_NAME),Darwin)
-+    LIBEXT := .dylib
-+    EXEEXT :=
-+endif
-+
-+ifeq ($(OS_NAME),CYGWIN)
-+    LIBEXT := .dll
-+    EXEEXT := .exe
-+endif
-+
- #object files for the libLfunction library
- OBJ_L = Lglobals.o Lgamma.o Lriemannsiegel.o Lriemannsiegel_blfi.o Ldokchitser.o
- 
- #object files for the command line program
--OBJ2=$(OBJ_L) Lcommandline_globals.o Lcommandline_misc.o Lcommandline_numbertheory.o Lcommandline_values_zeros.o
--OBJ3=$(OBJ2) Lcommandline_elliptic.o Lcommandline_twist.o Lcommandline.o cmdline.o
-+OBJ2 = $(OBJ_L) Lcommandline_globals.o Lcommandline_misc.o Lcommandline_numbertheory.o Lcommandline_values_zeros.o
-+OBJ3 = $(OBJ2) Lcommandline_elliptic.o Lcommandline_twist.o Lcommandline.o cmdline.o
- OBJECTS = $(OBJ3)
- 
- all:
--#	make print_vars
--	make libLfunction.so
--	make lcalc
--	make examples
--#	make find_L
--#	make test
-+#	$(MAKE) print_vars
-+	$(MAKE) libLfunction$(LIBEXT)
-+	$(MAKE) lcalc$(EXEEXT)
-+	$(MAKE) examples$(EXEEXT)
-+#	$(MAKE) find_L
-+#	$(MAKE) test
- 
- print_vars:
- 	@echo OS_NAME = $(OS_NAME)
- 
--lcalc: $(OBJECTS)
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(LDFLAGS) -o lcalc $(GMP_FLAGS)
-+lcalc$(EXEEXT): $(OBJECTS)
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) $(LDFLAGS) $(OBJECTS) -o lcalc$(EXEEXT) $(PARI_LIBS) $(GMP_FLAGS)
- 
--examples:
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/example.cc libLfunction.so -o example_programs/example $(GMP_FLAGS)
-+examples$(EXEEXT):
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) example_programs/example.cc $(LDFLAGS) libLfunction$(LIBEXT) -o example_programs/example$(EXEEXT) $(PARI_LIBS) $(GMP_FLAGS)
- 
- 
--proc:
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/proc.cc libLfunction.so -o example_programs/proc $(GMP_FLAGS)
-+proc$(EXEEXT):
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) example_programs/proc.cc $(LDFLAGS) libLfunction$(LIBEXT) -o example_programs/proc$(EXEEXT) $(PARI_LIBS) $(GMP_FLAGS)
- 
--test:
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/test.cc libLfunction.so -o example_programs/test $(GMP_FLAGS)
-+test$(EXEEXT):
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) example_programs/test.cc $(LDFLAGS) libLfunction$(LIBEXT) -o example_programs/test$(EXEEXT) $(PARI_LIBS) $(GMP_FLAGS)
- 
--find_L:
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) find_L_functions/find_L_functions.cc libLfunction.so -o find_L_functions/find_L $(GMP_FLAGS)
-+find_L$(EXEEXT):
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) find_L_functions/find_L_functions.cc $(LDFLAGS) libLfunction$(LIBEXT) -o find_L_functions/find_L$(EXEEXT) $(PARI_LIBS) $(GMP_FLAGS)
- 
- .cc.o:
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) -c $<
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) -c $<
-+
-+# Warning: We (Sage) add $CXXFLAGS to CXXFLAGS above.
- .c.o:
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) -c $<
-+	$(CC) $(CFLAGS) $(INCLUDEFILES) -c $<
- 
- 
- Lglobals.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h
-@@ -227,7 +222,7 @@ Lcommandline_elliptic.o: ../include/Lnumberzeros.h ../
- Lcommandline_elliptic.o: ../include/Lvalue.h ../include/Lfind_zeros.h
- Lcommandline_elliptic.o: ../include/Lcommandline_numbertheory.h
- Lcommandline_elliptic.o: ../include/Lcommandline_globals.h
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_elliptic.cc
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) $(PARI_DEFINE) -c Lcommandline_elliptic.cc
- 
- Lcommandline_twist.o: ../include/Lcommandline_twist.h ../include/L.h
- Lcommandline_twist.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h
-@@ -239,7 +234,7 @@ Lcommandline_twist.o: ../include/Lvalue.h ../include/L
- Lcommandline_twist.o: ../include/Lcommandline_numbertheory.h
- Lcommandline_twist.o: ../include/Lcommandline_globals.h
- Lcommandline_twist.o: ../include/Lcommandline_elliptic.h
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_twist.cc
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) $(PARI_DEFINE) -c Lcommandline_twist.cc
- 
- cmdline.o: ../include/cmdline.h ../include/getopt.h
- #$(CC) $(CCFLAGS) $(INCLUDEFILES) -DHAVE_LONG_LONG -c cmdline.c
-@@ -258,21 +253,21 @@ Lcommandline.o: ../include/Lcommandline_misc.h
- Lcommandline.o: ../include/Lcommandline_elliptic.h
- Lcommandline.o: ../include/Lcommandline_twist.h
- Lcommandline.o: ../include/Lcommandline_values_zeros.h
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline.cc
-+	$(CXX) $(CXXFLAGS) $(INCLUDEFILES) $(PARI_DEFINE) -c Lcommandline.cc
- 
- 
--libLfunction.so: $(OBJ_L)
--	g++ -$(DYN_OPTION)  -o libLfunction.so $(OBJ_L)
-+libLfunction$(LIBEXT): $(OBJ_L)
-+	$(CXX) -$(DYN_OPTION) $(CXXFLAGS) -o libLfunction$(LIBEXT) $(LDFLAGS) -Wl,-soname,$@ $(OBJ_L) $(PARI_LIBS)
- 
- clean:
--	rm -f *.o lcalc libLfunction.so example_programs/example
-+	rm -f *.o lcalc$(EXEEXT) libLfunction$(LIBEXT) example_programs/example$(EXEEXT)
- 
- install:
--	cp -f lcalc $(INSTALL_DIR)/bin/.
--	cp -f libLfunction.so $(INSTALL_DIR)/lib/.
-+	cp -f lcalc$(EXEEXT) $(INSTALL_DIR)/bin/.
-+	cp -f libLfunction$(LIBEXT) $(INSTALL_DIR)/lib/.
- 	cp -rf ../include $(INSTALL_DIR)/include/Lfunction
- 
- 
- SRCS = Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc Lcommandline_misc.cc Lcommandline_numbertheory.cc Lcommandline_twist.cc Lcommandline_values_zeros.cc Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc Lriemannsiegel_blfi.cc cmdline.c
- depend:
--	makedepend -f depends -- $(CCFLAGS) -Y../include -- $(SRCS)
-+	makedepend -f depends -- $(CXXFLAGS) -Y../include -- $(SRCS)
diff --git a/math/lcalc/pkg-descr b/math/lcalc/pkg-descr
index 79425b22ce30..10d0e2612de8 100644
--- a/math/lcalc/pkg-descr
+++ b/math/lcalc/pkg-descr
@@ -3,4 +3,4 @@ This program computes zeros and values of L-function.
 It installs the L-function c++ class library and, the command line program
 lcalc.
 
-WWW: https://github.com/agrawroh/l-calc
+WWW: https://gitlab.com/sagemath/lcalc
diff --git a/math/lcalc/pkg-plist b/math/lcalc/pkg-plist
index d498b96568aa..616727cb327f 100644
--- a/math/lcalc/pkg-plist
+++ b/math/lcalc/pkg-plist
@@ -1,46 +1,38 @@
 bin/lcalc
-include/Lfunction/L.h
-include/Lfunction/L.h.orig
-include/Lfunction/Lcommandline.h
-include/Lfunction/Lcommandline.h.orig
-include/Lfunction/Lcommandline_elliptic.h
-include/Lfunction/Lcommandline_elliptic.h.orig
-include/Lfunction/Lcommandline_globals.h
-include/Lfunction/Lcommandline_misc.h
-include/Lfunction/Lcommandline_numbertheory.h
-include/Lfunction/Lcommandline_numbertheory.h.orig
-include/Lfunction/Lcommandline_twist.h
-include/Lfunction/Lcommandline_values_zeros.h
-include/Lfunction/Lcommon.h
-include/Lfunction/Lcommon.h.orig
-include/Lfunction/Lcommon_ld.h
-include/Lfunction/Lcommon_ld.h.orig
-include/Lfunction/Lcomplex.h
-include/Lfunction/Lcomplex.h.orig
-include/Lfunction/Ldirichlet_series.h
-include/Lfunction/Ldirichlet_series.h.orig
-include/Lfunction/Ldokchitser.h
-include/Lfunction/Ldokchitser.h.orig
-include/Lfunction/Lexplicit_formula.h
-include/Lfunction/Lexplicit_formula.h.orig
-include/Lfunction/Lfind_zeros.h
-include/Lfunction/Lgamma.h
-include/Lfunction/Lgamma.h.orig
-include/Lfunction/Lglobals.h
-include/Lfunction/Lglobals.h.orig
-include/Lfunction/Lgmpfrxx.h
-include/Lfunction/Lgram.h
-include/Lfunction/Lint_complex.h
-include/Lfunction/Lmisc.h
-include/Lfunction/Lnumberzeros.h
-include/Lfunction/Lnumeric.h
-include/Lfunction/Lprint.h
-include/Lfunction/Lriemannsiegel.h
-include/Lfunction/Lriemannsiegel_blfi.h
-include/Lfunction/Lvalue.h
-include/Lfunction/Lvalue.h.bak
-include/Lfunction/cmdline.h
-include/Lfunction/getopt.h
-include/Lfunction/mpfr_mul_d.h
+include/lcalc/L.h
+include/lcalc/Lcommon.h
+include/lcalc/Lcomplex.h
+include/lcalc/Ldirichlet_series.h
+include/lcalc/Ldokchitser.h
+include/lcalc/Lelliptic.h
+include/lcalc/Lexplicit_formula.h
+include/lcalc/Lfind_zeros.h
+include/lcalc/Lgamma.h
+include/lcalc/Lglobals.h
+include/lcalc/Lgram.h
+include/lcalc/Lmisc.h
+include/lcalc/Lnumbertheory.h
+include/lcalc/Lnumberzeros.h
+include/lcalc/Lprint.h
+include/lcalc/Lriemannsiegel.h
+include/lcalc/Lriemannsiegel_blfi.h
+include/lcalc/Lvalue.h
+include/lcalc/config.h
 lib/libLfunction.so
-lib/libLfunction.so.0
+lib/libLfunction.so.1
+lib/libLfunction.so.1.0.1
+libdata/pkgconfig/lcalc.pc
+man/man1/lcalc.1.gz
+%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTORS
+%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL.automake
+%%PORTDOCS%%%%DOCSDIR%%/README.md
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/Makefile.example
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/data/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/data/data_L4
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/data/data_dedekind_Q_sqrt_minus_3
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/data/data_maass
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/data/data_tau
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example.cc