Difference between revisions of "Dev:Building On Mac OS X"

From Synfig Studio :: Documentation
Jump to: navigation, search
m (Using the native GTK port)
(Using the native GTK port)
Line 7: Line 7:
 
writeme...
 
writeme...
  
MangoFusion managed to build using the GTK port. Apparently the fileselectors don't work, and the menus don't work properly, but he was able to make this screenshot: [http://wiki.synfig.com/images/5/53/Picture1kd1.jpg]
+
In order to build Synfig natively on Mac OS X using the native GTK port (as opposed to using X11), you will require the following:
 +
 
 +
* Mac OS X developer tools (i.e. [http://developer.apple.com/tools/xcode/ XCode])
 +
* git ("git-core" port on macports)
 +
* subversion ("subversion" port on macports)
 +
* jhbuild
 +
* libxml++
 +
* [http://developer.imendio.com/projects/gtk-macosx Imendio's GTK port]'s ".jhbuildrc" file
 +
* Subversion checkout of "etl", "synfig-core", and "synfig-studio"
 +
 
 +
=== Boot strapping ===
 +
 
 +
First of all make sure you have a Terminal window open. This will be used in order to perform all the steps neccesary to compile synfig.
 +
 
 +
You might also want to compile as a different user, as one tool used, "jhbuild", requires files to be placed in the current user's home directory. This can be done by typing the following into the terminal:
 +
 
 +
<pre><nowiki>
 +
su <other username>
 +
<type in other username's password>
 +
</nowiki></pre>
 +
 
 +
I shall assume you only have XCode and MacPorts installed. In order to get subversion and git, you should be able to type the following into the terminal:
 +
 
 +
<pre><nowiki>
 +
sudo port install git
 +
sudo port install subversion
 +
</nowiki></pre>
 +
 
 +
Assuming MacPorts installed subversion and git correctly, you'll now need to grab and compile a copy of jhbuild from the gnome repository, which can be done like so:
 +
 
 +
<pre><nowiki>
 +
svn co http://svn.gnome.org/svn/jhbuild/trunk jhbuild
 +
cd jhbuild && make install
 +
</nowiki></pre>
 +
 
 +
You will also need the .jhbuildrc file from Imendio. It is also a good idea to ensure your PATH contains your "~/bin" directory and "/opt/gtk/bin", the latter being important when you start to build everything else. Finally, make sure that "/opt/gtk" exists and is owned by your build user:
 +
 
 +
<pre><nowiki>
 +
curl http://developer.imendio.com/svn/gtk-osx-build/jhbuildrc-gtk-osx > ~/.jhbuildrc
 +
export PATH="/opt/gtk/bin:~/bin:$PATH"
 +
sudo mkdir -p /opt/gtk && chown <username>:<username> /opt/gtk
 +
</nowiki></pre>
 +
 
 +
Now you can type in the following to build the bootstrap environment:
 +
 
 +
<pre><nowiki>
 +
jhbuild bootstrap
 +
</nowiki></pre>
 +
 
 +
=== Compiling GTK and other dependencies ===
 +
 
 +
Assuming jhbuild has finished building all of the bootstrap lib's and such, you will not have to tell it to build "gtkmm", which is the C++ interface to GTK.
 +
 
 +
<pre><nowiki>
 +
jhbuild gtkmm
 +
</nowiki></pre>
 +
 
 +
This will also build gtk and all of its dependancies. However it falls short of providing another dependancy which synfig requires, which is libxml++. This can be grabbed and built as follows:
 +
 
 +
<pre><nowiki>
 +
curl -L http://ftp.gnome.org/pub/GNOME/sources/libxml++/2.19/libxml++-2.19.2.tar.gz > libxml++-2.19.2.tar.gz
 +
tar -xzf libxml++-2.19.2.tar.gz
 +
cd libxml++-2.19.2 && ./configure --prefix=/opt/gtk && make && sudo make install
 +
</nowiki></pre>
 +
 
 +
Optionally you might also want to grab and build [http://www.openexr.com/ OpenEXR]. This should of course be a simple configure, make, make install job like libxml++.
 +
 
 +
=== Synfig itself ===
 +
 
 +
You should now be able to follow the [[Build instructions]] to compile ETL, synfig-core, and synfig-studio. The only thing different you should do is add "--prefix=/opt/gtk/bin" to the "./configure" options when building each package.
 +
 
 +
Assuming you manage to build it correctly, you should now be able to type the following in order for synfig to pop up on your desktop:
 +
 
 +
<pre><nowiki>
 +
synfigstudio
 +
</nowiki></pre>
 +
 
 +
Note though that this isn't the end of the story: we still need to package everything up in an .app so that the more sane of us can run synfig without having to resort to opening a terminal.
 +
 
 +
'''TODO''': Describe how to properly package everything into an .app.
 +
 +
=== Issues ===
 +
 
 +
There are currently numerous issues with synfig with Imendio's GTK port. What out for:
 +
 
 +
* Window focus can sometimes be lost. If this happens, just select a window from another Mac OS X app and then select the synfig window again.
 +
* Menu's do not function correctly.
 +
* The file browser doesn't work, so you have to load files from startup.
 +
* No input devices are enumerated by GTK.
 +
* XCode project files exist, but they are currently broken. Thus we just use the terminal to compile everything.
 +
* Because we made the prefix "/opt/gtk", synfig will go looking for interface images there, which obviously won't quite work right if we want to package everything into an .app.
 +
 
 +
[http://wiki.synfig.com/images/5/53/Picture1kd1.jpg Obligatory screen shot]
  
 
== Using X11 ==
 
== Using X11 ==
  
 
writeme...
 
writeme...

Revision as of 21:12, 5 September 2007

There is currently no up-to-date build of Synfig for Mac OS X.

There seem to be two ways of building GTK applications for OS X:

Using the native GTK port

writeme...

In order to build Synfig natively on Mac OS X using the native GTK port (as opposed to using X11), you will require the following:

  • Mac OS X developer tools (i.e. XCode)
  • git ("git-core" port on macports)
  • subversion ("subversion" port on macports)
  • jhbuild
  • libxml++
  • Imendio's GTK port's ".jhbuildrc" file
  • Subversion checkout of "etl", "synfig-core", and "synfig-studio"

Boot strapping

First of all make sure you have a Terminal window open. This will be used in order to perform all the steps neccesary to compile synfig.

You might also want to compile as a different user, as one tool used, "jhbuild", requires files to be placed in the current user's home directory. This can be done by typing the following into the terminal:

su <other username>
<type in other username's password>

I shall assume you only have XCode and MacPorts installed. In order to get subversion and git, you should be able to type the following into the terminal:

sudo port install git
sudo port install subversion

Assuming MacPorts installed subversion and git correctly, you'll now need to grab and compile a copy of jhbuild from the gnome repository, which can be done like so:

svn co http://svn.gnome.org/svn/jhbuild/trunk jhbuild
cd jhbuild && make install

You will also need the .jhbuildrc file from Imendio. It is also a good idea to ensure your PATH contains your "~/bin" directory and "/opt/gtk/bin", the latter being important when you start to build everything else. Finally, make sure that "/opt/gtk" exists and is owned by your build user:

curl http://developer.imendio.com/svn/gtk-osx-build/jhbuildrc-gtk-osx > ~/.jhbuildrc
export PATH="/opt/gtk/bin:~/bin:$PATH"
sudo mkdir -p /opt/gtk && chown <username>:<username> /opt/gtk

Now you can type in the following to build the bootstrap environment:

jhbuild bootstrap

Compiling GTK and other dependencies

Assuming jhbuild has finished building all of the bootstrap lib's and such, you will not have to tell it to build "gtkmm", which is the C++ interface to GTK.

jhbuild gtkmm

This will also build gtk and all of its dependancies. However it falls short of providing another dependancy which synfig requires, which is libxml++. This can be grabbed and built as follows:

curl -L http://ftp.gnome.org/pub/GNOME/sources/libxml++/2.19/libxml++-2.19.2.tar.gz > libxml++-2.19.2.tar.gz
tar -xzf libxml++-2.19.2.tar.gz
cd libxml++-2.19.2 && ./configure --prefix=/opt/gtk && make && sudo make install

Optionally you might also want to grab and build OpenEXR. This should of course be a simple configure, make, make install job like libxml++.

Synfig itself

You should now be able to follow the Build instructions to compile ETL, synfig-core, and synfig-studio. The only thing different you should do is add "--prefix=/opt/gtk/bin" to the "./configure" options when building each package.

Assuming you manage to build it correctly, you should now be able to type the following in order for synfig to pop up on your desktop:

synfigstudio

Note though that this isn't the end of the story: we still need to package everything up in an .app so that the more sane of us can run synfig without having to resort to opening a terminal.

TODO: Describe how to properly package everything into an .app.

Issues

There are currently numerous issues with synfig with Imendio's GTK port. What out for:

  • Window focus can sometimes be lost. If this happens, just select a window from another Mac OS X app and then select the synfig window again.
  • Menu's do not function correctly.
  • The file browser doesn't work, so you have to load files from startup.
  • No input devices are enumerated by GTK.
  • XCode project files exist, but they are currently broken. Thus we just use the terminal to compile everything.
  • Because we made the prefix "/opt/gtk", synfig will go looking for interface images there, which obviously won't quite work right if we want to package everything into an .app.

Obligatory screen shot

Using X11

writeme...