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

Do not use =Level 1= as it is for page titles (see http://en.wikipedia.org/wiki/Wikipedia:Cheatsheet)
(Do not use =Level 1= as it is for page titles (see http://en.wikipedia.org/wiki/Wikipedia:Cheatsheet))
Line 1: Line 1:
=Install MacPorts=
==Install MacPorts==


[http://www.macports.org/ MacPorts], formerly called DarwinPorts, is a package management system that simplifies the installation of software on the MacOS X and Darwin operating systems. It is a free/open source software project to simplify installation of other free/open source software. Similar in aim and function to Fink and the BSDs' ports collections.
[http://www.macports.org/ MacPorts], formerly called DarwinPorts, is a package management system that simplifies the installation of software on the MacOS X and Darwin operating systems. It is a free/open source software project to simplify installation of other free/open source software. Similar in aim and function to Fink and the BSDs' ports collections.
Line 11: Line 11:
MacPorts has historically been rather good a maintaining their Octave portfiles. However, there are times when the maintainer fall behind. If the current version of the [http://www.macports.org/ports.php?by=name&substr=octave-devel octave-devel] port isn't current, it will be necessary to produce a local portfile. For the remainder of this page, it is assume a local portfile is being used and that the port name is {{Codeline|<nowiki>octave-local</nowiki>}}.
MacPorts has historically been rather good a maintaining their Octave portfiles. However, there are times when the maintainer fall behind. If the current version of the [http://www.macports.org/ports.php?by=name&substr=octave-devel octave-devel] port isn't current, it will be necessary to produce a local portfile. For the remainder of this page, it is assume a local portfile is being used and that the port name is {{Codeline|<nowiki>octave-local</nowiki>}}.


==Install an Octave Port==
===Install an Octave Port===


For the purpose of creating an App bundle using MacPorts, an Octave port must be installed. A standard MacPorts port or a local port may be used. For a local portfile it is first required that a [http://guide.macports.org/chunked/development.local-repositories.html local portfile repository be created] and the local portfile placed there.
For the purpose of creating an App bundle using MacPorts, an Octave port must be installed. A standard MacPorts port or a local port may be used. For a local portfile it is first required that a [http://guide.macports.org/chunked/development.local-repositories.html local portfile repository be created] and the local portfile placed there.
Line 30: Line 30:
  <nowiki>port installed octave-local</nowiki>
  <nowiki>port installed octave-local</nowiki>


=Create the MacOS X App Bundle=
==Create the MacOS X App Bundle==


There are effectively four tasks needed to produce the App bundle. First, Octave and all its build and run-time dependencies must be extracted from the MacPorts installation. Second a App bundle template for running a shell script is required. This may be done using the MacOS X developer tool, Platypus. Third, the shell script which the App bundle runs is needed. This script will be used to launch the [http://en.wikipedia.org/wiki/Terminal_(OS_X) MacOS X Terminal app]. This script is referred to as the ''App's shell script''. Finally, a script for setting up the shell environment for Octave and running Octave is required. This script is referred to as the ''Octave shell script''.
There are effectively four tasks needed to produce the App bundle. First, Octave and all its build and run-time dependencies must be extracted from the MacPorts installation. Second a App bundle template for running a shell script is required. This may be done using the MacOS X developer tool, Platypus. Third, the shell script which the App bundle runs is needed. This script will be used to launch the [http://en.wikipedia.org/wiki/Terminal_(OS_X) MacOS X Terminal app]. This script is referred to as the ''App's shell script''. Finally, a script for setting up the shell environment for Octave and running Octave is required. This script is referred to as the ''Octave shell script''.


==Produce a DMG for Octave and its dependencies==
===Produce a DMG for Octave and its dependencies===


MacPorts provides a feature for [http://guide.macports.org/index.html#using.binaries.binary-packages producing binary packages] with standalone binary installers that are precompiled; they do not require MacPorts on the target system. Binary files created with MacPorts may be either .pkg (Mac OS X Installer Packages), or RPM (RPM Package Manager) format. MacPorts may also process a .pkg package into a Mac OS X .dmg disk image file.  The port command shown below will create a DMG type binary installer for the Octave port and all its dependencies.
MacPorts provides a feature for [http://guide.macports.org/index.html#using.binaries.binary-packages producing binary packages] with standalone binary installers that are precompiled; they do not require MacPorts on the target system. Binary files created with MacPorts may be either .pkg (Mac OS X Installer Packages), or RPM (RPM Package Manager) format. MacPorts may also process a .pkg package into a Mac OS X .dmg disk image file.  The port command shown below will create a DMG type binary installer for the Octave port and all its dependencies.
Line 46: Line 46:
The DMG will be placed in the port's {{Codeline|<nowiki>work</nowiki>}} directory.  If a local portfile is used, a symbolic link to the {{Codeline|<nowiki>work</nowiki>}} directory will be placed in the directory containing the portfile.  In this instance the DMG can be found in {{Codeline|<nowiki>~/ports/math/octave-local/work</nowiki>}}.
The DMG will be placed in the port's {{Codeline|<nowiki>work</nowiki>}} directory.  If a local portfile is used, a symbolic link to the {{Codeline|<nowiki>work</nowiki>}} directory will be placed in the directory containing the portfile.  In this instance the DMG can be found in {{Codeline|<nowiki>~/ports/math/octave-local/work</nowiki>}}.


==Use Platypus to produce a template for the App bundle==
===Use Platypus to produce a template for the App bundle===


[[File:Platypus.png|400px|thumb|right|Initial Platypus Dialog (click to enlarge)]]
[[File:Platypus.png|400px|thumb|right|Initial Platypus Dialog (click to enlarge)]]
Line 66: Line 66:
* Save the App bundle template to the location of your choice.
* Save the App bundle template to the location of your choice.


==Populate the App Bundle==
===Populate the App Bundle===


To populate the App bundle template with Octave and its dependencies, from MacPorts, follow the itemize instructions below.  
To populate the App bundle template with Octave and its dependencies, from MacPorts, follow the itemize instructions below.  
Line 91: Line 91:
The Octave App bundle for MacOS X is now ready to run.
The Octave App bundle for MacOS X is now ready to run.


=Running Octave from the Terminal's Command Line=
==Running Octave from the Terminal's Command Line==


The bundled Octave may be run from a terminal command line using the command below.
The bundled Octave may be run from a terminal command line using the command below.
Line 100: Line 100:
  <nowiki>export PATH="${PATH}:/usr/local/bin"</nowiki>
  <nowiki>export PATH="${PATH}:/usr/local/bin"</nowiki>


=Problems, Restrictions, and Annoyances of the App Bundle=
==Problems, Restrictions, and Annoyances of the App Bundle==


* 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.
Line 123: Line 123:
* 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.


=Testing=
==Testing==
Those interested in testing an App bundle can try this [https://dl.dropbox.com/u/14845154/Octave-X86_64-3.7.0%2B.dmg link]. The DMG is large (620+ MB).  I kindly ask those with the patience to download it, to report results to bpabbott at mac dot com. When reporting on your experience, please include;
Those interested in testing an App bundle can try this [https://dl.dropbox.com/u/14845154/Octave-X86_64-3.7.0%2B.dmg link]. The DMG is large (620+ MB).  I kindly ask those with the patience to download it, to report results to bpabbott at mac dot com. When reporting on your experience, please include;
* The version of MacOS X you are running.
* The version of MacOS X you are running.
364

edits