Merge pull request #66388 from timokau/sympow2

sympow: 1.018.1 -> 2.023.4
This commit is contained in:
Timo Kaufmann 2019-08-09 18:38:41 +02:00 committed by GitHub
commit f5674b20ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 59 deletions

View File

@ -0,0 +1,21 @@
diff --git a/src/sage/lfunctions/sympow.py b/src/sage/lfunctions/sympow.py
index 1640ac4f6a..03578be7b8 100644
--- a/src/sage/lfunctions/sympow.py
+++ b/src/sage/lfunctions/sympow.py
@@ -50,6 +50,7 @@ from __future__ import print_function, absolute_import
import os
+from sage.env import DOT_SAGE
from sage.structure.sage_object import SageObject
from sage.misc.all import pager, verbose
import sage.rings.all
@@ -76,7 +77,7 @@ class Sympow(SageObject):
"""
Used to call sympow with given args
"""
- cmd = 'sympow %s'%args
+ cmd = 'env SYMPOW_CACHEDIR="%s/sympow///" sympow %s' % (DOT_SAGE, args)
v = os.popen(cmd).read().strip()
verbose(v, level=2)
return v

View File

@ -100,6 +100,11 @@ stdenv.mkDerivation rec {
rev = "c11d9cfa23ff9f77681a8f12742f68143eed4504"; rev = "c11d9cfa23ff9f77681a8f12742f68143eed4504";
sha256 = "0xzra7mbgqvahk9v45bjwir2mqz73hrhhy314jq5nxrb35ysdxyi"; sha256 = "0xzra7mbgqvahk9v45bjwir2mqz73hrhhy314jq5nxrb35ysdxyi";
}) })
# After updating smypow to (https://trac.sagemath.org/ticket/3360) we can
# now set the cache dir to be withing the .sage directory. This is not
# strictly necessary, but keeps us from littering in the user's HOME.
./patches/sympow-cache.patch
]; ];
patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches; patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;

View File

@ -3,7 +3,7 @@
, sage-with-env , sage-with-env
, makeWrapper , makeWrapper
, files ? null # "null" means run all tests , files ? null # "null" means run all tests
, longTests ? true # run tests marked as "long time" (roughly doubles runtime) , longTests ? false # run tests marked as "long time" (roughly doubles runtime)
# Run as many tests as possible in approximately n seconds. This will give each # Run as many tests as possible in approximately n seconds. This will give each
# file to test a "time budget" and stop tests if it is exceeded. 300 is the # file to test a "time budget" and stop tests if it is exceeded. 300 is the
# upstream default value. # upstream default value.

View File

@ -1,89 +1,74 @@
{ stdenv { stdenv
, fetchurl , fetchFromGitLab
, fetchpatch
, makeWrapper , makeWrapper
, which
, autoconf
, help2man
, file
, pari
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.018.1"; version = "2.023.4";
name = "sympow-${version}"; name = "sympow-${version}";
src = fetchurl { src = fetchFromGitLab {
# Original website no longer reachable group = "rezozer";
url = "mirror://sageupstream/sympow/sympow-${version}.tar.bz2"; owner = "forks";
sha256 = "0hphs7ia1wr5mydf288zvwj4svrymfpadcg3pi6w80km2yg5bm3c"; repo = "sympow";
rev = "v${version}";
sha256 = "0j2qdw9csbr081h8arhlx1z7ibgi5am4ndmvyc8y4hccfa8n4w1y";
}; };
postUnpack = ''
patchShebangs .
'';
nativeBuildInputs = [ nativeBuildInputs = [
makeWrapper makeWrapper
which
autoconf
help2man
file
pari
]; ];
configurePhase = '' configurePhase = ''
runHook preConfigure runHook preConfigure
export PREFIX="$out"
export VARPREFIX="$out" # see comment on postInstall
./Configure # doesn't take any options ./Configure # doesn't take any options
runHook postConfigure runHook postConfigure
''; '';
installPhase = '' # Usually, sympow has 3 levels of caching: statically distributed in /usr/,
runHook preInstall # shared in /var and per-user in ~/.sympow. The shared cache assumes trust in
install -D datafiles/* --target-directory "$out/share/sympow/datafiles/" # other users and a shared /var is not compatible with nix's approach, so we
install *.gp "$out/share/sympow/" # set VARPREFIX to the read-only $out. This effectively disables shared
install -Dm755 sympow "$out/share/sympow/sympow" # caching. See https://trac.sagemath.org/ticket/3360#comment:36 and sympow's
install -D new_data "$out/bin/new_data" # README for more details on caching.
# sympow will complain at runtime about the lack of write-permissions on the
makeWrapper "$out/share/sympow/sympow" "$out/bin/sympow" \ # shared cache. We pass the `-quiet` flag by default to disable this.
--run 'export SYMPOW_LOCAL="$HOME/.local/share/sympow"' \ postInstall = ''
--run 'if [ ! -d "$SYMPOW_LOCAL" ]; then wrapProgram "$out/bin/sympow" --add-flags '-quiet'
mkdir -p "$SYMPOW_LOCAL"
cp -r ${placeholder "out"}/share/sympow/* "$SYMPOW_LOCAL"
chmod -R +xw "$SYMPOW_LOCAL"
fi' \
--run 'cd "$SYMPOW_LOCAL"'
runHook postInstall
''; '';
patches = [ # Example from the README as a sanity check.
# don't hardcode paths doInstallCheck = true;
(fetchpatch { installCheckPhase = ''
name = "do_not_hardcode_paths.patch"; export HOME="$TMP/home"
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/sympow/patches/Configure.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba"; mkdir -p "$HOME"
sha256 = "1611p8ra8zkxvmxn3gm2l64bd4ma4m6r4vd6vwswcic91k1fci04"; "$out/bin/sympow" -sp 2p16 -curve "[1,2,3,4,5]" | grep '8.3705'
}) '';
# bug on some platforms in combination with a newer gcc:
# https://trac.sagemath.org/ticket/11920
(fetchpatch {
name = "fix_newer_gcc1.patch";
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/sympow/patches/fpu.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "14gfa56w3ddfmd4d5ir9a40y2zi43cj1i4d2l2ij9l0qlqdy9jyx";
})
(fetchpatch {
name = "fix_newer_gcc2.patch";
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/sympow/patches/execlp.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "190gqhgz9wgw4lqwz0nwb1izc9zffx34bazsiw2a2sz94bmgb54v";
})
# fix pointer initialization bug (https://trac.sagemath.org/ticket/22862)
(fetchpatch {
name = "fix_pointer_initialization1.patch";
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/sympow/patches/initialize-tacks.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "02341vdbbidfs39s26vi4n5wigz619sw8fdbl0h9qsmwwhscgf85";
})
(fetchpatch {
name = "fix_pointer_initialization2.patch";
url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/sympow-datafiles.patch?h=packages/sympow&id=5088e641a45b23d0385d8e63be65315129b4cf58";
sha256 = "1m0vz048layb47r1jjf7fplw650ccc9x0w3l322iqmppzmv3022a";
})
];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A package to compute special values of symmetric power elliptic curve L-functions"; description = "Compute special values of symmetric power elliptic curve L-functions";
license = { license = {
shortName = "sympow"; shortName = "sympow";
fullName = "Custom, BSD-like. See COPYING file."; fullName = "Custom, BSD-like. See COPYING file.";
free = true; free = true;
}; };
maintainers = with maintainers; [ timokau ]; maintainers = with maintainers; [ timokau ];
platforms = platforms.all; platforms = platforms.linux;
}; };
} }