Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make new spkg to install Jmol in SAGE_LOCAL/share #11503

Closed
gutow opened this issue Jun 16, 2011 · 82 comments
Closed

Make new spkg to install Jmol in SAGE_LOCAL/share #11503

gutow opened this issue Jun 16, 2011 · 82 comments

Comments

@gutow
Copy link

gutow commented Jun 16, 2011

In an effort to remove Jmol from the notebook in the Flask notebook it is being moved to SAGE_LOCAL/share. This is based on the logic that the notebook can run without Jmol, but Sage cannot run without either the notebook or Jmol even when using just the command line.

To achieve this relocation of Jmol:

  1. install the spkg http://www.uwosh.edu/faculty_staff/gutow/jmol-12.2.21.p0.spkg

  2. Apply attachment: trac-11503-jmol-spkg.2.patch to the sage root repository.

  3. Apply attachment: trac-11503-jmol-commandline.patch to the sage repository (fixes jmol on the command line)

The necessary patch for sagenb has already been merged with the master sagenb branch: sagemath/sagenb#28

Depends on #11080
Depends on #11078
Depends on #11874

CC: @sagetrac-rado @kiwifb @strogdon

Component: notebook

Keywords: sd31 Jmol flask

Author: Jonathan Gutow

Reviewer: Dan Drake, Jason Grout, Punarbasu Purkayastha

Merged: sage-5.2.beta0

Issue created by migration from https://trac.sagemath.org/ticket/11503

@gutow
Copy link
Author

gutow commented Jun 16, 2011

Attachment: trac_11503_path_fix.patch.gz

path fix for flask

@gutow

This comment has been minimized.

@gutow
Copy link
Author

gutow commented Jun 16, 2011

plot3d command line fix

@gutow
Copy link
Author

gutow commented Jun 16, 2011

comment:3

Attachment: trac_11503_cmd_line_fix.patch.gz

@gutow

This comment has been minimized.

@kcrisman

This comment has been minimized.

@gutow
Copy link
Author

gutow commented Jun 17, 2011

comment:6

spkg refactored to better meet Sage standards and remove dead code from spkg-install.

@gutow

This comment has been minimized.

@gutow

This comment has been minimized.

@jhpalmieri
Copy link
Member

comment:8

Several comments:

  • There are some backup files present: SPKG.txt~ and spkg-install~.
  • As I noted on Add jmol script in SAGE_ROOT/local/bin to hg and update #11496, you should copy the jmol shell script to SAGE_LOCAL/bin as part of spkg-install.
  • It would be helpful if you could prepare the mercurial repository with the version of hg installed with Sage. When I use the version included with Sage (which is the only version on my computer), I get
$ hg status
abort: requirement 'dotencode' not supported!

so I can't check the state of the repo without installing a new version of hg.

@gutow
Copy link
Author

gutow commented Jul 17, 2011

comment:9
  • Hmm...didn't notice the backup files.  I'll look into that...
    • I could add the Jmol script to the jmol .spkg.  The one that is in there is the generic install not the one for SAGE...It seems reasonable that it should not be tracked by SAGE...I will add the SAGE version as a patch to the .spkg.  Once I get this done, I believe Add jmol script in SAGE_ROOT/local/bin to hg and update #11496 should be closed, as it will no longer apply...let me know who to notify about that.
    • Not sure if I can manage to successfully backtrack on the Hg repository format.  In order to work with the flask-notebook on my machine, I found I needed a system install of Hg and I got the latest.  Is this going to be a hold up?  Hg has been a real pain compared to the other version control systems I've  used.  Can somebody point out how to do the backtrack cleanly and quickly.  If it takes me a couple of hours to untangle Hg that's more time than it will take me to fix the rest of the .spkg problems and more time than I have for this project at the moment.

Replying to @jhpalmieri:

Several comments: - There are some backup files present: SPKG.txt~ and spkg-install~. - As I noted on #11496, you should copy the jmol shell script to SAGE_LOCAL/bin as part of spkg-install. - It would be helpful if you could prepare the mercurial repository with the version of hg installed with Sage. When I use the version included with Sage (which is the only version on my computer), I get $ hg status abort: requirement 'dotencode' not supported! so I can't check the state of the repo without installing a new version of hg.

@gutow

This comment has been minimized.

@gutow
Copy link
Author

gutow commented Jul 18, 2011

comment:11

.p2 addresses the following: * reverted to mercurial version included in Sage (lost all the history in the process).

  • jmol launch script is now included in the patches and copied to SAGE_LOCAL/bin.
  • I think I removed all the backup files.

@jhpalmieri
Copy link
Member

comment:12

I upgraded my version of mercurial so I can look at the repo, and I hope that the version included with Sage will be upgraded soon, too (see #10594). Oh, and now I see that I can open this repo with the old version. Anyway, there are some uncommitted files:

$ hg status
? patches/Jmol.js.patch
? patches/jmol.patch

(So you should run "hg add" and then commit again.)

The file spkg-install needs some work. In particular, any variable which refers to a path should be quoted, in case there are spaces in it. (Right now, we don't support having spaces in the path where Sage is, but when it's easy to allow, we should.) I think this should do it:

diff --git a/spkg-install b/spkg-install
--- a/spkg-install
+++ b/spkg-install
@@ -27,12 +27,12 @@ if [ $? -ne 0 ]; then
 fi
 
 # Check for sagenb location
-cd $SAGE_ROOT"/devel/sagenb/sagenb/data/jmol"
+cd "$SAGE_ROOT/devel/sagenb/sagenb/data/jmol"
 if [ $? -ne 0 ]; then
     echo "No old Jmol install in notebook. Skipping removal of Jmol from notebook."
 else
     echo "Removing Jmol files from the notebook data directory..."
-    rm -r $SAGE_ROOT"/devel/sagenb/sagenb/data/jmol"
+    rm -r "$SAGE_ROOT/devel/sagenb/sagenb/data/jmol"
 fi
 
 TEMPDIR=$SPKDIR"/src"
@@ -47,15 +47,15 @@ if [ $? -ne 0 ]; then
    echo "Directory "$SAGE_LOCAL"/share/jmol does not exist.  Creating Directory..."
 else
     echo "Deleting all files from "$SAGE_LOCAL"/share/jmol..."
-    rm -r $SAGE_LOCAL"/share/jmol"
+    rm -r "$SAGE_LOCAL/share/jmol"
     echo "replacing jmol directory and contents..."
 fi
 
-mkdir $SAGE_LOCAL"/share/jmol"
+mkdir "$SAGE_LOCAL/share/jmol"
 
 TEMPDIR=$SPKDIR"/src/jmol"
 cd "$TEMPDIR"
-cp -r * $SAGE_LOCAL"/share/jmol/"
+cp -r * "$SAGE_LOCAL/share/jmol/"
 
 cd $SAGE_LOCAL"/bin"
 if [ $? -ne 0 ]; then
@@ -64,12 +64,12 @@ if [ $? -ne 0 ]; then
 else
     echo "Copying jmol script to "$SAGE_LOCAL"/bin."
     cd "$TEMPDIR"
-    cp -f jmol $SAGE_LOCAL"/bin"
+    cp -f jmol "$SAGE_LOCAL/bin"
 fi
 
 echo "Installing applet web directory"
-mkdir $SAGE_LOCAL"/share/jmol/appletweb"
-cp Jmol.js $SAGE_LOCAL"/share/jmol/appletweb"
+mkdir "$SAGE_LOCAL/share/jmol/appletweb"
+cp Jmol.js "$SAGE_LOCAL/share/jmol/appletweb"
 
 TEMPDIR=$SPKDIR"/patches/appletweb"
 cd "$TEMPDIR"
@@ -77,7 +77,7 @@ if [ $? -ne 0 ]; then
    echo "Error finding patches/appletweb directory. Exiting."
    exit 1
 fi
-cp -r * $SAGE_LOCAL"/share/jmol/appletweb"
+cp -r * "$SAGE_LOCAL/share/jmol/appletweb"
 
 if [ $? -ne 0 ]; then
    echo "Error installing PACKAGE_NAME."

@kcrisman
Copy link
Member

Changed reviewer from Dan Drake, Jason Grout to Dan Drake, Jason Grout, Punarbasu Purkayastha

@jdemeyer jdemeyer modified the milestones: sage-5.1, sage-5.2 Jun 2, 2012
@kini
Copy link
Contributor

kini commented Jun 27, 2012

comment:59

Please put the latest version of the SPKG up on this ticket. It looks like #12299's instructions mention a newer version of the SPKG than is found here.

@kcrisman
Copy link
Member

comment:60

Jonathan can correct me if I'm wrong, but as far as I know, this is on purpose, because the newest Jmol at #12299 needs the many updates to Jmol there. In that sense this ticket is a 'hard' prereq for #11080 and hence for #13121/#12299.

@kini
Copy link
Contributor

kini commented Jun 28, 2012

comment:61

OK, fair enough.

@jdemeyer
Copy link

jdemeyer commented Jul 2, 2012

Merged: sage-5.2.beta0

@jdemeyer
Copy link

Changed merged from sage-5.2.beta0 to none

@jdemeyer
Copy link

comment:63

Unmerging this from sage-5.2 due to the serious security issue at #13270.

@jdemeyer jdemeyer reopened this Jul 23, 2012
@jdemeyer jdemeyer removed this from the sage-5.2 milestone Jul 23, 2012
@jdemeyer
Copy link

Merged: sage-5.2.beta0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants