[arch-commits] Commit in sagemath/trunk (PKGBUILD ecm-7.patch paths.patch)

Antonio Rojas arojas at archlinux.org
Tue May 17 19:19:05 UTC 2016


    Date: Tuesday, May 17, 2016 @ 21:19:04
  Author: arojas
Revision: 175566

Add fixes for ECM 7, add upstream patch to replace is_package_installed usage

Added:
  sagemath/trunk/ecm-7.patch
Modified:
  sagemath/trunk/PKGBUILD
  sagemath/trunk/paths.patch

-------------+
 PKGBUILD    |   26 +++++++++----------
 ecm-7.patch |   79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 paths.patch |    2 -
 3 files changed, 93 insertions(+), 14 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-05-17 19:07:16 UTC (rev 175565)
+++ PKGBUILD	2016-05-17 19:19:04 UTC (rev 175566)
@@ -9,7 +9,7 @@
 
 pkgname=sagemath
 pkgver=7.2
-pkgrel=1
+pkgrel=2
 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
 arch=(i686 x86_64)
 url="http://www.sagemath.org"
@@ -33,22 +33,24 @@
 provides=(sage-mathematics)
 source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
         pexpect.zip::"https://github.com/pexpect/pexpect/archive/524495960dd8898ddd30f7ba37298de51beee773.zip"
-        anal.h package.patch env.patch paths.patch clean.patch skip-check.patch cython-sys-path.patch
-        disable-fes.patch jupyter-path.patch test-optional.patch python-2.7.11.patch linbox-1.4.patch)
+        anal.h env.patch paths.patch clean.patch skip-check.patch cython-sys-path.patch is-package-installed.patch package.patch
+        disable-fes.patch jupyter-path.patch test-optional.patch python-2.7.11.patch linbox-1.4.patch ecm-7.patch)
 md5sums=('2afeb8f75a33107fef5d509698c0eabc'
          'a346bb2c0350c1cb17d5325235c5e38a'
          'a906a180d198186a39820b0a2f9a9c63'
-         '9ba81f717ffd4e20b8b2f2a318307488'
          'f6c62f0ccc168c5e6e3dd9d6f73f6389'
-         '0f746ed394fd7eb7a6b3963014976098'
+         '52d30e91110183489f66d7bf73c36c64'
          '6d9ae0978ce6a05a0da2cafdfb178a09'
          '5947a420a0b1483f0cbc74c76895789b'
          'a1bcdd3fe620dbae60ed8b0e98b2ece7'
+         '541988696465f204235d595a349017f3'
+         '9ba81f717ffd4e20b8b2f2a318307488'
          '4eb23a3c7363258bc9ba764d6e5512ba'
          '16b529194c6105c3364127bd8f1efa83'
          'cdcabd475b80afe0534a5621e972736e'
          'ef927896f2071b442b1d07d7e69f5f3a'
-         '9f1cef3e477bafebe2ad301db56db8a2')
+         '9f1cef3e477bafebe2ad301db56db8a2'
+         '0c9a57d35de80c2cd418ebec912efbbb')
 
 prepare(){
   cd sage-$pkgver
@@ -70,12 +72,6 @@
   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
-  sed -e "s|is_package_installed('database_cremona_ellcurve')|os.path.exists('/usr/share/sage/cremona/cremona.db')|" \
-   -i src/sage/databases/cremona.py
-# fix lrs detection
-  sed -e "s|is_package_installed('lrslib')|os.path.exists('/usr/bin/lrs')|g" -i src/sage/geometry/polyhedron/base.py \
-   -i src/sage/game_theory/normal_form_game.py
 # find bliss headers
   sed -e 's|graph.hh|bliss/graph.hh|' -i src/sage/graphs/bliss.pyx
 # don't list optional packages when running tests
@@ -86,6 +82,8 @@
   patch -p0 -i ../python-2.7.11.patch
 # search system paths for cython includes
   patch -p1 -i ../cython-sys-path.patch
+# fix regressions with ECM 7
+  patch -p1 -i ../ecm-7.patch
 
 # Upstream patches  
 # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209
@@ -92,8 +90,10 @@
 #  patch -p0 -i ../fes02.patch
 # disable fes module, fails to compile
   patch -p0 -i ../disable-fes.patch
-# port to new givaro/fflas-ffpack/linbox
+# port to new givaro/fflas-ffpack/linbox http://trac.sagemath.org/ticket/17635
   patch -p1 -i ../linbox-1.4.patch
+# replace is_package_installed usage http://trac.sagemath.org/ticket/20377
+  patch -p1 -i ../is-package-installed.patch
 
 # use python2
   sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/*

Added: ecm-7.patch
===================================================================
--- ecm-7.patch	                        (rev 0)
+++ ecm-7.patch	2016-05-17 19:19:04 UTC (rev 175566)
@@ -0,0 +1,79 @@
+--- a/src/sage/interfaces/ecm.py.orig	2016-05-16 22:18:03.894827738 +0200
++++ b/src/sage/interfaces/ecm.py	2016-05-16 22:19:14.674904932 +0200
+@@ -140,9 +140,6 @@
+         - ``ve`` -- integer `n`. Verbosely show short (`< n`
+           character) expressions on each loop
+ 
+-        - ``cofdec`` -- boolean. Force cofactor output in decimal
+-          (even if expressions are used )
+-
+         - ``B2scale`` -- integer. Multiplies the default B2 value
+ 
+         - ``go`` -- integer. Preload with group order val, which can
+@@ -395,15 +392,15 @@
+             if m is not None:
+                 factor = m.group('factor')
+                 primality = m.group('primality')
+-                assert primality in ['probable prime', 'composite']
+-                result += [(ZZ(factor), primality == 'probable prime')]
++                assert primality in ['prime', 'composite']
++                result += [(ZZ(factor), primality == 'prime')]
+                 continue  # cofactor on the next line
+             m = self._found_cofactor_re.match(line)
+             if m is not None:
+                 cofactor = m.group('cofactor')
+                 primality = m.group('primality')
+-                assert primality in ['Probable prime', 'Composite']
+-                result += [(ZZ(cofactor), primality == 'Probable prime')]
++                assert primality in ['Prime', 'Composite']
++                result += [(ZZ(cofactor), primality == 'Prime')]
+                 # assert len(result) == 2
+                 return result
+         raise ValueError('failed to parse ECM output')
+@@ -501,7 +498,6 @@
+         if factor_digits is not None:
+             B1 = self.recommended_B1(factor_digits)
+         kwds['one'] = True
+-        kwds['cofdec'] = True
+         cmd = self._make_cmd(B1, None, kwds)
+         out = self._run_ecm(cmd, n)
+         return self._parse_output(n, out)
+@@ -828,8 +828,8 @@
+ Step 1 took 12ms
+ Step 2 took 17ms
+ ********** Factor found in step 2: 79792266297612017
+-Found probable prime factor of 17 digits: 79792266297612017
+-Probable prime cofactor 6366805760909027985741435139224233 has 34 digits
++Found prime factor of 17 digits: 79792266297612017
++Prime cofactor 6366805760909027985741435139224233 has 34 digits
+ """
+ 
+ TEST_ECM_OUTPUT_2 = """
+@@ -839,8 +839,8 @@
+ Step 1 took 2ms
+ Step 2 took 3ms
+ ********** Factor found in step 2: 179424673
+-Found probable prime factor of  9 digits: 179424673
+-Probable prime cofactor 179424673 has 9 digits
++Found prime factor of  9 digits: 179424673
++Prime cofactor 179424673 has 9 digits
+ """
+ 
+ TEST_ECM_OUTPUT_3 = """
+@@ -858,7 +858,7 @@
+ Step 1 took 5ms
+ Step 2 took 4ms
+ ********** Factor found in step 2: 197002597249
+-Found probable prime factor of 12 digits: 197002597249
++Found prime factor of 12 digits: 197002597249
+ Composite cofactor 339872432034468861533158743041639097889948066859 has 48 digits
+ """
+ 
+@@ -870,5 +870,5 @@
+ Step 2 took 2ms
+ ********** Factor found in step 2: 265748496095531068869578877937
+ Found composite factor of 30 digits: 265748496095531068869578877937
+-Probable prime cofactor 251951573867253012259144010843 has 30 digits
++Prime cofactor 251951573867253012259144010843 has 30 digits
+ """
+

Modified: paths.patch
===================================================================
--- paths.patch	2016-05-17 19:07:16 UTC (rev 175565)
+++ paths.patch	2016-05-17 19:19:04 UTC (rev 175566)
@@ -12,7 +12,7 @@
 +_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_INC',        opj('$SAGE_LOCAL', 'include'))
 +_add_variable_or_fallback('SAGE_SHARE',      opj('$SAGE_LOCAL', 'share', 'sage'))
  
  _add_variable_or_fallback('SAGE_SRC',        opj('$SAGE_ROOT', 'src'))



More information about the arch-commits mailing list