MacOS X App Octave Shell Script: Difference between revisions

Update to properly setup the environment for AquaTerm, Gnuplot, and Ghostscript. This version has been tested on a Mac running 10.7 with no Fink or Macports installed
No edit summary
(Update to properly setup the environment for AquaTerm, Gnuplot, and Ghostscript. This version has been tested on a Mac running 10.7 with no Fink or Macports installed)
Line 85: Line 85:


# Ghostscript stuff
# Ghostscript stuff
GS_LIB="${ROOT}/share/ghostscript/9.05/Resource/Init"
GS_LIB="${ROOT}/share/ghostscript/9.05/Resource/Init:${ROOT}/share/ghostscript/9.05/Resource:${ROOT}/share/ghostscript/9.05/iccprofiles:${ROOT}/lib"
GS_LIB="${GS_LIB}:${ROOT}/share/ghostscript/9.05/Resource"
if [ -z ${GS_FONTPATH} ]; then
if [ -z ${GS_FONTPATH} ]; then
   GS_FONTPATH="${GS_LIB}:${ROOT}/share/ghostscript/fonts:${ROOT}/share/ghostscript/Resource/Font"
   GS_FONTPATH="${GS_LIB}:${ROOT}/share/ghostscript/fonts:${ROOT}/share/ghostscript/9.05/Resource/Font:${ROOT}/share/fonts"
else
else
   GS_FONTPATH="${GS_LIB}:${ROOT}/share/ghostscript/fonts:${ROOT}/share/ghostscript/Resource/Font:${GS_FONTPATH}"
   GS_FONTPATH="${GS_LIB}:${ROOT}/share/ghostscript/fonts:${ROOT}/share/ghostscript/9.05/Resource/Font:$ROOT/share/fonts:${GS_FONTPATH}"
fi
fi
# Add /usr/X11/share/fonts to GS_FONTPATH ?
# Add /usr/X11/share/fonts to GS_FONTPATH
GS_FONTPATH="${GS_FONTPATH}:/usr/X11/share/fonts"
GS_OPTIONS="-sGenericResourceDir=\"${ROOT}/share/ghostscript/9.05/Resource/\""
GS_OPTIONS="-sGenericResourceDir=\"${ROOT}/share/ghostscript/9.05/Resource/\""
GS_OPTIONS="${GS_OPTIONS} -sFontResourceDir=\"${ROOT}/share/ghostscript/9.05/Resource/Font/\""
GS_OPTIONS="${GS_OPTIONS} -sFontResourceDir=\"${ROOT}/share/ghostscript/9.05/Resource/Font/\""
GS_OPTIONS="${GS_OPTIONS} -sICCProfilesDir=\"${ROOT}/share/ghostscript/9.05/iccprofiles/\""


# Gnuplot stuff
# Gnuplot stuff
GNUPLOT_HOME="${ROOT}"
GNUHELP="${ROOT}/share/gnuplot/4.6/gnuplot.gih"
GNUPLOT_DRIVER_DIR="${ROOT}/libexec/gnuplot/4.6"
GNUPLOT_FONTPATH="${ROOT}/share/fonts/urw-fonts"
# Add /usr/X11/share/fonts to GNUPLOT_FONTPATH
GNUPLOT_FONTPATH="${GNUPLOT_FONTPATH}:/usr/X11/share/fonts/TTF"
GNUPLOT_FONTPATH="${GNUPLOT_FONTPATH}:/usr/X11/share/fonts/Type1"
GNUPLOT_PS_DIR="${ROOT}/share/gnuplot/4.6/PostScript"
GNUPLOT_DEFAULT_GDFONT=Helvetica
GDFONTPATH="${ROOT}/Resources/share/ghostscript/fonts"
GNUTERM=aqua
GNUTERM=aqua
GNUTERMAPP="${ROOT}/Applications/AquaTerm.app"
GNUTERMAPP="${ROOT}/Applications/AquaTerm.app"
Line 103: Line 114:
# If AquaTerm is running, use AppleScript to tell it to quit. This is done to ensure
# If AquaTerm is running, use AppleScript to tell it to quit. This is done to ensure
# the AquaTerm which is running is part of the app bundle.
# the AquaTerm which is running is part of the app bundle.
export DYLD_FRAMEWORK_PATH
osascript 2>&1>/dev/null <<EOF
osascript 2>&1>/dev/null <<EOF
   tell application "System Events" to set ProcessList to get name of every process
   tell application "System Events" to set ProcessList to get name of every process
Line 113: Line 125:


# Invoke Octave, preserving spaces in all the input arguments.
# Invoke Octave, preserving spaces in all the input arguments.
OCTAVE_HOME="${OCTAVE_HOME}" PATH="${PATH}" \
OCTAVE_HOME="${OCTAVE_HOME}" \
PATH="${PATH}" \
  DYLD_FALLBACK_LIBRARY_PATH="${DYLD_FALLBACK_LIBRARY_PATH}" \
  DYLD_FALLBACK_LIBRARY_PATH="${DYLD_FALLBACK_LIBRARY_PATH}" \
  CC="${CC}" CXX="${CXX}" F77="${F77}" \
  CC="${CC}" \
  LD_CXX="${CXX}" DL_LD="${CXX}" \
CXX="${CXX}" \
  CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" \
F77="${F77}" \
  CXXFLAGS="${CXXFLAGS}" XTRA_CXXFLAGS="${XTRA_CXXFLAGS}" \
  LD_CXX="${CXX}" \
  FFLAGS="${FFLAGS}" LDFLAGS="${LDFLAGS}" FLIBS="${FLIBS}" \
DL_LD="${CXX}" \
  CFLAGS="${CFLAGS}" \
CPPFLAGS="${CPPFLAGS}" \
  CXXFLAGS="${CXXFLAGS}" \
XTRA_CXXFLAGS="${XTRA_CXXFLAGS}" \
  FFLAGS="${FFLAGS}" \
LDFLAGS="${LDFLAGS}" \
FLIBS="${FLIBS}" \
  DL_LDFLAGS="${DL_LDFLAGS}" \
  DL_LDFLAGS="${DL_LDFLAGS}" \
  INCLUDEDIR="${INCLUDEDIR}" LIBDIR="${LIBDIR}" \
  INCLUDEDIR="${INCLUDEDIR}" \
  OCTINCLUDEDIR="${OCTINCLUDEDIR}" OCTLIBDIR="${OCTLIBDIR}" \
LIBDIR="${LIBDIR}" \
  OCTINCLUDEDIR="${OCTINCLUDEDIR}" \
OCTLIBDIR="${OCTLIBDIR}" \
  OCT_LINK_OPTS="${OCT_LINK_OPTS}" \
  OCT_LINK_OPTS="${OCT_LINK_OPTS}" \
  SED="$SED" MAGICK_HOME="${ROOT}" \
  SED="$SED" MAGICK_HOME="${ROOT}" \
  FONTCONFIG_PATH="${ROOT}/etc/fonts" \
  FONTCONFIG_PATH="${ROOT}/etc/fonts" \
  GS_FONTPATH="${GS_FONTPATH}" GS_LIB="${GS_LIB}" GS_OPTIONS="${GS_OPTIONS}" \
  GS_FONTPATH="${GS_FONTPATH}" \
GS_LIB="${GS_LIB}" \
GS_OPTIONS="${GS_OPTIONS}" \
  DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}" \
  DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}" \
  AQUATERM_PATH="${AQUATERM_PATH}" \
  AQUATERM_PATH="${AQUATERM_PATH}" \
  GNUTERM="${GNUTERM}" \
  GNUTERM="${GNUTERM}" \
  GNUTERMAPP="${GNUTERMAPP}" \
  GNUTERMAPP="${GNUTERMAPP}" \
GNUPLOT_HOME="${GNUPLOT_HOME}" \
GNUHELP="${GNUHELP}" \
GNUPLOT_DRIVER_DIR="${GNUPLOT_DRIVER_DIR}" \
GNUPLOT_FONTPATH="${GNUPLOT_FONTPATH}" \
GNUPLOT_PS_DIR="${GNUPLOT_PS_DIR}" \
GNUPLOT_DEFAULT_GDFONT="${GNUPLOT_DEFAULT_GDFONT}" \
GDFONTPATH="${GDFONTPATH}" \
  "${ROOT}/bin/octave-$VER" "$@"
  "${ROOT}/bin/octave-$VER" "$@"


364

edits