Date: Thursday, January 22, 2015 @ 22:50:33
  Author: arojas
Revision: 126434

Move all packages which are optional upstream to optdepends. Always assume 
optional packages are installed, this way one gets meaningful error 
messages instead of Sage trying to install them itself and failing

Added:
  sage-mathematics/trunk/package.patch
Modified:
  sage-mathematics/trunk/PKGBUILD
Deleted:
  sage-mathematics/trunk/extensions.patch
  sage-mathematics/trunk/gap-hap.patch

------------------+
 PKGBUILD         |   26 ++++++++++----------------
 extensions.patch |   12 ------------
 gap-hap.patch    |   11 -----------
 package.patch    |   11 +++++++++++
 4 files changed, 21 insertions(+), 39 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2015-01-22 21:44:01 UTC (rev 126433)
+++ PKGBUILD    2015-01-22 21:50:33 UTC (rev 126434)
@@ -15,21 +15,23 @@
 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' 'genus2reduction' 'flintqs' 'lcalc' 'lrcalc' 'libfes'
-  'cryptominisat' 'eclib' 'gmp-ecm' 'zn_poly' 'python2-gd' 'python2-cvxopt' 
'pynac' 'linbox' 'gsl' 'rubiks' 'coxeter3' 'nauty'
+  'python2-matplotlib' 'python2-scipy' 'python2-sympy' 'python2-networkx' 
'libgap' 'gap' 'genus2reduction' 'flintqs' 'lcalc' 'lrcalc'
+  'cryptominisat' 'eclib' 'gmp-ecm' 'zn_poly' 'python2-gd' 'python2-cvxopt' 
'pynac' 'linbox' 'gsl' 'rubiks' 'coxeter3'
   'pari-galdata' 'pari-seadata-small' '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: 
Web-based notebook interface'
+optdepends=('cython2: to compile cython code' 'jmol: 3D plots' 'sage-notebook: 
Browser-based (flask) notebook interface'
   'sage-mathematics-doc: Documentation and inline help' 'sage-mathematics-src: 
source files needed to build cython code'
   'python2-pyzmq: ipython notebook' 'python2-tornado: ipython notebook' 
'python2-jinja: ipython notebook'
-  'coin-or-cbc: COIN backend for numerical computations')
+  'coin-or-cbc: COIN backend for numerical computations' 'nauty: for 
generating some classes of graphs'
+  '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' 
'lrs: computing volume of polytopes')
 makedepends=('cython2' 'boost' 'scons' 'ratpoints' 'symmetrica' 'fflas-ffpack' 
'python2-jinja' 'coin-or-cbc' 'mcqd')
 source=("https://github.com/sagemath/sage/archive/$pkgver.tar.gz"; 
"http://www.sagemath.org/packages/upstream/pexpect/pexpect-2.0.tar.bz2"; 
-'extensions.patch' 'c_lib.patch' 'env.patch' 'paths.patch' 'blas.patch' 
'clean.patch' 'skip-check.patch' 'gap-hap.patch' 
+'package.patch' 'c_lib.patch' 'env.patch' 'paths.patch' 'blas.patch' 
'clean.patch' 'skip-check.patch' 
 'pexpect-env.patch' 'pexpect-del.patch' 'fes02.patch')
 md5sums=('e40736461992e62af3a84cf9a212c9d1'
          'd9a3e113ed147dcee8f89962a8dccd43'
-         '5770766ae676491f79162d2062ce7c02'
+         '0eb5ac1537aac93bd67a2925c0cfd84d'
          '5216dbb3d80cecc8ec4a36cc9706f8b5'
          'b980378df4bff2cd1ca002bbfae995a2'
          '9a39301dedeb560f7bfddb81b6853f28'
@@ -36,7 +38,6 @@
          'eee444d32b8a818a67b1e0ce0850b8bb'
          '46c212a3a6713b0f78c370c7186d0982'
          '5947a420a0b1483f0cbc74c76895789b'
-         '631ee6b8b3e7d12bb7858cfd841af483'
          'a83a3b1bc7fcb7cbf752a83a8311fc42'
          'f333939ea6c41377b66407c81016cee4'
          '506944613082ba7f5b34360939ca90eb')
@@ -45,13 +46,8 @@
 prepare(){
   cd sage-$pkgver
 
-# add optional packages manually (Fedora)  
-  patch -p0 -i $srcdir/extensions.patch
-  for _ext in cryptominisat fes lrcalc coxeter3 mcqd cbc
-  do
-   sed -e "s|is_package_installed('$_ext')|True|" -i src/module_list.py
-  done
-  sed -e 's|is_package_installed("nauty")|True|' -i 
src/sage/graphs/graph_generators.py
+# 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
 # find L.h header
@@ -69,8 +65,6 @@
   patch -p0 -i $srcdir/clean.patch
 # skip checking build status
   patch -p0 -i $srcdir/skip-check.patch
-# don't use is_package_installed function
-  patch -p0 -i $srcdir/gap-hap.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 
 # use small Cremona database

Deleted: extensions.patch
===================================================================
--- extensions.patch    2015-01-22 21:44:01 UTC (rev 126433)
+++ extensions.patch    2015-01-22 21:50:33 UTC (rev 126434)
@@ -1,12 +0,0 @@
---- src/module_list.py.orig    2015-01-02 01:37:15.614093528 +0100
-+++ src/module_list.py 2015-01-02 01:37:26.140827483 +0100
-@@ -2126,7 +2126,8 @@
- # These extensions are to be compiled only if the
- # corresponding packages have been installed
- 
--from sage.misc.package import is_package_installed
-+def is_package_installed(name):
-+    return False
- 
- if is_package_installed('fes'):
-     ext_modules.extend([

Deleted: gap-hap.patch
===================================================================
--- gap-hap.patch       2015-01-22 21:44:01 UTC (rev 126433)
+++ gap-hap.patch       2015-01-22 21:50:33 UTC (rev 126434)
@@ -1,11 +0,0 @@
---- src/sage/groups/perm_gps/permgroup.py.orig 2014-12-23 10:14:09.687176992 
+0100
-+++ src/sage/groups/perm_gps/permgroup.py      2014-12-23 10:14:53.930669821 
+0100
-@@ -180,8 +180,6 @@
-     """
-     @wraps(f)
-     def wrapped(self, n, p=0):
--        if not is_package_installed('gap_packages'):
--            raise RuntimeError("You must install the optional gap_packages 
package.")
-         load_hap()
-         from sage.rings.arith import is_prime
-         if not (p == 0 or is_prime(p)):

Added: package.patch
===================================================================
--- package.patch                               (rev 0)
+++ package.patch       2015-01-22 21:50:33 UTC (rev 126434)
@@ -0,0 +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
+     """
+-    return any(p.startswith(package) for p in install_package())
++    return True
+ 
+ def standard_packages():
+     """

Reply via email to