summaryrefslogtreecommitdiff
path: root/libre/sagemath
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-07-29 18:54:06 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-07-29 18:57:00 -0300
commit4b9a24484b3f55b017b6cdc30ff372dc310be5f7 (patch)
treec25ec60d8d453a0a5280e9f38f31bfe54485f736 /libre/sagemath
parent84bfa7890271e94520d28cfe0c4caa883896a726 (diff)
sagemath-6.8-1.parabola1: updating version
* disable fes module, doesn't compile * replace "open" to "free" term to pkgdesc -> https://www.gnu.org/philosophy/words-to-avoid.html.en#Open * replace "alternative" to "replacement" term to pkgdesc -> https://www.gnu.org/philosophy/words-to-avoid.html.en#Alternative
Diffstat (limited to 'libre/sagemath')
-rw-r--r--libre/sagemath/PKGBUILD87
-rw-r--r--libre/sagemath/clean.patch5
-rw-r--r--libre/sagemath/disable-fes.patch19
-rw-r--r--libre/sagemath/env.patch28
-rw-r--r--libre/sagemath/fes02.patch45
-rw-r--r--libre/sagemath/ntl9.patch178
-rw-r--r--libre/sagemath/package.patch12
-rw-r--r--libre/sagemath/paths.patch6
8 files changed, 85 insertions, 295 deletions
diff --git a/libre/sagemath/PKGBUILD b/libre/sagemath/PKGBUILD
index 485f89544..e121efc5f 100644
--- a/libre/sagemath/PKGBUILD
+++ b/libre/sagemath/PKGBUILD
@@ -7,72 +7,68 @@
# Contributor (Arch): Stefan Husmann <stefan-husmann at t-online dot de>
# Special thanks to Nareto for moving the compile from the .install to the PKGBUILD
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+# Maintainer: André Silva <emulatorman@parabola.nu>
pkgname=sagemath
-pkgver=6.7
-pkgrel=3.parabola1
-pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab, without nonfree nauty recommendation"
-arch=('i686' 'x86_64')
+pkgver=6.8
+pkgrel=1.parabola1
+pkgdesc="Free Mathematics Software, free software replacement of Magma, Maple, Mathematica, and Matlab, without nonfree nauty recommendation"
+arch=(i686 x86_64)
url="http://www.sagemath.org"
-license=('GPL')
-depends=('ipython2' 'ppl' 'glpk' 'mpfi' 'palp' 'polybori' 'singular' 'libcliquer' 'maxima-ecl' 'gfan' 'sympow' 'tachyon' 'python2-rpy2'
- 'python2-matplotlib' 'python2-scipy' 'python2-sympy' 'python2-networkx' 'libgap' 'gap' 'flintqs' 'lcalc' 'lrcalc'
- 'eclib' 'gmp-ecm' 'zn_poly' 'gd' 'python2-cvxopt' 'pynac' 'linbox' 'gsl' 'rubiks' 'pari-galdata' 'pari-seadata-small'
- 'sage-data-combinatorial_designs' 'sage-data-elliptic_curves' 'sage-data-graphs' 'sage-data-polytopes_db' 'sage-data-conway_polynomials')
+license=(GPL)
+depends=(ipython2 ppl glpk mpfi palp polybori singular libcliquer maxima-ecl gfan sympow tachyon python2-rpy2
+ python2-matplotlib python2-scipy python2-sympy python2-networkx libgap gap flintqs lcalc lrcalc
+ eclib gmp-ecm zn_poly gd python2-cvxopt pynac linbox gsl rubiks pari-galdata pari-seadata-small planarity rankwidth
+ sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials)
optdepends=('cython2: to compile cython code' 'jmol: 3D plots' 'sage-notebook: Browser-based (flask) notebook interface'
- 'sagemath-doc: Documentation and inline help' 'sagemath-src: source files needed to build cython code'
- 'ipython2-notebook: IPython notebook interface' 'mathjax: IPython notebook interface'
+ 'sagemath-doc: Documentation and inline help' 'ipython2-notebook: IPython notebook interface' 'mathjax: IPython notebook interface'
'coin-or-cbc: COIN backend for numerical computations'
'buckygen: for generating fullerene graphs' 'plantri: for generating some classes of graphs' 'benzene: for generating fusenes and benzenoids'
- 'libfes: exhaustive search of solutions for boolean polynomial systems' 'modular_decomposition: modular decomposition of graphs'
+ 'modular_decomposition: modular decomposition of graphs'
'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes' 'imagemagick: to show animations'
'coxeter3: Coxeter groups implementation' 'cryptominisat: SAT solver' 'arb: floating-point ball arithmetic')
-makedepends=('cython2-devel' 'boost' 'scons' 'ratpoints' 'symmetrica' 'fflas-ffpack' 'python2-jinja' 'coin-or-cbc'
- 'mcqd' 'libfes' 'coxeter3' 'cryptominisat' 'arb' 'modular_decomposition' 'bliss-graphs')
-conflicts=('sage-mathematics')
-replaces=('sage-mathematics')
-provides=('sage-mathematics')
+makedepends=(cython2-devel boost ratpoints symmetrica fflas-ffpack python2-jinja coin-or-cbc
+ mcqd coxeter3 cryptominisat arb modular_decomposition bliss-graphs) # libfes
+conflicts=(sage-mathematics)
+replaces=(sage-mathematics)
+provides=(sage-mathematics)
source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
# "http://www.sagemath.org/packages/upstream/pexpect/pexpect-2.0.tar.bz2"
"http://mirrors.mit.edu/sage/spkg/upstream/pexpect/pexpect-2.0.tar.bz2"
-'anal.h' 'package.patch' 'c_lib.patch' 'env.patch' 'paths.patch' 'clean.patch' 'skip-check.patch'
-'pexpect-env.patch' 'pexpect-del.patch' 'fes02.patch' 'ntl9.patch')
-md5sums=('df744e882a4b25b42dd8347e202cd497'
+'anal.h' 'package.patch' 'env.patch' 'paths.patch' 'clean.patch' 'skip-check.patch'
+'pexpect-env.patch' 'pexpect-del.patch' 'disable-fes.patch')
+md5sums=('943780ef4460e38f28fefe95e3138981'
'd9a3e113ed147dcee8f89962a8dccd43'
'a906a180d198186a39820b0a2f9a9c63'
- '0eb5ac1537aac93bd67a2925c0cfd84d'
- 'c452558d3496b07be472dad57195d45d'
- '3fc9a5bb250896533365c30c2b926e3c'
- '020bdb34b6fc0f2c9f46341bdb79937a'
- '46c212a3a6713b0f78c370c7186d0982'
+ 'f72e544032b1a3f952b7ddafc3a49d63'
+ '843a6cc3b17a1850604593813321418e'
+ 'fd8e3e07f5b7318e6a7200a3c64f5bc2'
+ '23e972753be1e5d0f761a7f82a95cebf'
'5947a420a0b1483f0cbc74c76895789b'
'a83a3b1bc7fcb7cbf752a83a8311fc42'
'f333939ea6c41377b66407c81016cee4'
- '506944613082ba7f5b34360939ca90eb'
- '308abbb1a49db9b8f0e088aff69567ff')
+ '4eb23a3c7363258bc9ba764d6e5512ba')
prepare(){
cd sage-$pkgver
-# Arch-specific patches
+# Parabola-specific patches
# assume all optional packages are installed
- patch -p0 -i "$srcdir"/package.patch
-# don't assume Sage is already available (Fedora)
- patch -p0 -i "$srcdir"/c_lib.patch
+ patch -p0 -i ../package.patch
# find L.h header
- sed -e 's|libLfunction|Lfunction|' -i src/module_list.py
+ sed -e 's|libLfunction|Lfunction|' -i src/sage/libs/lcalc/lcalc_sage.h
# don't try to link against libpng 1.2
sed -e 's|png12|png|' -i src/module_list.py
# set env variables
- patch -p0 -i "$srcdir"/env.patch
+ patch -p0 -i ../env.patch
# fix paths in python imports
- patch -p0 -i "$srcdir"/paths.patch
+ patch -p0 -i ../paths.patch
# fix cython linking
sed -e "s| atlas(),||" -i src/sage/misc/cython.py
# don't try to remove installed files
- patch -p0 -i "$srcdir"/clean.patch
+ patch -p0 -i ../clean.patch
# skip checking build status
- patch -p0 -i "$srcdir"/skip-check.patch
+ patch -p0 -i ../skip-check.patch
# supress warning about GAP install dir
sed -e "s|gapdir = os.path.join(SAGE_LOCAL, 'gap', 'latest')|gapdir = '/usr/lib/gap'|" -i src/sage/libs/gap/util.pyx
# fix Cremona database detection
@@ -82,14 +78,12 @@ prepare(){
sed -e "s|os.path.join(SAGE_ROOT, 'sage')|'/usr/bin/sage'|" -i src/sage/repl/ipython_kernel/install.py
# find bliss headers
sed -e 's|graph.hh|bliss/graph.hh|' -i src/sage/graphs/bliss.pyx
-# Rename class to fix conflicts with NTL
- sed -e 's|WrappedPtr|SageWrappedPtr|' -i src/sage/libs/polybori/decl.pxd -i src/sage/libs/polybori/pb_wrap.h
# Upstream patches
# fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209
- patch -p0 -i "$srcdir"/fes02.patch
-# fix build aginst NTL 9 (Fedora)
- patch -p0 -i "$srcdir"/ntl9.patch
+# patch -p0 -i "$srcdir"/fes02.patch
+# disable fes module, fails to compile
+ patch -p0 -i ../disable-fes.patch
# use python2
sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/*
@@ -107,9 +101,9 @@ prepare(){
cd "$srcdir"/pexpect-2.0
# fix env in pexpect
- patch -p1 -i "$srcdir"/pexpect-env.patch
+ patch -p1 -i ../pexpect-env.patch
# hide exceptions in pexpect
- patch -p1 -i "$srcdir"/pexpect-del.patch
+ patch -p1 -i ../pexpect-del.patch
}
@@ -120,10 +114,6 @@ build() {
export SAGE_SRC="$PWD"
export CC=gcc
- pushd c_lib
- CXX=g++ UNAME=Linux SAGE64=auto scons
- popd
-
make sage/libs/pari/auto_gen.pxi
make sage/ext/interpreters/__init__.py
@@ -144,8 +134,7 @@ package() {
python2 setup.py install --root="$pkgdir" --optimize=1
- mkdir -p "$pkgdir"/usr/{bin,lib}
- cp c_lib/libcsage.so "$pkgdir"/usr/lib
+ mkdir -p "$pkgdir"/usr/bin
cp bin/sage "$pkgdir"/usr/bin
for _i in arch-env banner cachegrind callgrind cleaner coverage coverageall CSI CSI-helper.py cython env eval grep grepdoc inline-fortran ipython \
massif maxima.lisp native-execute notebook num-threads.py omega open preparse python rst2sws rst2txt run run-cython runtests startuptime.py \
diff --git a/libre/sagemath/clean.patch b/libre/sagemath/clean.patch
index c577d3d42..c4baf9bca 100644
--- a/libre/sagemath/clean.patch
+++ b/libre/sagemath/clean.patch
@@ -1,6 +1,6 @@
--- src/setup.py.orig 2014-11-16 10:34:05.521441703 +0100
+++ src/setup.py 2014-11-16 10:34:16.054812569 +0100
-@@ -581,20 +581,6 @@
+@@ -581,21 +581,6 @@
#########################################################
@@ -13,7 +13,8 @@
-output_dirs = SITE_PACKAGES + glob.glob(os.path.join(SAGE_SRC, 'build', 'lib*'))
-for output_dir in output_dirs:
- print('- cleaning {0}'.format(output_dir))
-- clean_install_dir(output_dir, python_packages, python_modules, ext_modules)
+- clean_install_dir(output_dir, python_packages, python_modules,
+- ext_modules, python_data_files)
-print('Finished cleaning, time: %.2f seconds.' % (time.time() - t))
-
-
diff --git a/libre/sagemath/disable-fes.patch b/libre/sagemath/disable-fes.patch
new file mode 100644
index 000000000..873a6a663
--- /dev/null
+++ b/libre/sagemath/disable-fes.patch
@@ -0,0 +1,19 @@
+--- src/module_list.py.orig 2015-06-07 11:29:30.710612146 +0200
++++ src/module_list.py 2015-06-07 11:30:21.877506106 +0200
+@@ -685,11 +685,11 @@
+ include_dirs = [SAGE_INC + '/ecl'],
+ depends = [SAGE_INC + '/ecl/ecl.h']),
+
+- OptionalExtension("sage.libs.fes",
+- ["sage/libs/fes.pyx"],
+- language = "c",
+- libraries = ['fes'],
+- package = 'fes'),
++# OptionalExtension("sage.libs.fes",
++# ["sage/libs/fes.pyx"],
++# language = "c",
++# libraries = ['fes'],
++# package = 'fes'),
+
+ Extension('sage.libs.flint.flint',
+ sources = ["sage/libs/flint/flint.pyx"],
diff --git a/libre/sagemath/env.patch b/libre/sagemath/env.patch
index 9ad163262..d1429e35e 100644
--- a/libre/sagemath/env.patch
+++ b/libre/sagemath/env.patch
@@ -1,5 +1,5 @@
---- src/bin/sage-env.orig 2015-05-15 11:32:42.546800174 +0200
-+++ src/bin/sage-env 2015-04-29 15:12:46.000000000 +0200
+--- src/bin/sage-env.orig 2015-01-06 10:46:04.469687605 +0100
++++ src/bin/sage-env 2015-01-06 10:49:59.547762019 +0100
@@ -110,41 +110,7 @@
}
@@ -60,7 +60,7 @@
- SAGE_ORIG_PATH=$PATH && export SAGE_ORIG_PATH
- SAGE_ORIG_PATH_SET=True && export SAGE_ORIG_PATH_SET
-fi
--export PATH="$SAGE_SRC/bin:$SAGE_LOCAL/bin:$PATH"
+-export PATH="$SAGE_ROOT/build/bin:$SAGE_SRC/bin:$SAGE_LOCAL/bin:$PATH"
+export SAGE_LOCAL="$SAGE_ROOT"
+export SAGE_ETC="/etc/sage"
+export SAGE_SHARE="$SAGE_LOCAL/share/sage"
@@ -70,17 +70,17 @@
# We offer a toolchain option, so if $SAGE_LOCAL/toolchain/toolchain-env exists source it.
# Since the user might do something crazy we do not do any checks, but hope for the best.
-@@ -309,9 +267,7 @@
+@@ -309,9 +267,6 @@
GIT_TEMPLATE_DIR="$SAGE_LOCAL"/share/git-core/templates && export GIT_TEMPLATE_DIR
GIT_EXEC_PATH="$SAGE_LOCAL"/libexec/git-core && export GIT_EXEC_PATH
-SINGULARPATH="$SAGE_LOCAL/share/singular" && export SINGULARPATH
-SINGULAR_EXECUTABLE="$SAGE_LOCAL/bin/Singular" && export SINGULAR_EXECUTABLE
-
+-
if [ -z "$SAGE_REPO_ANONYMOUS" ]; then
SAGE_REPO_ANONYMOUS="git://trac.sagemath.org/sage.git"
export SAGE_REPO_ANONYMOUS
-@@ -346,25 +310,17 @@
+@@ -363,25 +318,17 @@
export SAGE_STARTUP_FILE
fi
@@ -95,12 +95,12 @@
export PYTHON_EGG_CACHE
fi
--if [ -d "$SAGE_ROOT/local/lib/python" ]; then
-- PYTHONPATH="$SAGE_ROOT/local/lib/python"
+-if [ -d "$SAGE_LOCAL/lib/python" ]; then
+- PYTHONPATH="$SAGE_LOCAL/lib/python:$SAGE_LOCAL/lib/python/site_packages"
- if [ -n "$SAGE_PATH" ]; then
- PYTHONPATH="$SAGE_PATH:$PYTHONPATH"
- fi
-- PYTHONHOME="$SAGE_ROOT/local"
+- PYTHONHOME="$SAGE_LOCAL"
- export PYTHONPATH
- export PYTHONHOME
-fi
@@ -111,16 +111,16 @@
if [ -z "${SAGE_ORIG_LD_LIBRARY_PATH_SET}" ]; then
SAGE_ORIG_LD_LIBRARY_PATH=$LD_LIBRARY_PATH && export SAGE_ORIG_LD_LIBRARY_PATH
-@@ -412,8 +368,6 @@
- unset R_HOME
- unset R_PROFILE
-
+@@ -431,8 +378,6 @@
+ fi
+ fi
+ fi
-MAXIMA_PREFIX="$SAGE_ROOT/local" && export MAXIMA_PREFIX
-
############ architecture flags
# Support flags to change the build architecture. Currently, this is
-@@ -585,9 +539,6 @@
+@@ -602,9 +547,6 @@
LD_LIBRARY_PATH="$SAGE_LOCAL/bin:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH
fi
diff --git a/libre/sagemath/fes02.patch b/libre/sagemath/fes02.patch
deleted file mode 100644
index b0cfda79f..000000000
--- a/libre/sagemath/fes02.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/src/sage/libs/fes.pyx b/src/sage/libs/fes.pyx
-index 40b9c23..d188cf0 100644
---- src/sage/libs/fes.pyx
-+++ src/sage/libs/fes.pyx
-@@ -1,17 +1,19 @@
- """
--Binding for the FES library.
-+Binding for the libFES library.
-
- Finding solutions of systems of boolean equations by exhaustive
- search, via the fes library. This is usually (much) faster than
- computing a Groebner basis, except in special cases where the latter
- is particularly easy.
-
--The FES library is presently only able to deal with polynomials in 64
-+More information is available at [http://www.lifl.fr/~bouillag/fes].
-+
-+The libFES library is presently only able to deal with polynomials in 64
- variables. Performing a full exhaustive search over 64 variables will
- take a **long** time. The number of variables can be artificially
- reduced to 64 by specializing some of them.
-
--Note that the FES library **requires** at least of the equations to be
-+Note that the libFES library **requires** at least of the equations to be
- non-linear.
-
- AUTHORS:
-@@ -71,7 +73,7 @@ from libc.stdint cimport uint64_t
- cdef extern from "fes_interface.h":
- ctypedef int (*solution_callback_t)(void *, uint64_t)
-
-- void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose)
-+ void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose, int T)
-
-
- include 'sage/ext/interrupt.pxi' #sig_on(), sig_off()
-@@ -219,7 +221,7 @@ def exhaustive_search(eqs, max_sols=Infinity, verbose=False):
-
- # ------- runs the library
- sig_on()
-- exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose)
-+ exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose, 0)
- sig_off()
-
- # ------- frees memory occupied by the dense representation of the equations
diff --git a/libre/sagemath/ntl9.patch b/libre/sagemath/ntl9.patch
deleted file mode 100644
index 191491826..000000000
--- a/libre/sagemath/ntl9.patch
+++ /dev/null
@@ -1,178 +0,0 @@
---- ./src/sage/rings/bernmm/bernmm-test.cpp.orig 2015-02-16 17:15:12.000000000 -0700
-+++ ./src/sage/rings/bernmm/bernmm-test.cpp 2015-05-07 21:39:58.565251320 -0600
-@@ -70,7 +70,7 @@ void bern_naive(mpq_t* res, long n)
- */
- int testcase__bern_modp_powg(long p, long k, mpq_t b)
- {
-- double pinv = 1 / ((double) p);
-+ wide_double pinv = wide_double(1) / wide_double(p);
-
- // compute B_k mod p using _bern_modp_powg()
- long x = _bern_modp_powg(p, pinv, k);
-@@ -147,7 +147,7 @@ int test__bern_modp_powg()
- */
- int testcase__bern_modp_pow2(long p, long k)
- {
-- double pinv = 1 / ((double) p);
-+ wide_double pinv = wide_double(1) / wide_double(p);
-
- if (PowerMod(2, k, p, pinv) == 1)
- return 1;
---- ./src/sage/rings/bernmm/bern_modp.cpp.orig 2015-02-16 17:15:12.000000000 -0700
-+++ ./src/sage/rings/bernmm/bern_modp.cpp 2015-05-07 20:17:37.680381004 -0600
-@@ -43,14 +43,14 @@ namespace bernmm {
- pinv = 1 / ((double) p)
- g = a multiplicative generator of GF(p), in [0, p)
- */
--long bernsum_powg(long p, double pinv, long k, long g)
-+long bernsum_powg(long p, wide_double pinv, long k, long g)
- {
- long half_gm1 = (g + ((g & 1) ? 0 : p) - 1) / 2; // (g-1)/2 mod p
- long g_to_jm1 = 1;
- long g_to_km1 = PowerMod(g, k-1, p, pinv);
- long g_to_km1_to_j = g_to_km1;
- long sum = 0;
-- double g_pinv = ((double) g) / ((double) p);
-+ wide_double g_pinv = wide_double(g) / wide_double(p);
- mulmod_precon_t g_to_km1_pinv = PrepMulModPrecon(g_to_km1, p, pinv);
-
- for (long j = 1; j <= (p-1)/2; j++)
-@@ -224,7 +224,7 @@ public:
- #error Number of bits in a long must be divisible by TABLE_LG_SIZE
- #endif
-
--long bernsum_pow2(long p, double pinv, long k, long g, long n)
-+long bernsum_pow2(long p, wide_double pinv, long k, long g, long n)
- {
- // In the main summation loop we accumulate data into the _tables_ array;
- // tables[y][z] contributes to the final answer with a weight of
-@@ -481,7 +481,7 @@ long PrepRedc(long n)
- (See bernsum_pow2() for code comments; we only add comments here where
- something is different from bernsum_pow2())
- */
--long bernsum_pow2_redc(long p, double pinv, long k, long g, long n)
-+long bernsum_pow2_redc(long p, wide_double pinv, long k, long g, long n)
- {
- long pinv2 = PrepRedc(p);
- long F = (1L << (ULONG_BITS/2)) % p;
-@@ -655,7 +655,7 @@ long bernsum_pow2_redc(long p, double pi
-
- Algorithm: uses bernsum_powg() to compute the main sum.
- */
--long _bern_modp_powg(long p, double pinv, long k)
-+long _bern_modp_powg(long p, wide_double pinv, long k)
- {
- Factorisation F(p-1);
- long g = primitive_root(p, pinv, F);
-@@ -685,7 +685,7 @@ long _bern_modp_powg(long p, double pinv
- Algorithm: uses bernsum_pow2() (or bernsum_pow2_redc() if p is small
- enough) to compute the main sum.
- */
--long _bern_modp_pow2(long p, double pinv, long k)
-+long _bern_modp_pow2(long p, wide_double pinv, long k)
- {
- Factorisation F(p-1);
- long g = primitive_root(p, pinv, F);
-@@ -717,7 +717,7 @@ long _bern_modp_pow2(long p, double pinv
- 2 <= k <= p-3, k even
- pinv = 1 / ((double) p)
- */
--long _bern_modp(long p, double pinv, long k)
-+long _bern_modp(long p, wide_double pinv, long k)
- {
- if (PowerMod(2, k, p, pinv) != 1)
- // 2^k != 1 mod p, so we use the faster version
-@@ -765,7 +765,7 @@ long bern_modp(long p, long k)
- if (m == 0)
- return -1;
-
-- double pinv = 1 / ((double) p);
-+ wide_double pinv = wide_double(1) / wide_double (p);
- long x = _bern_modp(p, pinv, m); // = B_m/m mod p
- return MulMod(x, k, p, pinv);
- }
---- ./src/sage/rings/bernmm/bern_modp.h.orig 2015-02-16 17:15:12.000000000 -0700
-+++ ./src/sage/rings/bernmm/bern_modp.h 2015-05-09 08:06:39.732529882 -0600
-@@ -12,6 +12,7 @@
- #ifndef BERNMM_BERN_MODP_H
- #define BERNMM_BERN_MODP_H
-
-+#include <NTL/ZZ.h>
-
- namespace bernmm {
-
-@@ -29,8 +30,8 @@ long bern_modp(long p, long k);
- /*
- Exported for testing.
- */
--long _bern_modp_powg(long p, double pinv, long k);
--long _bern_modp_pow2(long p, double pinv, long k);
-+long _bern_modp_powg(long p, NTL::wide_double pinv, long k);
-+long _bern_modp_pow2(long p, NTL::wide_double pinv, long k);
-
-
- };
---- ./src/sage/rings/bernmm/bern_modp_util.cpp.orig 2015-02-16 17:15:12.000000000 -0700
-+++ ./src/sage/rings/bernmm/bern_modp_util.cpp 2015-05-07 21:38:06.662182003 -0600
-@@ -20,7 +20,7 @@ NTL_CLIENT;
- namespace bernmm {
-
-
--long PowerMod(long a, long ee, long n, double ninv)
-+long PowerMod(long a, long ee, long n, wide_double ninv)
- {
- long x, y;
-
-@@ -89,7 +89,7 @@ PrimeTable::PrimeTable(long bound)
- }
-
-
--long order(long x, long p, double pinv, const Factorisation& F)
-+long order(long x, long p, wide_double pinv, const Factorisation& F)
- {
- // in the loop below, m is always some multiple of the order of x
- long m = p - 1;
-@@ -113,7 +113,7 @@ long order(long x, long p, double pinv,
-
-
-
--long primitive_root(long p, double pinv, const Factorisation& F)
-+long primitive_root(long p, wide_double pinv, const Factorisation& F)
- {
- if (p == 2)
- return 1;
---- ./src/sage/rings/bernmm/bern_modp_util.h.orig 2015-02-16 17:15:12.000000000 -0700
-+++ ./src/sage/rings/bernmm/bern_modp_util.h 2015-05-09 08:58:22.618458475 -0600
-@@ -17,6 +17,7 @@
- #include <vector>
- #include <cassert>
- #include <climits>
-+#include <NTL/ZZ.h>
-
-
- #if ULONG_MAX == 4294967295U
-@@ -39,7 +40,7 @@ namespace bernmm {
-
- (Implementation is adapted from ZZ.c in NTL 5.4.1.)
- */
--long PowerMod(long a, long ee, long n, double ninv);
-+long PowerMod(long a, long ee, long n, NTL::wide_double ninv);
-
-
- /*
-@@ -123,13 +124,13 @@ long next_prime(long p);
- /*
- Computes order of x mod p, given the factorisation F of p-1.
- */
--long order(long x, long p, double pinv, const Factorisation& F);
-+long order(long x, long p, NTL::wide_double pinv, const Factorisation& F);
-
-
- /*
- Finds the smallest primitive root mod p, given the factorisation F of p-1.
- */
--long primitive_root(long p, double pinv, const Factorisation& F);
-+long primitive_root(long p, NTL::wide_double pinv, const Factorisation& F);
-
-
- }; // end namespace
diff --git a/libre/sagemath/package.patch b/libre/sagemath/package.patch
index 08ab8a8bd..0b219ddeb 100644
--- a/libre/sagemath/package.patch
+++ b/libre/sagemath/package.patch
@@ -1,11 +1,11 @@
--- src/sage/misc/package.py.orig 2014-11-23 15:58:13.000000000 +0100
+++ src/sage/misc/package.py 2015-01-22 20:32:25.651383902 +0100
-@@ -194,7 +194,7 @@
- sage: is_package_installed('sage')
- True
+@@ -204,7 +204,7 @@
+ Otherwise, installing "pillow" will cause this function to think
+ that "pil" is installed, for example.
"""
-- return any(p.startswith(package) for p in install_package())
+- return any(p.split('-')[0] == package for p in install_package())
+ return True
- def standard_packages():
- """
+ def package_versions(package_type, local=False):
+ r"""
diff --git a/libre/sagemath/paths.patch b/libre/sagemath/paths.patch
index 4691c8af9..2426c07ff 100644
--- a/libre/sagemath/paths.patch
+++ b/libre/sagemath/paths.patch
@@ -1,16 +1,18 @@
--- src/sage/env.py.orig 2014-06-25 10:47:25.827203554 +1200
+++ src/sage/env.py 2014-06-25 10:49:07.667402821 +1200
-@@ -86,21 +86,18 @@
+@@ -87,24 +87,21 @@
_add_variable_or_fallback('LOCAL_IDENTIFIER','$HOSTNAME.%s'%os.getpid())
# bunch of sage directories and files
-_add_variable_or_fallback('SAGE_ROOT', None)
-_add_variable_or_fallback('SAGE_LOCAL', opj('$SAGE_ROOT', 'local'))
-_add_variable_or_fallback('SAGE_ETC', opj('$SAGE_LOCAL', 'etc'))
+-_add_variable_or_fallback('SAGE_INC', opj('$SAGE_LOCAL', 'include'))
-_add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share'))
+_add_variable_or_fallback('SAGE_ROOT', '/usr')
+_add_variable_or_fallback('SAGE_LOCAL', '/usr')
+_add_variable_or_fallback('SAGE_ETC', '/etc/sage')
++_add_variable_or_fallback('SAGE_INC', opj('$SAGE_LOCAL', 'include', 'sage'))
+_add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share', 'sage'))
_add_variable_or_fallback('SAGE_SRC', opj('$SAGE_ROOT', 'src'))
@@ -18,6 +20,8 @@
+_add_variable_or_fallback('SITE_PACKAGES', site.getsitepackages()+['/usr/lib/sage/site-packages'])
_add_variable_or_fallback('SAGE_LIB', SITE_PACKAGES[0])
+ _add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_SRC', 'build', 'cythonized'))
+
-_add_variable_or_fallback('SAGE_EXTCODE', opj('$SAGE_SHARE', 'sage', 'ext'))
-_add_variable_or_fallback('SAGE_LOGS', opj('$SAGE_ROOT', 'logs', 'pkgs'))
-_add_variable_or_fallback('SAGE_SPKG_INST', opj('$SAGE_LOCAL', 'var', 'lib', 'sage', 'installed'))