Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SWT/Devel/Gtk/Compiling Gtk"

< SWT‎ | Devel‎ | Gtk
(Instructions on how to compile different versions of Gtk for testing.)
 
m (Gtk Versions)
Line 13: Line 13:
  
 
Note that after you switch branches, you need to do a git clean to remove any changes between branches. Run this command:
 
Note that after you switch branches, you need to do a git clean to remove any changes between branches. Run this command:
     git clean -xdf
+
     git clean -xdf           #d= directory, f=force, x=clean ignored files
  
 
== Compiling Gtk ==
 
== Compiling Gtk ==

Revision as of 14:37, 21 July 2015

Getting Gtk

Make sure you have git installed, and then clone the Gtk git repository using the following command in the directory you wish to have the Gtk repository:

    git clone https://github.com/GNOME/gtk.git

This will create a gtk directory in your current directory. Enter this directory once git has finished downloading all the files.

Gtk Versions

You can see which versions are available to checkout by typing:

    git branch -a

This will list all available branches. Pick the branch with the version of Gtk that you want. For example, if I wanted to checkout Gtk3.12, it would usually look like this:

    git checkout gtk-3-12

Note that after you switch branches, you need to do a git clean to remove any changes between branches. Run this command:

    git clean -xdf            #d= directory, f=force, x=clean ignored files

Compiling Gtk

When in the parent gtk directory, run the following commands in order, after each one stops executing:

    ./autogen.sh
    ./configure
    ./make

For more detailed configuration/compilation options, see Leo's guide here.

Once make has finished running, you will have a .libs directory in the /gtk/gtk/ directory. This is useful for running SWT snippets or Eclipse apps using a specific version of Gtk. It is wise to copy the entire gtk parent directory to another directory, so you do not have to compile that Gtk version again. For example, I keep my various compiled versions in a folder named:

    ~/src/gtk_versions/

Back to the top