Difference between revisions of "EiffelOnMac"

(Using Homebrew)
(Using Homebrew)
Line 30: Line 30:
  
 
=== Using Homebrew ===
 
=== Using Homebrew ===
Once homebrew is installed typed the following commands to install the required packages:
+
A light-weight alternative to installing MacPorts is [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Installation.md#installation Homebrew].
 +
Once Homebrew is installed type the following commands to install the required packages:
  
 
<pre>
 
<pre>
brew install pkg-congig
+
brew install pkg-config
 
brew install gtk+
 
brew install gtk+
 
</pre>
 
</pre>

Revision as of 12:34, 5 November 2014


This page gives you an overview about how to get EiffelStudio running on your Mac (Mavericks or above).

Requirements

  • You will need to install Xcode from the App Store. After installing Xcode, make sure to install the command line tools by going to the Xcode preferences and under Downloads install the Command Line Tools components.

Information.png Note: Advanced users may not need to install Xcode as long as you install the development tools. Even though you save in download time, you might waste a lot of time trying to fix missing dependencies. In other words, unless you are feeling adventurous, do install Xcode.

Installation

Using MacPorts

MacPorts is a tool that allows you to use many Unix applications on the Mac. We have created a package in the MacPorts repository that allows you to to install Eiffel Studio with all dependencies in a convenient way. First, install MacPorts.

Now simply type (from a bash terminal):

sudo port install eiffelstudio

and after some time (compiling on a 2.4 GHz Intel Mac takes about an hour) you're ready to go.

When a new release of the same version EiffelStudio becomes available, you can upgrade like so:

sudo port selfupdate
sudo port upgrade outdated

Using Homebrew

A light-weight alternative to installing MacPorts is Homebrew. Once Homebrew is installed type the following commands to install the required packages:

brew install pkg-config
brew install gtk+

You also need to add to your PKG_CONFIG_PATH the following path:

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:$PKG_CONFIG_PATH

Then you need to update the `ec' executable to find the right libraries:

install_name_tool -change /opt/local/lib/libiconv.2.dylib /usr/lib/libiconv.2.dylib `which ec`
install_name_tool -change /opt/local/lib/libgthread-2.0.0.dylib /usr/local/lib/libgthread-2.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libgtk-x11-2.0.0.dylib /usr/local/lib/libgtk-x11-2.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libgdk-x11-2.0.0.dylib /usr/local/lib/libgdk-x11-2.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libpangocairo-1.0.0.dylib /usr/local/lib/libpangocairo-1.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libgio-2.0.0.dylib /usr/local/lib/libgio-2.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libXrender.1.dylib /usr/local/lib/libXrender.1.dylib `which ec`
install_name_tool -change /opt/local/lib/libXinerama.1.dylib /usr/local/lib/libXinerama.1.dylib `which ec`
install_name_tool -change /opt/local/lib/libXi.6.dylib /usr/local/lib/libXi.6.dylib `which ec`
install_name_tool -change /opt/local/lib/libXrandr.2.dylib /usr/local/lib/libXrandr.2.dylib `which ec`
install_name_tool -change /opt/local/lib/libXcursor.1.dylib /usr/local/lib/libXcursor.1.dylib `which ec`
install_name_tool -change /opt/local/lib/libXcomposite.1.dylib /usr/local/lib/libXcomposite.1.dylib `which ec`
install_name_tool -change /opt/local/lib/libXdamage.1.dylib /usr/local/lib/libXdamage.1.dylib `which ec`
install_name_tool -change /opt/local/lib/libXfixes.3.dylib /usr/local/lib/libXfixes.3.dylib `which ec`
install_name_tool -change /opt/local/lib/libX11.6.dylib /usr/local/lib/libX11.6.dylib `which ec`
install_name_tool -change /opt/local/lib/libXext.6.dylib /usr/local/lib/libXext.6.dylib `which ec`
install_name_tool -change /opt/local/lib/libatk-1.0.0.dylib /usr/local/lib/libatk-1.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libcairo.2.dylib /opt/X11/lib/libcairo.2.dylib `which ec`
install_name_tool -change /opt/local/lib/libgdk_pixbuf-2.0.0.dylib /usr/local/lib/libgdk_pixbuf-2.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libpangoft2-1.0.0.dylib /usr/local/lib/libpangoft2-1.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libpango-1.0.0.dylib /usr/local/lib/libpango-1.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libgobject-2.0.0.dylib /usr/local/lib/libgobject-2.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libfontconfig.1.dylib /opt/X11/lib/libfontconfig.1.dylib `which ec`
install_name_tool -change /opt/local/lib/libfreetype.6.dylib /opt/X11/lib/libfreetype.6.dylib `which ec`
install_name_tool -change /opt/local/lib/libgmodule-2.0.0.dylib /usr/local/lib/libgmodule-2.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libglib-2.0.0.dylib /usr/local/lib/libglib-2.0.0.dylib `which ec`
install_name_tool -change /opt/local/lib/libintl.8.dylib /usr/local/lib/libintl.8.dylib `which ec`

Using binary packages

Warning.png Warning: This method still requires an initial installation via MacPorts.

Download the latest .tar.bz2 package from the Eiffel Software site and follow the same instructions as the Linux version to setup the environment variables needed to run EiffelStudio. Keep the ISE_PLATFORM value to macosx-x86-64.

Starting EiffelStudio installed via MacPorts

Simply navigate to /Applications/MacPorts/EiffelXX and double click the EiffelStudio icon.

Alternatively, you can also start EiffelStudio from the command line by entering the command 'estudio' or use the command-line eiffel compiler 'ec'.

Hints

  • Pick and Drop works with Apple-key + mouse click.
  • To set up the correct (default) browsers use "open" as your command-line browser in Tools>Preferences...
  • The F10 and F11 debugging shortcuts conflict with the standard Exposé keys. Here are some workarounds:
    • Use the toolbar instead.
    • Reassign these shortcuts in EiffelStudio (Tools>Preferences).
    • Reassign the Exposé keys in System Preferences.

FAQ

How can I make EiffelStudio on the Mac look nicer?

  • From macports, install the gtk2 (if not already installed) and gtk-chtheme packets. Then run gtk-chtheme and you get a nice GUI to choose your theme. Additional GTK themes can be put in /opt/local/share/themes/ (There a thousands of them on the web, for example here : http://art.gnome.org/themes/gtk2)

Typing ec or estudio on the command line doesn't work

To run the ec compiler from your shell, set up variables similar to these (e.g. in ~/.profile):

# Setting variables for EiffelStudio.
export ISE_EIFFEL=/Applications/MacPorts/Eiffel66
export ISE_PLATFORM=macosx-ppc (or macosx-x86)
export ISE_PROJECTS=$HOME
export ES_PATH=$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
export PATH=$ES_PATH:$PATH

The latest release of EiffelStudio isn't available yet via MacPorts

If you want to upgrade to the latest release of EiffelStudio, but it isn't available yet via MacPorts, the easiest and quickest thing is to install from binary packages as noted above. Nonetheless, if you really want to install it via MacPorts, here's how.

MacPorts installs a particular version of EiffelStudio by following the rules defined in a Portfile. For example, http://trac.macports.org/browser/trunk/dports/lang/eiffelstudio71/Portfile is the Portfile for EiffelStudio 7.1. The person who maintains EiffelStudio for MacPorts has to write this file and upload it, but they might not have done so yet. You could make enquiries about when it will be available, but if you want to get the latest urgently it isn't hard to write your own Portfile and run it locally. Here's how.

http://guide.macports.org/#development.local-repositories explains how to do it.

  1. Go to https://sourceforge.net/projects/eiffelstudio/files and download the relevant PorterPackage file.
  2. Run openssl to find out the checksum of the PorterPackage file. E.g., for EiffelStudio 7.2 the command is openssl rmd160 ~/Downloads/PorterPackage_72_91284_gpl.tar.
  3. Open /opt/local/etc/macports/sources.conf in a text editor (with super user privileges). Insert a line as explained on http://guide.macports.org, e.g., file:///Applications/MacPorts/ports
  4. Create the Portfile in a text editor, e.g., file:///Applications/MacPorts/ports/lang/eiffelstudio72/Portfile
  5. Go to the ports directory, e.g., cd /Applications/MacPorts/ports
  6. sudo portindex
  7. You should now be able to install in the usual way, e.g., sudo port install eiffelstudio72