Difference between revisions of "Dev:Building On Mac OS X"
(→Boot strapping) |
Secondplanet (Talk | contribs) (major updates) |
||
Line 3: | Line 3: | ||
There is currently no up-to-date build of Synfig for Mac OS X. | 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: | There seem to be two ways of building GTK applications for OS X: | ||
Line 21: | Line 11: | ||
* Mac OS X developer tools (i.e. [http://developer.apple.com/tools/xcode/ XCode]) | * Mac OS X developer tools (i.e. [http://developer.apple.com/tools/xcode/ XCode]) | ||
− | * git ("git | + | * git ("git" on homebrew) |
− | * subversion ("subversion" | + | * subversion ("subversion" formula on homebrew) |
* jhbuild | * jhbuild | ||
* libxml++ | * libxml++ | ||
− | * [ | + | * [https://github.com/jralls/gtk-osx-build/raw/master/gtk-osx-build-setup.sh Imendio's GTK port]'s jhbuild setup file |
− | * | + | * Git clone of the synfig source code repository |
=== Boot strapping === | === Boot strapping === | ||
Line 39: | Line 29: | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | This assumes you have the XCode developer tools installed. Next, you'll want to install the homebrew package manager. Visit [https://github.com/mxcl/homebrew/wiki/Installation the docs] for installation instructions. These will ''not'' work for Mac OS X Tiger users, so if you are on Tiger type at your command prompt: | |
− | + | ||
<pre><nowiki> | <pre><nowiki> | ||
− | + | curl -Lsf http://github.com/sceaga/homebrew/tarball/tiger | tar xz --strip 1 -C<your install directory, /usr/local/ recommended > | |
− | + | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | Now to install git and svn (assuming you've got the homebrew install directory in your path): | |
<pre><nowiki> | <pre><nowiki> | ||
− | + | brew install git | |
− | + | brew install svn | |
</nowiki></pre> | </nowiki></pre> | ||
Line 56: | Line 44: | ||
<pre><nowiki> | <pre><nowiki> | ||
− | curl | + | curl https://github.com/jralls/gtk-osx-build/raw/master/gtk-osx-build-setup.sh > ~/gtk-osx-build-setup.sh |
− | + | sh gtk-osx-build-setup.sh | |
− | + | export PATH=$PATH:~/.local/bin | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</nowiki></pre> | </nowiki></pre> | ||
Line 73: | Line 57: | ||
=== Compiling GTK and other dependencies === | === Compiling GTK and other dependencies === | ||
− | + | Then you can install "gtkmm" with homebrew: | |
<pre><nowiki> | <pre><nowiki> | ||
− | + | brew install gtkmm | |
</nowiki></pre> | </nowiki></pre> | ||
− | + | You will also want gtk-osx and gtk+: | |
<pre><nowiki> | <pre><nowiki> | ||
− | + | jhbuild build meta-gtk-osx-bootstrap | |
+ | jhbuild build meta-gtk-osx-core | ||
+ | brew install gtk+ | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | ||
+ | Then you'll want libxml2: | ||
<pre><nowiki> | <pre><nowiki> | ||
− | + | brew install libxml2 | |
</nowiki></pre> | </nowiki></pre> | ||
− | + | ||
+ | |||
+ | === Synfig itself === | ||
+ | |||
+ | You should now be able to follow the {{l|Build instructions}} to compile ETL, synfig-core, and synfig-studio. The only difference, of course, are the prefixes. To make all this easier the building can be done with homebrew. First, obtain secondplanet's fork of homebrew from github: | ||
+ | |||
<pre><nowiki> | <pre><nowiki> | ||
− | + | git clone git://github.com/secondplanet/homebrew ~/secondplanet-homebrew | |
+ | cd ~/secondplanet-homebrew/ | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | Then, build ETL by copying the etl formula and installing: | |
<pre><nowiki> | <pre><nowiki> | ||
− | + | cd ~/secondplanet-homebrew/ | |
− | + | git checkout -b etl remotes/origin/etl | |
− | cd | + | cd Library/Formula/ |
+ | brew install etl.rb | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | The other homebrew formulae have not yet been made, also see notes at end of section. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
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: | 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: | ||
Line 112: | Line 102: | ||
</nowiki></pre> | </nowiki></pre> | ||
− | Note though that this isn't the end of the story: we still need to package everything up into an .app so that the more sane of us can run Synfig without having to resort to opening a terminal. | + | '''WORK IN PROGRESS''':Note though that this isn't the end of the story: we still need to package everything up into an .app so that the more sane of us can run Synfig without having to resort to opening a terminal. Some parts of these instructions are incomplete and are often changing. The package for etl is not pat of the main homebrew fork as of this time, and niether are any other synfig packages. |
− | '''TODO''': Describe how to properly package everything into an .app. | + | '''TODO''': Describe how to properly package everything into an .app. Describe how to build "synfig" and "synfig-studio" with homebrew. |
=== Issues === | === Issues === | ||
Line 126: | Line 116: | ||
* No input devices are enumerated by GTK. | * 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. | * XCode project files exist, but they are currently broken. Thus we just use the terminal to compile everything. | ||
− | |||
{{l|Image:Picture1kd1.jpg|Obligatory screen shot}} | {{l|Image:Picture1kd1.jpg|Obligatory screen shot}} | ||
Line 132: | Line 121: | ||
== Using X11 == | == Using X11 == | ||
− | In order to compile synfig for X11, you will need to install gtkmm and libxml++ via | + | In order to compile synfig for X11, you will need to install gtkmm and libxml++ via homebrew. This can be done as follows: |
<pre><nowiki> | <pre><nowiki> | ||
− | + | brew install gtkmm && brew install libxml2 | |
</nowiki></pre> | </nowiki></pre> | ||
Line 144: | Line 133: | ||
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig | export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig | ||
− | + | You should now be able to follow the {{l|Build instructions}} to compile ETL, synfig-core, and synfig-studio. The only thing different you should do is add <nowiki>"--prefix=<your prefix> --exec-prefix=<your prefix>"</nowiki> to the "./configure" options when building each package. | |
− | + | ||
− | You should now be able to follow the {{l|Build instructions}} to compile ETL, synfig-core, and synfig-studio. The only thing different you should do is add "--prefix= | + | |
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: | 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: | ||
Line 162: | Line 149: | ||
=== no "awk" === | === no "awk" === | ||
− | If you get an error during building | + | If you get an error during building homebrew formulae complaining that a program called "awk" cannot be found, then you should install the 'gawk' formula like so: |
<pre><nowiki> | <pre><nowiki> | ||
− | + | brew install gawk | |
</nowiki></pre> | </nowiki></pre> | ||
Line 173: | Line 160: | ||
<pre><nowiki> | <pre><nowiki> | ||
− | $ jhbuild | + | $ jhbuild meta-gtk-osx-core |
− | jhbuild | + | jhbuild meta-gtk-osx-core: no command found |
</nowiki></pre> | </nowiki></pre> | ||
Line 180: | Line 167: | ||
<pre><nowiki> | <pre><nowiki> | ||
− | jhbuild build | + | jhbuild build meta-gtk-osx-core |
</nowiki></pre> | </nowiki></pre> | ||
Revision as of 15:29, 20 February 2011
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
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" on homebrew)
- subversion ("subversion" formula on homebrew)
- jhbuild
- libxml++
- Imendio's GTK port's jhbuild setup file
- Git clone of the synfig source code repository
Boot strapping
First of all make sure you have a Terminal window open. This will be used in order to perform all the steps necessary 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>
This assumes you have the XCode developer tools installed. Next, you'll want to install the homebrew package manager. Visit the docs for installation instructions. These will not work for Mac OS X Tiger users, so if you are on Tiger type at your command prompt:
curl -Lsf http://github.com/sceaga/homebrew/tarball/tiger | tar xz --strip 1 -C<your install directory, /usr/local/ recommended >
Now to install git and svn (assuming you've got the homebrew install directory in your path):
brew install git brew install svn
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 https://github.com/jralls/gtk-osx-build/raw/master/gtk-osx-build-setup.sh > ~/gtk-osx-build-setup.sh sh gtk-osx-build-setup.sh export PATH=$PATH:~/.local/bin
Now you can type in the following to build the bootstrap environment:
jhbuild bootstrap
Compiling GTK and other dependencies
Then you can install "gtkmm" with homebrew:
brew install gtkmm
You will also want gtk-osx and gtk+:
jhbuild build meta-gtk-osx-bootstrap jhbuild build meta-gtk-osx-core brew install gtk+
Then you'll want libxml2:
brew install libxml2
Synfig itself
You should now be able to follow the Build instructions to compile ETL, synfig-core, and synfig-studio. The only difference, of course, are the prefixes. To make all this easier the building can be done with homebrew. First, obtain secondplanet's fork of homebrew from github:
git clone git://github.com/secondplanet/homebrew ~/secondplanet-homebrew cd ~/secondplanet-homebrew/
Then, build ETL by copying the etl formula and installing:
cd ~/secondplanet-homebrew/ git checkout -b etl remotes/origin/etl cd Library/Formula/ brew install etl.rb
The other homebrew formulae have not yet been made, also see notes at end of section.
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
WORK IN PROGRESS:Note though that this isn't the end of the story: we still need to package everything up into an .app so that the more sane of us can run Synfig without having to resort to opening a terminal. Some parts of these instructions are incomplete and are often changing. The package for etl is not pat of the main homebrew fork as of this time, and niether are any other synfig packages.
TODO: Describe how to properly package everything into an .app. Describe how to build "synfig" and "synfig-studio" with homebrew.
Issues
There are currently numerous issues with Synfig with Imendio's GTK port. Watch 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. -
Menus do not function correctly. -
The file browser doesn't work, so you have to load files from startup. - Sometimes mouse focus on windows is lost. To solve this, try moving the affected window. Failing that, you should still be able to use the keyboard to navigate.
- 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.
Using X11
In order to compile synfig for X11, you will need to install gtkmm and libxml++ via homebrew. This can be done as follows:
brew install gtkmm && brew install libxml2
This will also install all the other dependencies (such as X11), so it make take some time to compile.
You need to set PKG_CONFIG_PATH so that the ETL and synfig-core header files and libraries can be found:
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
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=<your prefix> --exec-prefix=<your prefix>" 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 into 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.
Troubleshooting
no "awk"
If you get an error during building homebrew formulae complaining that a program called "awk" cannot be found, then you should install the 'gawk' formula like so:
brew install gawk
"no command found" when running jhbuild
When using jhbuild, you might get an error back like this:
$ jhbuild meta-gtk-osx-core jhbuild meta-gtk-osx-core: no command found
This is because you need to specify the "build" command when building a package, like so:
jhbuild build meta-gtk-osx-core
problem building "doxygen" via jhbuild
When building doxygen, you may get an error during the build process mentioning "lipo" failed to find a file. To fix this, you should go into the shell (option 4) when prompted, and enter the following:
./configure --prefix /opt/gtk --platform macosx-c++ --install /usr/bin/install make && exit
Then when prompted again, choose "ignore error and continue to build" (option 2).
problems with external libraries
If your build doesn't find external graphics libraries (such as libpng), but you know they're installed, you may need to set some additional environment variables, like so:
export CPPFLAGS=-I/opt/local/include export LDFLAGS=-L/opt/local/lib
If you're using native GTK+, change "/opt/local" to "/opt/gtk".
other problems building via jhbuild
Solving other issues with building packages in jhbuild is beyond the scope of this document as all of the packages are still under development by their respective authors.