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

Antonio Rojas arojas at archlinux.org
Thu Jul 4 06:16:24 UTC 2019


    Date: Thursday, July 4, 2019 @ 06:16:23
  Author: arojas
Revision: 487420

Adapt to new three.js directory structure

Added:
  sagemath/trunk/sagemath-threejs-dir-structure.patch
Modified:
  sagemath/trunk/PKGBUILD

--------------------------------------+
 PKGBUILD                             |   10 +++++---
 sagemath-threejs-dir-structure.patch |   40 +++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-07-04 05:39:27 UTC (rev 487419)
+++ PKGBUILD	2019-07-04 06:16:23 UTC (rev 487420)
@@ -8,7 +8,7 @@
 pkgbase=sagemath
 pkgname=(sagemath sagemath-jupyter)
 pkgver=8.8
-pkgrel=1
+pkgrel=2
 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
 arch=(x86_64)
 url="http://www.sagemath.org"
@@ -45,7 +45,8 @@
         sagemath-cremona.patch
         sagemath-singular-4.1.2.patch
         sagemath-ecl-sigfpe.patch
-        sagemath-linbox-1.6.patch)
+        sagemath-linbox-1.6.patch
+        sagemath-threejs-dir-structure.patch)
 sha256sums=('d012ff4f0f34e086fcaf576e25220fc647826116c69b62b887bc0b8ced5c1e9f'
             '1c2a2d750e81ac65a1dc07094f086ba07f4862288c935a1cd009cdd62bcfc23c'
             '328e45e78065b5f6527174bda48cfff6828acbf107c2535b0a9a92c3ceb35842'
@@ -57,7 +58,8 @@
             '4c6df9e4e5a7b29ecf6189eda3e5a79f69b6e1b4d29c1b9559663149b8c0af96'
             '961bfb5694b67d425d21240d71490cb71714b5207c23448c89be0966512ff8f9'
             'a42f3b152b1aedb8abf16bc70971419919d1fe30328574e7fef8305f9d07d938'
-            '81fc39e39e8508f742ccc784efd0492fd04474cee75edf7bd3cbea43edd49b2e')
+            '81fc39e39e8508f742ccc784efd0492fd04474cee75edf7bd3cbea43edd49b2e'
+            '779e4107f663307bc9c564e6f800364e7e1926b6cab18ea6674bd62ea7664143')
 
 prepare(){
   cd sage-$pkgver
@@ -87,6 +89,8 @@
   patch -p1 -i ../sagemath-ecl-sigfpe.patch
 # fix build with linbox 1.6 https://trac.sagemath.org/ticket/26932
   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 python2
   sed -e 's|sage-python23|python2|' -e 's|#!/usr/bin/env python\b|#!/usr/bin/env python2|' -i src/bin/*

Added: sagemath-threejs-dir-structure.patch
===================================================================
--- sagemath-threejs-dir-structure.patch	                        (rev 0)
+++ sagemath-threejs-dir-structure.patch	2019-07-04 06:16:23 UTC (rev 487420)
@@ -0,0 +1,40 @@
+diff --git a/src/sage/repl/rich_output/backend_ipython.py b/src/sage/repl/rich_output/backend_ipython.py
+index 7c27d48..8bf4861 100644
+--- a/src/sage/repl/rich_output/backend_ipython.py
++++ b/src/sage/repl/rich_output/backend_ipython.py
+@@ -411,10 +411,15 @@ class BackendIPythonCommandline(BackendIPython):
+             sage: backend.threejs_offline_scripts()
+             '...<script ...</script>...'
+         """
+-        from sage.env import SAGE_SHARE
++        from sage.env import THREEJS_DIR
+ 
+-        scripts = [os.path.join(SAGE_SHARE, 'threejs', script)
+-                   for script in ['three.min.js', 'OrbitControls.js']]
++        scripts = [
++            os.path.join(THREEJS_DIR, script)
++            for script in [
++                'build/three.min.js',
++                'examples/js/controls/OrbitControls.js',
++            ]
++        ]
+ 
+         if sys.platform == 'cygwin':
+             import cygwin
+@@ -594,13 +599,13 @@ class BackendIPythonNotebook(BackendIPython):
+             sage: from sage.repl.rich_output.backend_ipython import BackendIPythonNotebook
+             sage: backend = BackendIPythonNotebook()
+             sage: backend.threejs_offline_scripts()
+-            '...<script src="/nbextensions/threejs/three.min...<\\/script>...'
++            '...<script src="/nbextensions/threejs/build/three.min...<\\/script>...'
+         """
+         from sage.repl.rich_output import get_display_manager
+         CDN_scripts = get_display_manager().threejs_scripts(online=True)
+         return """
+-<script src="/nbextensions/threejs/three.min.js"></script>
+-<script src="/nbextensions/threejs/OrbitControls.js"></script>
++<script src="/nbextensions/threejs/build/three.min.js"></script>
++<script src="/nbextensions/threejs/examples/js/controls/OrbitControls.js"></script>
+ <script>
+   if ( !window.THREE ) document.write('{}');
+ </script>


More information about the arch-commits mailing list