Opened 11 years ago

Last modified 10 years ago

#11503 closed task

Make new spkg to install Jmol in SAGE_LOCAL/share — at Version 14

Reported by: gutow Owned by: gutow
Priority: major Milestone: sage-5.2
Component: notebook Keywords: sd31 Jmol flask
Cc: rado, fbissey, strogdon Merged in:
Authors: gutow Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: flask notebook Stopgaps:

Status badges

Description (last modified by gutow)

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 this .spkg
./sage -f "http://www.uwosh.edu/faculty_staff/gutow/Jmol-12.0.45.p2.spkg

(which lives at this location)

  1. A patch is necessary to notebook pathsfor flask attachment:trac_11503_path_fix.patch

Change History (16)

comment:1 Changed 11 years ago by gutow

  • Owner changed from jason, mpatel, was to gutow

Changed 11 years ago by gutow

path fix for flask

comment:2 Changed 11 years ago by gutow

  • Description modified (diff)

Changed 11 years ago by gutow

plot3d command line fix

comment:3 Changed 11 years ago by gutow

  • Description modified (diff)

comment:4 Changed 11 years ago by fbissey

  • Cc fbissey added

comment:5 Changed 11 years ago by kcrisman

  • Description modified (diff)

comment:6 Changed 11 years ago by gutow

  • Description modified (diff)

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

comment:7 Changed 11 years ago by gutow

  • Description modified (diff)
  • Status changed from new to needs_review

comment:8 follow-up: Changed 11 years ago by jhpalmieri

  • Status changed from needs_review to needs_work

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.

comment:9 in reply to: ↑ 8 Changed 11 years ago by gutow

  • 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 #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.

comment:10 Changed 11 years ago by gutow

  • Description modified (diff)

comment:11 Changed 11 years ago by gutow

  • Status changed from needs_work to needs_review

.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.

comment:12 follow-up: Changed 11 years ago by jhpalmieri

  • Status changed from needs_review to needs_work

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:

  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b if [ $? -ne 0 ]; then 
    2727fi
    2828
    2929# Check for sagenb location
    30 cd $SAGE_ROOT"/devel/sagenb/sagenb/data/jmol"
     30cd "$SAGE_ROOT/devel/sagenb/sagenb/data/jmol"
    3131if [ $? -ne 0 ]; then
    3232    echo "No old Jmol install in notebook. Skipping removal of Jmol from notebook."
    3333else
    3434    echo "Removing Jmol files from the notebook data directory..."
    35     rm -r $SAGE_ROOT"/devel/sagenb/sagenb/data/jmol"
     35    rm -r "$SAGE_ROOT/devel/sagenb/sagenb/data/jmol"
    3636fi
    3737
    3838TEMPDIR=$SPKDIR"/src"
    if [ $? -ne 0 ]; then 
    4747   echo "Directory "$SAGE_LOCAL"/share/jmol does not exist.  Creating Directory..."
    4848else
    4949    echo "Deleting all files from "$SAGE_LOCAL"/share/jmol..."
    50     rm -r $SAGE_LOCAL"/share/jmol"
     50    rm -r "$SAGE_LOCAL/share/jmol"
    5151    echo "replacing jmol directory and contents..."
    5252fi
    5353
    54 mkdir $SAGE_LOCAL"/share/jmol"
     54mkdir "$SAGE_LOCAL/share/jmol"
    5555
    5656TEMPDIR=$SPKDIR"/src/jmol"
    5757cd "$TEMPDIR"
    58 cp -r * $SAGE_LOCAL"/share/jmol/"
     58cp -r * "$SAGE_LOCAL/share/jmol/"
    5959
    6060cd $SAGE_LOCAL"/bin"
    6161if [ $? -ne 0 ]; then
    if [ $? -ne 0 ]; then 
    6464else
    6565    echo "Copying jmol script to "$SAGE_LOCAL"/bin."
    6666    cd "$TEMPDIR"
    67     cp -f jmol $SAGE_LOCAL"/bin"
     67    cp -f jmol "$SAGE_LOCAL/bin"
    6868fi
    6969
    7070echo "Installing applet web directory"
    71 mkdir $SAGE_LOCAL"/share/jmol/appletweb"
    72 cp Jmol.js $SAGE_LOCAL"/share/jmol/appletweb"
     71mkdir "$SAGE_LOCAL/share/jmol/appletweb"
     72cp Jmol.js "$SAGE_LOCAL/share/jmol/appletweb"
    7373
    7474TEMPDIR=$SPKDIR"/patches/appletweb"
    7575cd "$TEMPDIR"
    if [ $? -ne 0 ]; then 
    7777   echo "Error finding patches/appletweb directory. Exiting."
    7878   exit 1
    7979fi
    80 cp -r * $SAGE_LOCAL"/share/jmol/appletweb"
     80cp -r * "$SAGE_LOCAL/share/jmol/appletweb"
    8181
    8282if [ $? -ne 0 ]; then
    8383   echo "Error installing PACKAGE_NAME."

comment:13 in reply to: ↑ 12 Changed 11 years ago by gutow

  • Status changed from needs_work to needs_review

The below is done.  Try downloading the spkg again after 3 PM CDT.

Replying to jhpalmieri:

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 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."

comment:14 Changed 11 years ago by gutow

  • Description modified (diff)
  • Milestone changed from sage-4.8 to sage-5.0

Removing command line patch as it appears to be incorporated into 4.8.

Note: See TracTickets for help on using tickets.