cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

change symlink for threejs #662

Closed sheerluck closed 2 years ago

sheerluck commented 2 years ago

According to https://trac.sagemath.org/ticket/30972 r122 should be symlink to build:

--- a/src/sage/repl/rich_output/backend_ipython.py
+++ b/src/sage/repl/rich_output/backend_ipython.py
@@ -413,8 +413,9 @@ class BackendIPythonCommandline(BackendIPython):
             '...<script ...</script>...'
         """
         from sage.env import THREEJS_DIR
+        from sage.repl.rich_output.display_manager import _required_threejs_version

-        script = os.path.join(THREEJS_DIR, 'build/three.min.js')
+        script = os.path.join(THREEJS_DIR, '{}/three.min.js'.format(_required_threejs_version()))

When I did list_plot3d(matrix(RDF, n, [(i+j)%n for i in [1..n] for j in [1..n]])) I get

<script src="/usr/share/sage/threejs/r122/three.min.js"></script>

in generated html file

Well, that file exists only when

$ tree /usr/share/sage/threejs
/usr/share/sage/threejs
├── build
│   └── three.min.js
├── r122 -> build
└── version
kiwifb commented 2 years ago

Looks like I thought too hard about it and got it wrong. There are a couple of things here. First it should be a -r2 replacing the -r1 version. I had that link to maintain the compatibility of threejs between installs of sage 9.3 and 9.4+. Now that 9.3 has left the overlay, we should just have something like that

/usr/share/sage/threejs
├── r122
│   └── three.min.js
└── version

in the next revision. No need to keep the link.

sheerluck commented 2 years ago

I agree

kiwifb commented 2 years ago

OOps forgot that stuff from November. It is time to do a revision putting this conversation to good use.

kiwifb commented 2 years ago

I pushed the new r2 revision which gets rid of the link altogether. Let me know if there is an issue.

sheerluck commented 2 years ago

Thank you!