From 5a23cb575e7509f09b55a7435d7e4cdbb7bd119b Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Tue, 5 Mar 2019 20:21:26 +0100 Subject: [PATCH 1/3] pari: slight refactoring Use pname, one line per argument. --- pkgs/applications/science/math/pari/default.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix index 32e4d81acec0..919feedec04a 100644 --- a/pkgs/applications/science/math/pari/default.nix +++ b/pkgs/applications/science/math/pari/default.nix @@ -1,17 +1,21 @@ -{ stdenv, fetchurl -, gmp, readline, libX11, tex, perl +{ stdenv +, fetchurl +, gmp +, readline +, libX11 +, tex +, perl , withThread ? true, libpthreadstubs }: assert withThread -> libpthreadstubs != null; stdenv.mkDerivation rec { - - name = "pari-${version}"; + pname = "pari"; version = "2.11.1"; src = fetchurl { - url = "https://pari.math.u-bordeaux.fr/pub/pari/unix/${name}.tar.gz"; + url = "https://pari.math.u-bordeaux.fr/pub/pari/unix/${pname}-${version}.tar.gz"; sha256 = "1jfax92jpydjd02fwl30r6b8kfzqqd6sm4yx94gidyz9lqjb7a94"; }; From 00fa98f0122be32ca6daa5d187472c83a90a7e74 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Tue, 5 Mar 2019 20:23:04 +0100 Subject: [PATCH 2/3] pari: add timokau as maintainer I'm mostly interested in this package because it is a dependency of sage. I'd like to be notified on changes (which ofBorg will do when I'm listed as a maintainer). --- pkgs/applications/science/math/pari/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix index 919feedec04a..0291cbb42cf6 100644 --- a/pkgs/applications/science/math/pari/default.nix +++ b/pkgs/applications/science/math/pari/default.nix @@ -74,7 +74,7 @@ stdenv.mkDerivation rec { homepage = http://pari.math.u-bordeaux.fr; downloadPage = http://pari.math.u-bordeaux.fr/download.html; license = licenses.gpl2Plus; - maintainers = with maintainers; [ ertes raskin AndersonTorres ]; + maintainers = with maintainers; [ ertes raskin AndersonTorres timokau ]; platforms = platforms.linux ++ platforms.darwin; updateWalker = true; }; From a648b8c7143f444c04a0a35d458996dadcce3dc4 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Tue, 5 Mar 2019 20:23:30 +0100 Subject: [PATCH 3/3] pari: fix off-by-one error Done by applying upstream patch. Will be included in the next release. Upstream: https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2117 --- pkgs/applications/science/math/pari/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix index 0291cbb42cf6..72827112c50c 100644 --- a/pkgs/applications/science/math/pari/default.nix +++ b/pkgs/applications/science/math/pari/default.nix @@ -1,5 +1,6 @@ { stdenv , fetchurl +, fetchpatch , gmp , readline , libX11 @@ -19,6 +20,18 @@ stdenv.mkDerivation rec { sha256 = "1jfax92jpydjd02fwl30r6b8kfzqqd6sm4yx94gidyz9lqjb7a94"; }; + patches = [ + # Fix a off-by-one bug that can potentially lead to segfaults (accepted upstream) + # https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2117 + # https://trac.sagemath.org/ticket/27335 + (fetchpatch { + name = "fix-off-by-one-error.patch"; + # only relevant parts of https://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=patch;h=aa1ee6e0898d177e6bcf49237d82c804bc410985 + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pari/patches/red_montgomery.patch?id=bbea55c96e1f05302b3c7f593cf64492497047c5"; + sha256 = "0vqkmhgv9splsdswp6zjnkj50z76rc1m6k9iy3cf9dxwqw3h3nr6"; + }) + ]; + buildInputs = [ gmp readline