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

From Octave
Jump to navigation Jump to search
No edit summary
(First details)
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, DarwinPorts was started in 2002 as part of the OpenDarwin project, with the involvement of a number of Apple Inc. employees including Landon Fuller, Kevin Van Vechten, and Jordan Hubbard.
An itemized overview of a MacPorts install is below.
* Install XCode: This is done via the MacOS X App Store.
* Follow [http://www.macports.org/install.php MacPorts' installation instructions].
* MacPorts has good support for Octave. A list of what MacPorts has available for Octave is [http://www.macports.org/ports.php?by=name&substr=octave here]. To install the most recent version of Octave, type {{Codeline|<nowiki>sudo port install octave-devel</nowiki>}} at the Terminal's command line. Octave has many dependencies which will be downloaded and installed prior to Octave. The entire installation process can take a few hours.
==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.
Installing an Octave port is done as;
* {{Codeline|<nowiki>sudo port install <portname></nowiki>}}
Where {{Codeline|<nowiki><portname></nowiki>}} is the name of the port. For example, the name of the port for Octave 3.6.x is {{Codeline|<nowiki>octave36</nowiki>}}.
All of Octave's dependencies will also be Installed. MacPorts' Octave port includes the non-GPL Metis. To avoid license violations do not bundle Metis with Octave and then distribute to others.
Once an Octave port is installed the command below may be used to determine / verify the port's version and variants.
* {{Codeline|<nowiki>port installed <portname></nowiki>}}
=Create the MacOS X App Bundle=
=Create the MacOS X App Bundle=
==Produce a DMG of the Octave port and its dependencies==
==Produce a DMG of the Octave port 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.
* {{Codeline|<nowiki>sudo port mdmg <portname></nowiki>}}
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.
* {{Codeline|<nowiki>sudo port mdmg <portname> @<version>+variant1+variant2</nowiki>}}
==Use the DMG to produce the App bundle==
==Use the DMG to produce the App bundle==
* Download the App Boilerplate from Savannah's task tracker.
*# to be placed on Savannah
* Create a copy of the DMG's contents
*# {{Codeline|<nowiki>sudo mv /opt /opt-save</nowiki>}}
*# Install the DMG.
*# Move the new {Codeline|<nowiki>/opt</nowiki>}} to the directory containing the App Boilerplate.
*# {{Codeline|<nowiki>sudo mv /opt-save /opt</nowiki>}}
* Create the App bundle
<nowiki>VERSION=3.7.0
APP=Octave
FULLAPP="${APP}-${VERSION}.app"
MACPORTS_PREFIX="./opt/local"
if [ -n "${FULLAPP}" ]; then
  mkdir ${FULLAPP}
  mkdir ${FULLAPP}/Contents
  mkdir ${FULLAPP}/Contents/MacOS
  cp -af ${MACPORTS_PREFIX} ${FULLAPP}/Contents/Resources
  ## Remove symbolic link to octave-$VERSION. This will be replaced by
  ## a shell script that is part of the Boilerplate
  rm ${FULLAPP}/Contents/Resources/bin/octave
fi
cp -pRf Boilerplate/. ${FULLAPP}/.
chmod 731 ${FULLAPP}</nowiki>
=Problems and Restrictions of the App Bundle=
=Problems and Restrictions of the App Bundle=
* Spaces in path to the App bundle
* Spaces in path to the App bundle
* Conflicts with other Aquaterm Installations
* Conflicts with other Aquaterm Installations

Revision as of 11:59, 22 June 2012

Install MacPorts

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, DarwinPorts was started in 2002 as part of the OpenDarwin project, with the involvement of a number of Apple Inc. employees including Landon Fuller, Kevin Van Vechten, and Jordan Hubbard.

An itemized overview of a MacPorts install is below.

  • Install XCode: This is done via the MacOS X App Store.
  • Follow MacPorts' installation instructions.
  • MacPorts has good support for Octave. A list of what MacPorts has available for Octave is here. To install the most recent version of Octave, type sudo port install octave-devel at the Terminal's command line. Octave has many dependencies which will be downloaded and installed prior to Octave. The entire installation process can take a few hours.

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 local portfile repository be created and the local portfile placed there.

Installing an Octave port is done as;

  • sudo port install <portname>

Where <portname> is the name of the port. For example, the name of the port for Octave 3.6.x is octave36.

All of Octave's dependencies will also be Installed. MacPorts' Octave port includes the non-GPL Metis. To avoid license violations do not bundle Metis with Octave and then distribute to others.

Once an Octave port is installed the command below may be used to determine / verify the port's version and variants.

  • port installed <portname>

Create the MacOS X App Bundle

Produce a DMG of the Octave port and its dependencies

MacPorts provides a feature for 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.

  • sudo port mdmg <portname>

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.

  • sudo port mdmg <portname> @<version>+variant1+variant2

Use the DMG to produce the App bundle

  • Download the App Boilerplate from Savannah's task tracker.
    1. to be placed on Savannah
  • Create a copy of the DMG's contents
    1. sudo mv /opt /opt-save
    2. Install the DMG.
    3. Move the new {Codeline|/opt}} to the directory containing the App Boilerplate.
    4. sudo mv /opt-save /opt
  • Create the App bundle
VERSION=3.7.0
APP=Octave
FULLAPP="${APP}-${VERSION}.app"
MACPORTS_PREFIX="./opt/local"
if [ -n "${FULLAPP}" ]; then
  mkdir ${FULLAPP}
  mkdir ${FULLAPP}/Contents
  mkdir ${FULLAPP}/Contents/MacOS
  cp -af ${MACPORTS_PREFIX} ${FULLAPP}/Contents/Resources
  ## Remove symbolic link to octave-$VERSION. This will be replaced by
  ## a shell script that is part of the Boilerplate
  rm ${FULLAPP}/Contents/Resources/bin/octave
fi

cp -pRf Boilerplate/. ${FULLAPP}/.
chmod 731 ${FULLAPP}

Problems and Restrictions of the App Bundle

  • Spaces in path to the App bundle
  • Conflicts with other Aquaterm Installations
  • No Universal Builds
  • Limited MacOS Compatibility
  • Icon needs improvement