[sagemath] 01/01: Work around missing JSmol
Ximin Luo
infinity0 at debian.org
Sun Dec 4 13:23:25 UTC 2016
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository sagemath.
commit 0e4ffe651557e04437dfe2fe7658414180e9d540
Author: Ximin Luo <infinity0 at debian.org>
Date: Sun Dec 4 14:23:09 2016 +0100
Work around missing JSmol
- disable installation of jsmol nbextension
- test for a slightly different path to make sure we get a new enough Jmol
The other things (e.g. notebook iframes) don't cause doctest failures and
we already documented it in README.Debian
---
debian/TODO | 6 ----
debian/patches/debian-disable-jsmol.patch | 41 +++++++++++++++++++++++++
debian/patches/disable-jmol.patch | 51 -------------------------------
debian/patches/series | 4 +--
debian/pruner/configure.ac | 2 +-
5 files changed, 43 insertions(+), 61 deletions(-)
diff --git a/debian/TODO b/debian/TODO
index fd56007..68bfab0 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -18,11 +18,6 @@ Upload packages to NEW, ASAP
* make installation of sagenb optional
* We could create a package containing the (patched) sage sources to make
it easier to run the testsuite.
- * test with missing jmol (maybe set canvas3d as default in
- src/sage/plot/plot3d/base.pyx / src/sage/graphs/generic_graph.py ?)
- * might be possible to package jmol and disable only jsmol, if that's easier
- see https://github.com/infinity0/jmol/ and its Makefile
- we would remove JSmol, then graft the rest onto the existing debian jmol packaging
* sagetex (already in experimental, does not need to pass NEW)
* Packages that have issues preventing testing migration:
@@ -58,7 +53,6 @@ Upload all packages and make sure they migrate to testing after 10 days
* Ugly packages:
* jmol and jsmol (14.6.1)
- probably just disable it for stretch
"almost" done here:
https://github.com/infinity0/jmol/
https://github.com/infinity0/java2script/
diff --git a/debian/patches/debian-disable-jsmol.patch b/debian/patches/debian-disable-jsmol.patch
new file mode 100644
index 0000000..1d7405d
--- /dev/null
+++ b/debian/patches/debian-disable-jsmol.patch
@@ -0,0 +1,41 @@
+Description: Disable installation of JSmol nbextension
+ Since we are having difficulty packaging that
+ .
+ The other things (e.g. notebook iframes) don't cause doctest failures and
+ we already documented it in README.Debian
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: not-needed
+--- a/sage/src/sage/repl/ipython_kernel/install.py
++++ b/sage/src/sage/repl/ipython_kernel/install.py
+@@ -113,23 +113,6 @@
+ dst = os.path.join(self.nbextensions_dir, 'mathjax')
+ self.symlink(src, dst)
+
+- def use_local_jsmol(self):
+- """
+- Symlink jsmol to the Jupyter notebook.
+-
+- EXAMPLES::
+-
+- sage: from sage.repl.ipython_kernel.install import SageKernelSpec
+- sage: spec = SageKernelSpec()
+- sage: spec.use_local_jsmol()
+- sage: jsmol = os.path.join(spec.nbextensions_dir, 'jsmol')
+- sage: os.path.isdir(jsmol)
+- True
+- """
+- src = os.path.join(SAGE_LOCAL, 'share', 'jsmol')
+- dst = os.path.join(self.nbextensions_dir, 'jsmol')
+- self.symlink(src, dst)
+-
+ def _kernel_cmd(self):
+ """
+ Helper to construct the SageMath kernel command.
+@@ -235,7 +218,6 @@
+ """
+ instance = cls()
+ instance.use_local_mathjax()
+- instance.use_local_jsmol()
+ instance._install_spec()
+ instance._symlink_resources()
+
diff --git a/debian/patches/disable-jmol.patch b/debian/patches/disable-jmol.patch
deleted file mode 100644
index 40f79fd..0000000
--- a/debian/patches/disable-jmol.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Description: Set canvas3d and tachyon as default 3D viewers
- Since we don't have a recent version of jmol in Debian.
-Author: Tobias Hansen <thansen at debian.org>
-
---- a/sage/src/sage/graphs/generic_graph.py
-+++ b/sage/src/sage/graphs/generic_graph.py
-@@ -18475,7 +18475,7 @@
- vertex_colors=None, vertex_size=0.06, vertex_labels=False,
- edge_colors=None, edge_size=0.02, edge_size2=0.0325,
- pos3d=None, color_by_label=False,
-- engine='jmol', **kwds):
-+ engine='tachyon', **kwds):
- r"""
- Plot a graph in three dimensions.
-
-@@ -18706,7 +18706,7 @@
- def show3d(self, bgcolor=(1,1,1), vertex_colors=None, vertex_size=0.06,
- edge_colors=None, edge_size=0.02, edge_size2=0.0325,
- pos3d=None, color_by_label=False,
-- engine='jmol', **kwds):
-+ engine='tachyon', **kwds):
- """
- Plots the graph using Tachyon, and shows the resulting plot.
-
---- a/sage/src/sage/plot/plot3d/base.pyx
-+++ b/sage/src/sage/plot/plot3d/base.pyx
-@@ -136,11 +136,11 @@
- viewer = None
- # select suitable default
- if viewer is None:
-- viewer = 'jmol'
-+ viewer = 'canvas3d'
- # fall back to 2d image if necessary
-- if viewer == 'canvas3d' and not can_view_canvas3d: viewer = 'jmol'
-- if viewer == 'wavefront' and not can_view_wavefront: viewer = 'jmol'
-- if viewer == 'jmol' and not can_view_jmol: viewer = 'tachyon'
-+ if viewer == 'jmol' and not can_view_jmol: viewer = 'canvas3d'
-+ if viewer == 'wavefront' and not can_view_wavefront: viewer = 'canvas3d'
-+ if viewer == 'canvas3d' and not can_view_canvas3d: viewer = 'tachyon'
- ### Second, return the corresponding graphics file
- if viewer == 'jmol':
- return self._rich_repr_jmol(**opts)
-@@ -1747,7 +1747,7 @@
- return self
-
- # if you add any default parameters you must update some code below
--SHOW_DEFAULTS = {'viewer': 'jmol',
-+SHOW_DEFAULTS = {'viewer': 'canvas3d',
- 'verbosity': 0,
- 'figsize': 5,
- 'aspect_ratio': "automatic",
diff --git a/debian/patches/series b/debian/patches/series
index de9b671..feb0b2f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -26,13 +26,11 @@ version-pari-2.9-trac-21765.patch
version-pari-2.9.patch
version-planarity-3.patch
-#This one is disabled as long as we keep sage's jmol.
-#disable-jmol.patch
-
# due to Debian's inherent differences with upstream;
# we're unlikely to forward these upstream
debian-fakeroot.patch
debian-paths.patch
+debian-disable-jsmol.patch
debian-maxima.patch
debian-singular.patch
debian-libgap-sage.patch
diff --git a/debian/pruner/configure.ac b/debian/pruner/configure.ac
index 7b5e128..a2fc111 100644
--- a/debian/pruner/configure.ac
+++ b/debian/pruner/configure.ac
@@ -143,7 +143,7 @@ AC_SUBST(HAS_IML)
AC_CHECK_PROG(HAS_IPYTHON, ipython, "True", "False")
AC_SUBST(HAS_IPYTHON)
-AC_CHECK_FILE(/usr/bin/jmol, HAS_JMOL="True", HAS_JMOL="False")
+AC_CHECK_FILE(/usr/share/jmol/Jmol.jar, HAS_JMOL="True", HAS_JMOL="False")
AC_SUBST(HAS_JMOL)
AC_CHECK_PROG(HAS_JUPYTER_CLIENT, jupyter-kernelspec, "True", "False")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git
More information about the debian-science-commits
mailing list