[arch-commits] Commit in sagemath/trunk (3 files)

Antonio Rojas arojas at archlinux.org
Mon Jul 29 18:26:01 UTC 2019


    Date: Monday, July 29, 2019 @ 18:26:01
  Author: arojas
Revision: 494672

Use multiplication tables shipped by meataxe package instead of generating them at runtime

Added:
  sagemath/trunk/meataxe-tables.patch
Modified:
  sagemath/trunk/PKGBUILD
  sagemath/trunk/sagemath-env.patch

----------------------+
 PKGBUILD             |   12 ++++++++----
 meataxe-tables.patch |   34 ++++++++++++++++++++++++++++++++++
 sagemath-env.patch   |    4 +---
 3 files changed, 43 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-07-29 18:08:49 UTC (rev 494671)
+++ PKGBUILD	2019-07-29 18:26:01 UTC (rev 494672)
@@ -8,7 +8,7 @@
 pkgbase=sagemath
 pkgname=(sagemath sagemath-jupyter)
 pkgver=8.8
-pkgrel=2
+pkgrel=3
 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
 arch=(x86_64)
 url="http://www.sagemath.org"
@@ -46,9 +46,10 @@
         sagemath-singular-4.1.2.patch
         sagemath-ecl-sigfpe.patch
         sagemath-linbox-1.6.patch
-        sagemath-threejs-dir-structure.patch)
+        sagemath-threejs-dir-structure.patch
+        meataxe-tables.patch)
 sha256sums=('d012ff4f0f34e086fcaf576e25220fc647826116c69b62b887bc0b8ced5c1e9f'
-            '1c2a2d750e81ac65a1dc07094f086ba07f4862288c935a1cd009cdd62bcfc23c'
+            '20f5d7a1b5b16f4de43edcd4184e99e4687d9cccce70058f3f58f5d909bda300'
             '328e45e78065b5f6527174bda48cfff6828acbf107c2535b0a9a92c3ceb35842'
             '596d03daf53a76b04029b120619253250b0e58d530d69f14afa169e27e06f446'
             'e554cdf689100c787a5fbcb7fe281cd68bef081e08bd58df8be1d113a4665d7e'
@@ -59,7 +60,8 @@
             '961bfb5694b67d425d21240d71490cb71714b5207c23448c89be0966512ff8f9'
             'a42f3b152b1aedb8abf16bc70971419919d1fe30328574e7fef8305f9d07d938'
             '81fc39e39e8508f742ccc784efd0492fd04474cee75edf7bd3cbea43edd49b2e'
-            '779e4107f663307bc9c564e6f800364e7e1926b6cab18ea6674bd62ea7664143')
+            '779e4107f663307bc9c564e6f800364e7e1926b6cab18ea6674bd62ea7664143'
+            '8305de73d7a3c68ceaa001866ff933c4fa3a0706700ade2e25046f58270bc6db')
 
 prepare(){
   cd sage-$pkgver
@@ -91,6 +93,8 @@
   patch -p1 -i ../sagemath-linbox-1.6.patch
 # use upstream's three.js directory structure https://trac.sagemath.org/ticket/28007
   patch -p1 -i ../sagemath-threejs-dir-structure.patch
+# use meataxe package's multiplication tables instead of generating them at runtime https://trac.sagemath.org/ticket/28188
+  patch -p1 -i ../meataxe-tables.patch
 
 # use python2
   sed -e 's|sage-python23|python2|' -e 's|#!/usr/bin/env python\b|#!/usr/bin/env python2|' -i src/bin/*

Added: meataxe-tables.patch
===================================================================
--- meataxe-tables.patch	                        (rev 0)
+++ meataxe-tables.patch	2019-07-29 18:26:01 UTC (rev 494672)
@@ -0,0 +1,34 @@
+diff --git a/src/sage/env.py b/src/sage/env.py
+index 27dd40c..453ccd7 100644
+--- a/src/sage/env.py
++++ b/src/sage/env.py
+@@ -182,6 +182,7 @@ var('CREMONA_LARGE_DATA_DIR',        join(SAGE_SHARE, 'cremona'))
+ var('JMOL_DIR',                      join(SAGE_SHARE, 'jmol'))
+ var('JSMOL_DIR',                     join(SAGE_SHARE, 'jsmol'))
+ var('MATHJAX_DIR',                   join(SAGE_SHARE, 'mathjax'))
++var('MTXLIB',                        join(SAGE_SHARE, 'meataxe'))
+ var('THREEJS_DIR',                   join(SAGE_SHARE, 'threejs'))
+ var('PPLPY_DOCS',                    join(SAGE_SHARE, 'doc', 'pplpy'))
+ var('MAXIMA_FAS')
+diff --git a/src/sage/libs/meataxe.pyx b/src/sage/libs/meataxe.pyx
+index 1120600..7549e55 100644
+--- a/src/sage/libs/meataxe.pyx
++++ b/src/sage/libs/meataxe.pyx
+@@ -68,7 +68,6 @@ cdef Matrix_t *rawMatrix(int Field, list entries) except NULL:
+ 
+ from sage.cpython.string cimport str_to_bytes, char_to_str
+ import os
+-from sage.env import DOT_SAGE
+ 
+ cdef void sage_meataxe_error_handler(const MtxErrorRecord_t *err):
+     sig_block()
+@@ -82,7 +81,8 @@ cdef inline meataxe_init():
+     ## Assign to a variable that enables MeatAxe to find
+     ## its multiplication tables.
+     global MtxLibDir
+-    mtxdir = str_to_bytes(os.path.join(DOT_SAGE, 'meataxe'))
++    from sage import env
++    mtxdir = str_to_bytes(env.MTXLIB)
+     if len(mtxdir) >= 1024:
+         raise RuntimeError(f"the path for the meataxe library {mtxdir!r} is too long, it needs to be of length < 1024")
+     MtxLibDir[:len(mtxdir)] = mtxdir

Modified: sagemath-env.patch
===================================================================
--- sagemath-env.patch	2019-07-29 18:08:49 UTC (rev 494671)
+++ sagemath-env.patch	2019-07-29 18:26:01 UTC (rev 494672)
@@ -91,12 +91,10 @@
  export SAGE_DOC="$SAGE_SHARE/doc/sage"
  
  if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
-@@ -411,28 +411,8 @@
+@@ -411,28 +411,6 @@
      export SAGE_STARTUP_FILE
  fi
  
-+export LIBMTX="$DOT_SAGE/meataxe"
-+[[ -d $LIBMTX ]] || mkdir -p $LIBMTX # Create meataxe data dir
 -if [ "$PYTHON_EGG_CACHE" = "" ]; then
 -    PYTHON_EGG_CACHE="$DOT_SAGE/.python-eggs"
 -    export PYTHON_EGG_CACHE


More information about the arch-commits mailing list