Create a MacOS X App Bundle Using MacPorts: Difference between revisions

Jump to navigation Jump to search
Line 105: Line 105:


* In the past, the App bundle did not run if there were spaces in its path.  A solution to this problem has been applied, but is not fully tested.
* In the past, the App bundle did not run if there were spaces in its path.  A solution to this problem has been applied, but is not fully tested.
* In some instances, the Octave binary attempts to load an library whose version number is older than the one it intended to link to (at build time).  This will produce an error like to one below.  The developer utility, [http://macdylibbundler.sourceforge.net/ dylibbundler], is useful in pointing to and/or bundling dynamic libraries in an App bundle.  These errors may linger as the application of this tool requires some experimentation in this case.
* In some instances, the Octave binary attempts to load an library whose version number is older than the one it intended to link to (at build time).  This will produce an error like to one below.  The developer utility, [http://macdylibbundler.sourceforge.net/ dylibbundler], is useful in pointing to and/or bundling dynamic libraries in an App bundle.  This utility automates the use of [https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/install_name_tool.1.html {{Codeline|install_name_tool}}].  These errors may linger as the application of this tool requires some experimentation in this case.
  <nowiki>dyld: Library not loaded: /opt/local/libiconv.2.dylib</nowiki>
  <nowiki>dyld: Library not loaded: /opt/local/libiconv.2.dylib</nowiki>
* The [[MacOS_X_App_Octave_Shell_Script|Octave shell script]] used to run Octave is designed to ensure that the bundled version of AquaTerm is used by Octave. This was done because binary incompatibilities have been encountered between the bundled Gnuplot and AquaTerm applications provided by other sources. If Octave/Gnuplot appear to have a problem producing a plot using AquaTerm, verify that Aquaterm is running. If it is not, then quit and relaunch the Octave App. If an Aquaterm application is running, please verify that it is the one bundled with Octave.
* The [[MacOS_X_App_Octave_Shell_Script|Octave shell script]] used to run Octave is designed to ensure that the bundled version of AquaTerm is used by Octave. This was done because binary incompatibilities have been encountered between the bundled Gnuplot and AquaTerm applications provided by other sources. If Octave/Gnuplot appear to have a problem producing a plot using AquaTerm, verify that Aquaterm is running. If it is not, then quit and relaunch the Octave App. If an Aquaterm application is running, please verify that it is the one bundled with Octave.
Line 112: Line 112:
* When Octave is running, clicking on Octave's icon in the dock has no effect. This is because the App bundle runs a shell script which launches Terminal.app which runs Octave. To locate the Octave session, click on the Terminal.app.
* When Octave is running, clicking on Octave's icon in the dock has no effect. This is because the App bundle runs a shell script which launches Terminal.app which runs Octave. To locate the Octave session, click on the Terminal.app.
* Only one instance of the App may be run by clicking on the app.  Multiple instances may be run from the command line.
* Only one instance of the App may be run by clicking on the app.  Multiple instances may be run from the command line.
===Fixing {{Codeline|dyld: Library not loaded}} Errors===
If an error such as the one below is encountered;
<nowiki>dyld: Library not loaded: /opt/local/libiconv.2.dylib</nowiki>
It is likely due to the Bundle looking in the original install path rather than in the App bundle for the library. This can be fixed using the developer utility [https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/install_name_tool.1.html {{Codeline|install_name_tool}}].
To point to the correct location for the library, first determine the library's location in the App bundle. In this instance the library's path is {{Codeline|Octave-3.7.0+.app/Contents/Resources/lib/libiconv.2.dylib}}. Next open a Terminal session, {{Codeline|cd}} to the Resources directory and repair Octave's binary.
<nowiki>cd /Applications/Octave-3.7.0+.app/Contents/Resources/bin
install_name_tool -change /opt/local/libiconv.2.dylib @executable_path/../lib/libiconv.2.dylib Octave-3.7.0+</nowiki>
To check the binary for other occurances of this problem, type the command below.
<nowiki>otool -L Octave-3.7.0+</nowiki>
The developer utility, [http://macdylibbundler.sourceforge.net/ dylibbundler], is intended to automate this process.  As such problems are encountered, please notify Octave's developers, by [http://www.gnu.org/software/octave/bugs.html filling a bug report], so that the problem can be permanently repaired.


==Testing==
==Testing==
364

edits

Navigation menu