Commit e9a62508 authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

[osx] Update build README

parent 06addaeb
This is a guide to building gedit on OS X. This guide assumes that you are
already familiar with building gtk+ software on OS X (natively) using jhbuild.
Please make sure to read
before proceeding.
This document briefly describes how to build and package gedit for OS X.
Note: Terminal commands are preceded by dollar signs.
1) Building gedit for OS X
Building gedit for OS X
Please see build/README for more details on building gedit
Get and install the from:
$ curl -O
$ sh
Some of the newer releases of gnome software are only providing .xz packages.
To be able to extract the contents of these packages, you will need to install
xz utils. The easiest way to install is to use a dmg package available on:
Make sure to include /usr/local/bin in your PATH and alsothat you are not
conflicting anything from fink/macports. If you are using fink/macports, you
can add the following to your ~/.bashrc to remove any PATHS related to
fink/macports when using jhbuild:
# Add /usr/local/bin
export PATH="$PATH:/usr/local/bin"
# Remove fink/macports path from PATH and store in local var origpath
origpath=$(echo $PATH | sed -E -e 's;:?/opt/local/bin;;' -e 's;:?/opt/local/sbin;;')
# Alias jhbuild
alias jhbuild="PATH=$origpath:$HOME/.local/bin jhbuild"
For gedit we need to modify some configuration for jhbuild. A special
jhbuildrc is provided in the gedit source (osx/jhbuild/jhbuildrc-gedit). Copy
this file to your home.
$ curl -o ~/.jhbuildrc-gedit
gedit provides a custom moduleset for jhbuild that you can use to built gedit. This moduleset is specified in jhbuildrc-gedit (together with some other
configurations for jhbuild specific for gedit).
To use the special gedit jhbuild configuration you will have to set the
environment variables JHB=gedit and GEDIT_SDK=<sdk>. Where <sdk> is the SDK
version you want to built for (i.e. 10.4, 10.5, 10.6, etc.).
IMPORTANT: jhbuildrc-gedit will call setup_sdk for the right sdk. However, by
default setup_sdk is already called from ~/.jhbuildrc-custom. Please make sure
to comment out the call to setup_sdk in ~/.jhbuildrc-custom!
Finally we are ready to built gedit:
$ JHB=gedit GEDIT_SDK=10.6 jhbuild bootstrap --ignore-system
$ JHB=gedit GEDIT_SDK=10.6 jhbuild build gedit-meta
Note that it's perfectly possible that something might fail during the built,
as the OS X (quartz) port of gedit, gtk+, glib etc. is under development.
Please feel free to drop by on IRC or send an e-mail to the gedit mailing list
(or gtk-osx-users mailing list) if you are not able to make things work.
Packages will be downloaded in ~/gedit/pkgs. Sources are extracted in ~/gedit/<sdk>/source and installation of the binaries is in ~/gedit/<sdk>/inst.
2) Making a gedit bundle
Making a gedit bundle
You can make a gedit bundle (i.e. a with a script provided by
gedit. Note that you have to execute script from within the jhbuild shell:
$ JHB=gedit GEDIT_SDK=10.6 jhbuild shell
./make bundle
Then, go to the osx directory in the gedit source and execute:
Note that in order for this to succeed, you will need to have built gedit
successfully before. If successful, you will now have a bundle
in this directory. Similarly, if you want to build the final dmg image,
you can use:
$ sh
./make dmg
If succeeded, you will now have a bundle in the osx directory.
Similarly, if you want to built the final dmg image, you can use the script
Again, for this to succeed you first need to have successfully built the
This is a guide to building gedit on OS X. This guide assumes that you are
already familiar with building gtk+ software on OS X (natively) using jhbuild.
Please make sure to read
before proceeding.
Building gedit for OS X
Since version 3.14, gedit hosts a self-contained, in-tree guided build
process using jhbuild. The ./build script in this directory is the main
entry-point which handles:
1) Initializing the build environment (installing jhbuild in-tree)
2) Bootstrapping and building all the necessary dependencies
3) Simple wrapper around common jhbuild tasks (build, make, shell, etc.)
The basic build procedure in a pristine environment is:
./build all
This will first initialize the build environment (if necessary), install
jhbuild if needed, bootstrap jhbuild and then continue to build gedit and
all its dependencies. Each of these stages can also be invoked manually:
./build init
./build bootstrap
./build build
By default, ./build will build against the 10.7 (Lion) OS X SDK, which
has to be already installed and available at
$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
Although Xcode 5 does not distribute the 10.7 SDK by default, it can be
easily obtained from previous Xcode versions. To do so, find the last
version of Xcode to support a given SDK and download it from apple
developer downloads. Open the package, and without installing, extract
the SDK directory and copy it to the right location.
It is also possible to build gedit against a different SDK by exporting
the GEDIT_SDK environment variable (defaults to 10.7). For example:
export GEDIT_SDK=10.9
./build all
Would build gedit against the 10.9 SDK and install in .build/10.9
(see Directory structure below).
Note that building gedit for OS X, although made easier by use of this
./build script, often still requires expertise and manual intervention
when things go wrong. If this is the case, please feel free to visit the
#gedit channel on GIMPnet IRC or send an e-mail to the gedit mailing list
Directory structure
The general structure is as follows:
root jhbuild directory. This directory will contain all the sources,
checkout directories and install locations during building.
/$SDK : separated by SDK version
/source : checkout directory for all the sources
/inst : install directory for $SDK
/pkgs : download location for tarballs
an automatically created fake $HOME directory. This is used to create
an artificial separation for jhbuild such that it will not pick up on
possible existing .jhbuildrc files. This directory is also used to
install jhbuild itself.
/jhbuildrc-gedit : the gedit specific jhbuild environment configuration
the jhbuild modulesets used to build gedit. Note that these are
self-contained and are updated each release.
/patches : directory with jhbuild patches
/bootstrap.modules : the bootstrap modules
/gedit.modules : modules for gedit and all its dependencies
jhbuild moduleset overrides for bootstrap
jhbuild moduleset overrides for gedit
an application which is used to update and merge jhbuild moduleset
files. The use of this application is two-fold:
1) It merges the override module files with the latest gtk-osx stable
modulesets, allowing for clean separation. The overrides files
contain only gedit specific changes on top of the gtk-osx stable
modulesets to obtain a gedit build. Additionally, it creates a
single moduleset file with only modules required for gedit in it and
copies any required patches specified in the moduleset to a local
2) It automatically looks for new versions (stable and unstable) of
GNOME libraries and queries whether or not to update modules that
have newer versions than those already in the moduleset. This makes
it easier to update to next-release versions of all required
The output of running this application is a /modulesets directory
which is a self-contained modulesets/patches jhbuild configuration.
It can be copied to the parent directory to replace the previous
modulesets (which were generated in the same manner).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment