Editing Create a MacOS X App Bundle Using MacPorts
Jump to navigation
Jump to search
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: | ||
== Caveats == | == Caveats == | ||
Since the initial success with producing a bundle, two things have changed on the Macports end. | {{Warning|Since the initial success with producing a bundle, two things have changed on the Macports end. | ||
* gcc-4.7 must be used, as some dependencies are no longer supported by gcc-4.5. To look for ports using a <code>gcc45</code> variant, type <code>port rdeps gcc45</code> at the terminal's command line. | * gcc-4.7 must be used, as some dependencies are no longer supported by gcc-4.5. To look for ports using a <code>gcc45</code> variant, type <code>port rdeps gcc45</code> at the terminal's command line. | ||
* The <code>sudo port mdmg octave-devel @3.6.4+atlas+docs+fltk+gcc47</code> command fails when bundling the <code>xorg- | * The <code>sudo port mdmg octave-devel @3.6.4+atlas+docs+fltk+gcc47</code> command fails when bundling the <code>xorg-libX11</code> port. To identify the why x11 is needed the command <code>port rdeps octave-devel @3.6.4_3+atlas+fltk+gcc47-x11+no_x11</code> may be used. There is one dependency (<code>Transfig</code>) for which <code>x11</code> is not optional. To resolve this, the <code>octave-devel</code> Portfile must be modified and the <code>Transfig</code> run-time dependency removed. This means that Xfig output is not available using Octave's <code>print()</code> function/command. | ||
* While editing the Portfile for <code>octave-devel</code>, the references to <code>metis</code> should also be removed to avoid a GPL violation. | * While editing the Portfile for <code>octave-devel</code>, the references to <code>metis</code> should also be removed to avoid a GPL violation. | ||
}} | |||
==Install MacPorts== | ==Install MacPorts== | ||
Line 23: | Line 21: | ||
===Install an Octave Port=== | ===Install an Octave Port=== | ||
MacPorts | 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. | ||
A [[Prototype MacPorts PortFile|prototype portfile]] | MacPorts' Octave port includes the non-GPL [http://glaros.dtc.umn.edu/gkhome/views/metis METIS]. To avoid license violations do not bundle Metis with Octave and then distribute to others. A second motivation to use a local portfile is that the portfiles for the 3.4.x and 3.6.x series did not include all dependencies for the {{Codeline|<nowiki>print</nowiki>}} feature. The missing dependencies are [http://www.macports.org/ports.php?by=name&substr=epstool epstool], [http://www.macports.org/ports.php?by=name&substr=pstoedit pstoedit], and [http://www.macports.org/ports.php?by=name&substr=transfig transfig]. A [[Prototype MacPorts PortFile|prototype portfile]] which does not depend upon METIS and does depend upon epstool, pstoedit, and transfig has been prepared. | ||
After [http://guide.macports.org/chunked/development.local-repositories.html creating a local portfile repository] an Octave portfile may be added to the local repository using the commands below. | |||
<nowiki>mkdir -p ~/ports/math/octave-local | <nowiki>mkdir -p ~/ports/math/octave-local | ||
cp ~/Desktop/portfile ~/ports/math/octave-local</nowiki> | cp ~/Desktop/portfile ~/ports/math/octave-local</nowiki> | ||
This assumes the Octave portfile had been placed on the | This assumes the Octave portfile had been placed on the users Desktop, and that the local portfile repository is located in the users home folder and named {{Codeline|<nowiki>ports</nowiki>}}. After adding the portfile, the local repository must be indexed for MacPorts to recognize it. | ||
<nowiki>cd ~/ports | <nowiki>cd ~/ports | ||
portindex -f</nowiki> | portindex -f</nowiki> | ||
Once indexed the local Octave port may be installed. | Once indexed the local Octave port may be installed. | ||
<nowiki>sudo port install octave-local | <nowiki>sudo port install octave-local +atlas+gcc47</nowiki> | ||
The use of the | The use of the {{Codeline|+atlas}} variant is encouraged as bugs exist for Apple's {{Codeline|accelerate}} framework in both MacOS 10.6 and 10.7. Octave's developers have included a fix for MacOS 10.6, but the fix does not work for MacOS 10.7. There is some commentary on this in various developers discussion forums. For example, see [https://github.com/mxcl/homebrew/issues/6649 this Homebrew thread (Octave 3.4 fails on lion)], [https://stat.ethz.ch/pipermail/r-sig-mac/2011-September/008564.html this R-Sig-Mac thread (R 2.13.1-patched, vecLib problem on Lion)], and [http://list.coin-or.org/pipermail/ipopt/2011-October/002610.html the COIN-OR thread (Ipopt - problems on OS X 10.7 Lion)]. Use of Apple's {{Codeline|accelerate}} framework should also be avoided for {{Codeline|arpack}} and {{Codeline|qrupdate}}. To install the recommended variants, use the {{Codeline|port}} commands below. | ||
<nowiki>port install arpack +atlas+gcc47 | <nowiki>port install arpack +atlas+gcc47 | ||
port install qrupdate +atlas+gcc47</nowiki> | port install qrupdate +atlas+gcc47</nowiki> | ||
As a precaution against unexpected problems and a bloated App bundle, using consistent variants for Octave and its dependents is suggested. For example, when using | As a precaution against unexpected problems and a bloated App bundle, using consistent variants for Octave and its dependents is suggested. For example, when using {{Codeline|+atlas}} make sure none of the dependents are using {{Codeline|+accelarate}}. Also, make sure no dependents are using the {{Codeline|+universal}} variant. Using the {{Codeline|+gcc47}} variant is also recommended as all of Octave's dependents have a {{Codeline|+gcc47}} variant. At the very least, following these suggestions will reduce the size of the bundle. The name of Octave's dependent ports may be determined by the command below. | ||
<nowiki>port | <nowiki>port deps octave-local</nowiki> | ||
The installed variants for each port may be determined by the command below. Be sure to replace "<portname>" with the name of the port. | The installed variants for each port may be determined by the command below. Be sure to replace "<portname>" with the name of the port. | ||
Line 47: | Line 47: | ||
<nowiki>port installed <portname></nowiki> | <nowiki>port installed <portname></nowiki> | ||
Once an Octave port is installed the command below may be used to determine / verify the version and variants of < | Once an Octave port is installed the command below may be used to determine / verify the version and variants of {{Codeline|<nowiki>octave-local</nowiki>}} which are installed. | ||
<nowiki>port installed octave-local</nowiki> | <nowiki>port installed octave-local</nowiki> | ||
==Create the MacOS X App Bundle== | ==Create the MacOS X App Bundle== | ||
Line 67: | Line 59: | ||
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. | ||
<nowiki>sudo port mdmg octave- | <nowiki>sudo port mdmg octave-local</nowiki> | ||
In the event errors such as the one below are encountered, the ports implicated (< | If more than one version of Octave is installed, or if more than one variant of Octave has been installed, the version and variant should be included. | ||
<nowiki>sudo port mdmg octave-local @<version>+variant1+variant2</nowiki> | |||
In the event errors such as the one below are encountered, the ports implicated ({{Codeline|<nowiki>t1lib</nowiki>}} in this case) must be clean prior to creating the dmg. | |||
<nowiki> | <nowiki> | ||
Error: Requested variants "+ | Error: Requested variants "+x11" do not match original selection "". | ||
Please use the same variants again, perform 'port clean | Please use the same variants again, perform 'port clean t1lib' or specify the force option (-f). | ||
Error: org.macports.mpkg for port octave- | Error: org.macports.mpkg for port octave-devel returned: Processing of port t1lib failed</nowiki> | ||
Be sure to clean each of the problematic ports prior to each attempt to create the dmg. | Be sure to clean each of the problematic ports prior to each attempt to create the dmg. | ||
<nowiki>sudo port clean | <nowiki>sudo port clean cairo ; sudo port clean cctools ; sudo port clean pango ; sudo port clean t1lib</nowiki> | ||
The | 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 produced using the [http://www.octave.org/wiki/index.php?title=Prototype_MacPorts_PortFile prototype portfile's] does not include everything needed for Octave. Both {{Codeline|macros.texi}}, {{Codeline|octave.info}}, and the {{Codeline|octave.info-#}} files are missing. Until the cause for these missing files is identified and resolved, they will have to be copied manually to the App bundle. | |||
The DMG produced using the [http://www.octave.org/wiki/index.php?title=Prototype_MacPorts_PortFile prototype portfile's] does not include everything needed for Octave. Both | |||
===Create an Application Template for Octave=== | ===Create an Application Template for Octave=== | ||
Line 331: | Line 323: | ||
** This will allow for a fully automatic build of an App bundle from a shell script. | ** This will allow for a fully automatic build of an App bundle from a shell script. | ||
* Also use an AppleScript to record the creation of a MacOS X Octave icon. | * Also use an AppleScript to record the creation of a MacOS X Octave icon. | ||
[[Category:Mac]] | |||
[[Category: |