2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
2023-02-16 17:41:37 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, gmp
|
|
|
|
, libX11
|
2022-09-30 11:47:45 +00:00
|
|
|
, libpthreadstubs
|
2020-04-24 23:36:52 +00:00
|
|
|
, perl
|
2021-12-06 16:07:01 +00:00
|
|
|
, readline
|
|
|
|
, tex
|
2022-09-30 11:47:45 +00:00
|
|
|
, withThread ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert withThread -> libpthreadstubs != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pari";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.15.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-05-20 23:08:51 +00:00
|
|
|
urls = [
|
|
|
|
"https://pari.math.u-bordeaux.fr/pub/pari/unix/${pname}-${version}.tar.gz"
|
|
|
|
# old versions are at the url below
|
|
|
|
"https://pari.math.u-bordeaux.fr/pub/pari/OLD/${lib.versions.majorMinor version}/${pname}-${version}.tar.gz"
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-w1Rb/uDG37QLd/tLurr5mdguYAabn20ovLbPAEyMXA8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gmp
|
|
|
|
libX11
|
|
|
|
perl
|
2021-12-06 16:07:01 +00:00
|
|
|
readline
|
|
|
|
tex
|
2021-01-17 00:15:33 +00:00
|
|
|
] ++ lib.optionals withThread [
|
2020-04-24 23:36:52 +00:00
|
|
|
libpthreadstubs
|
|
|
|
];
|
|
|
|
|
|
|
|
configureScript = "./Configure";
|
|
|
|
configureFlags = [
|
2021-12-06 16:07:01 +00:00
|
|
|
"--with-gmp=${lib.getDev gmp}"
|
|
|
|
"--with-readline=${lib.getDev readline}"
|
|
|
|
]
|
2021-01-17 00:15:33 +00:00
|
|
|
++ lib.optional withThread "--mt=pthread";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export LD=$CC
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "all" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "http://pari.math.u-bordeaux.fr";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Computer algebra system for high-performance number theory computations";
|
|
|
|
longDescription = ''
|
|
|
|
PARI/GP is a widely used computer algebra system designed for fast
|
|
|
|
computations in number theory (factorizations, algebraic number theory,
|
|
|
|
elliptic curves...), but also contains a large number of other useful
|
|
|
|
functions to compute with mathematical entities such as matrices,
|
|
|
|
polynomials, power series, algebraic numbers etc., and a lot of
|
|
|
|
transcendental functions. PARI is also available as a C library to allow
|
|
|
|
for faster computations.
|
|
|
|
|
|
|
|
Originally developed by Henri Cohen and his co-workers (Université
|
|
|
|
Bordeaux I, France), PARI is now under the GPL and maintained by Karim
|
|
|
|
Belabas with the help of many volunteer contributors.
|
|
|
|
|
|
|
|
- PARI is a C library, allowing fast computations.
|
2020-10-16 20:44:37 +00:00
|
|
|
- gp is an easy-to-use interactive shell giving access to the PARI
|
|
|
|
functions.
|
2020-04-24 23:36:52 +00:00
|
|
|
- GP is the name of gp's scripting language.
|
2020-10-16 20:44:37 +00:00
|
|
|
- gp2c, the GP-to-C compiler, combines the best of both worlds by
|
|
|
|
compiling GP scripts to the C language and transparently loading the
|
|
|
|
resulting functions into gp. (gp2c-compiled scripts will typically run
|
|
|
|
3 or 4 times faster.) gp2c currently only understands a subset of the
|
|
|
|
GP language.
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
downloadPage = "http://pari.math.u-bordeaux.fr/download.html";
|
2020-10-16 20:44:37 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2022-09-30 11:47:45 +00:00
|
|
|
maintainers = with maintainers; [ ertes ] ++ teams.sage.members;
|
2020-10-16 20:44:37 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2022-06-16 17:23:12 +00:00
|
|
|
mainProgram = "gp";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|