Editing MacOS X App Octave Shell Script

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{Warning|This page is outdated (October 2019). For more recent information, see [[Octave for macOS]].}}
The script below is intended to be part of a MacOS X App bundle for Octave. This script is called by the [[MacOS_X_App_Launcher_Script|App launcher script]]. The script is responsible for initializing the shell environment and running Octave.
 
The script below is intended to be part of a [[Create_a_MacOS_X_App_Bundle_Using_MacPorts|MacOS X App bundle for Octave]]. This script is called by the [[MacOS_X_App_Launcher_Script|App launcher script]]. The script is responsible for initializing the shell environment and running Octave.
 
The scripts name is "octave" and its location in the App bundle is {{Codeline|<nowiki>Octave-x.y.z.app/Contents/Resources/bin/octave</nowiki>}}. Where {{Codeline|<nowiki>x.y.z</nowiki>}} refers to the version of the bundled Octave.
  <nowiki>#!/bin/sh
  <nowiki>#!/bin/sh
# Copyright (C) 2007-2008, Thomas Treichl and Paul Kienzle
# Copyright (C) 2007-2008, Thomas Treichl and Paul Kienzle
Line 26: Line 22:
VER="3.7.0+"
VER="3.7.0+"
if [ -L "$0" ] ; then
if [ -L "$0" ] ; then
  ROOT="$(dirname $(readlink -n "$0"))"
  ROOT="$(dirname $(readlink -f "$0"))"
else
else
  ROOT="$(cd "$(dirname "$0")" 2>/dev/null && pwd)"
  ROOT="$(cd "$(dirname "$0")" 2>/dev/null && pwd)"
Line 87: Line 83:


# Ghostscript stuff
# Ghostscript stuff
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="${ROOT}/share/ghostscript/9.05/Resource/Init"
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/9.05/Resource/Font:${ROOT}/share/fonts"
   GS_FONTPATH="${GS_LIB}:${ROOT}/share/ghostscript/fonts:${ROOT}/share/ghostscript/Resource/Font"
else
else
   GS_FONTPATH="${GS_LIB}:${ROOT}/share/ghostscript/fonts:${ROOT}/share/ghostscript/9.05/Resource/Font:$ROOT/share/fonts:${GS_FONTPATH}"
   GS_FONTPATH="${GS_LIB}:${ROOT}/share/ghostscript/fonts:${ROOT}/share/ghostscript/Resource/Font:${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 116: Line 101:
# 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 127: Line 111:


# Invoke Octave, preserving spaces in all the input arguments.
# Invoke Octave, preserving spaces in all the input arguments.
OCTAVE_HOME="${OCTAVE_HOME}" \
OCTAVE_HOME="${OCTAVE_HOME}" PATH="${PATH}" \
PATH="${PATH}" \
  DYLD_FALLBACK_LIBRARY_PATH="${DYLD_FALLBACK_LIBRARY_PATH}" \
  DYLD_FALLBACK_LIBRARY_PATH="${DYLD_FALLBACK_LIBRARY_PATH}" \
  CC="${CC}" \
  CC="${CC}" CXX="${CXX}" F77="${F77}" \
CXX="${CXX}" \
  LD_CXX="${CXX}" DL_LD="${CXX}" \
F77="${F77}" \
  CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" \
  LD_CXX="${CXX}" \
  CXXFLAGS="${CXXFLAGS}" XTRA_CXXFLAGS="${XTRA_CXXFLAGS}" \
DL_LD="${CXX}" \
  FFLAGS="${FFLAGS}" LDFLAGS="${LDFLAGS}" FLIBS="${FLIBS}" \
  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}" \
  INCLUDEDIR="${INCLUDEDIR}" LIBDIR="${LIBDIR}" \
LIBDIR="${LIBDIR}" \
  OCTINCLUDEDIR="${OCTINCLUDEDIR}" OCTLIBDIR="${OCTLIBDIR}" \
  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_FONTPATH="${GS_FONTPATH}" GS_LIB="${GS_LIB}" GS_OPTIONS="${GS_OPTIONS}" \
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" "$@"


Line 173: Line 138:
   end tell
   end tell
EOF</nowiki>
EOF</nowiki>
[[Category:Outdated pages]]
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: