Changeset 24ea2a in git


Ignore:
Timestamp:
Apr 1, 2015, 11:55:22 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
4ec7338829b2741a2b2f4c879b9bfd0ec67f410d
Parents:
06cff955d56f17b8a3199fd8db5e3f4a6be98f35
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-04-01 23:55:22+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-04-01 23:56:32+02:00
Message:
Added surfer fallback to SURFER.app from http://www.mathematik.uni-kl.de/~motsak/files/SURFER.dmg under Mac OS X
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/surf.lib

    r06cff9 r24ea2a  
    1616  @uref{http://www.imaginary2008.de/surfer.imaginary2008.de}
    1717 @*Under Windows, version 159 or newer of @code{surfer} is required.
     18 Under Mac OS X please move SURFER.app from http://www.mathematik.uni-kl.de/~motsak/files/SURFER.dmg
     19 under your /Applications.
    1820 @end texinfo
    1921
     
    272274
    273275  string surf_call; i = 0;
     276 
    274277  if (isWindows())
    275278  {
     
    300303  else
    301304  {
    302     surf_call = "surfer " + l + " >/dev/null 2>&1";
     305    surf_call = "surfer";   
     306    surf_call = surf_call + " " + l + " >/dev/null 2>&1";
    303307    "Close window to exit from `surfer`.";
    304308    i = system("sh", surf_call);
     309   
     310    if ( (i != 0) && isMacOSX() )
     311    {
     312      "*!* Sorry: calling `surfer` failed ['"+surf_call+"']" + newline
     313      + " (The shell returned the error code " + string(i) + "." + newline
     314      + "But since we are on Mac OS X, let us try to open SURFER.app instead..." + newline
     315      + "Appropriate SURFER.app is available for instance at http://www.mathematik.uni-kl.de/~motsak/files/SURFER.dmg";
     316     
     317      // fallback, will only work if SURFER.app is available (e.g. in /Applications)
     318      // get SURFER.app e.g. from http://www.mathematik.uni-kl.de/~motsak/files/SURFER.dmg
     319      // note that the newer (Java-based) variant of Surfer may not support command line usage yet :(
     320     
     321      surf_call = "open -a SURFER -W --args -t -s";
     322      surf_call = surf_call + " " + l + " >/dev/null 2>&1";
     323      "Close window to exit from `surfer`.";
     324      i = system("sh", surf_call);
     325    }
     326   
     327   
     328   
    305329  }
    306330  system("sh", "/bin/rm " + l);
     
    343367      {
    344368        if (s[i+2] == "n")
     369        {
     370          return (1);
     371        }
     372      }
     373    }
     374  }
     375  return (0);
     376}
     377
     378static proc isMacOSX()
     379"returns 1 if this SINGULAR instance runs under (some) Mac OS X;
     3800 otherwise"
     381{
     382  string s = system("uname");
     383 
     384  for (int i = 1; i <= size(s)-2; i = i + 1)
     385  {
     386    if (s[i] == "d" or s[i] == "D")
     387    {
     388      if (s[i+1] == "a" or s[i+1] == "A")
     389      {
     390        if (s[i+2] == "r" or s[i+2] == "R")
    345391        {
    346392          return (1);
Note: See TracChangeset for help on using the changeset viewer.