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: | ||
=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. | |||
[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. | |||
An itemized overview of a MacPorts install is below. | An itemized overview of a MacPorts install is below. | ||
Line 19: | Line 9: | ||
* 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. | * 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== | |||
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= | |||
==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. | 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>}} | |||
The DMG will be placed in the port's work directory. If a local portfile is used, a symbolic link to the work directory will be placed in the directory containing the portfile. | |||
==Down load the Boilerplate from Savannah== | |||
* Resources/Applications/AquaTerm.app | |||
* Resources/bin/octave | |||
* Resources/script | |||
==Use Platypus to produce a template for the App bundle== | |||
To creating an application bundle for MacOS X the utility, [http://sveinbjorn.org/platypus Platypus], is used. Platypus is a developer tool for the Mac OS X operating system which is intended to create native Mac OS X applications from interpreted scripts such as shell scripts or Perl, Ruby and Python programs. | |||
A shell script intended to setup and run Octave will be used as the basis for the MacOS X App bundle. | |||
# Run Platypus | |||
# Import Octave's Icon | |||
# Set the "Script Type" to "Shell" | |||
# Specify Script Path | |||
#* Click on the "Select" button and select the shell script used to launch the Terminal app, {{Codeline|<nowiki>script</nowiki>}} | |||
# Set "Output" to "None" | |||
# Specify App Name (Octave-3.7.0) | |||
# Click the "Create" button | |||
# Save the App bundle template to the location of your choice. | |||
==Copy the contents of the MacPorts DMG to the App bundle Template== | |||
# Save the original MacPorts installation. | |||
* | #* {{Codeline|<nowiki>sudo mv /opt /opt-save</nowiki>}} | ||
# Install the DMG. This will create a new {{Codeline|<nowiki>/opt</nowiki>}} directory. | |||
# Move the the {{Codeline|<nowiki>/opt</nowiki>}} directory to the same location where {{Codeline|<nowiki>Boilerplate</nowiki>}} directory was placed. | |||
# Restore the MacPorts installation | |||
#* {{Codeline|<nowiki>sudo rm -r /opt</nowiki>}} | |||
#* {{Codeline|<nowiki>sudo mv /opt-save /opt</nowiki>}} | |||
* | |||
* | |||
==Populate the App bundle== | |||
Use the script below to copy the contents of the Boilerplate and opt/local into the App bundle. This script assumes the App bundle is named {{Codeline|<nowiki>Octave-3.7.0.app</nowiki>}}. | |||
<nowiki>#! /bin/sh | <nowiki>#! /bin/sh | ||
VERSION=3.7.0 | VERSION=3.7.0 | ||
APP=Octave | APP=Octave | ||
FULLAPP="${APP}-${VERSION}.app" | FULLAPP="${APP}-${VERSION}.app" | ||
MACPORTS_PREFIX="/opt/local/" | MACPORTS_PREFIX="./opt/local/" | ||
cp -pRf ${MACPORTS_PREFIX} ${FULLAPP}/Contents/Resources/. | cp -pRf ${MACPORTS_PREFIX} ${FULLAPP}/Contents/Resources/. | ||
rm ${FULLAPP}/Contents/Resources/bin/octave | rm ${FULLAPP}/Contents/Resources/bin/octave | ||
cp | cp -pRf Boilerplate/bin/ ${FULLAPP}/Contents/Resources/bin/. | ||
cp -pRf Boilerplate/Applications ${FULLAPP}/Contents/Resources/.</nowiki> | |||
cp /Applications | |||
=Problems and Restrictions of the App Bundle= | |||
* The path to the App bundle must not contain spaces | |||
* Conflicts with other Aquaterm Installations | |||
* No Universal Builds | |||
* Limited MacOS Compatibility | |||
* Icon needs improvement |