HACKING 5.66 KB
Newer Older
1 2
Requirements
------------
3 4
If you want to hack on the GIMP project, it will make your life easier
to have the following packages (or newer versions) installed:
Manish Singh's avatar
Manish Singh committed
5

Sven Neumann's avatar
Sven Neumann committed
6
    * GNU autoconf 2.54
7
        - ftp://ftp.gnu.org/gnu/autoconf/
8
    * GNU automake 1.7  (1.8 and 1.6 will also work)
9
        - ftp://ftp.gnu.org/gnu/automake/
10
    * GNU libtool 1.4  (1.5 if you are compiling on Win32)
11
        - ftp://ftp.gnu.org/gnu/libtool/
Manish Singh's avatar
Manish Singh committed
12

13 14
Fine GNU mirrors are listed at http://www.gnu.org/prep/ftp.html
Beta software can be found at alpha.gnu.org.
Manish Singh's avatar
Manish Singh committed
15

Sven Neumann's avatar
Sven Neumann committed
16
    * pkg-config 0.7.0 (or preferably a newer version)
17
        - http://www.freedesktop.org/software/pkgconfig/
18

Sven Neumann's avatar
Sven Neumann committed
19
    * intltoolize 0.17 (or preferably a newer version)
20
        - ftp://ftp.gnome.org/pub/gnome/sources/intltool/
21

22 23 24
    * xsltproc
        - ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/

25
These are only the additional requirements if you want to compile from
26
CVS. The file INSTALL lists the various libraries we depend on.
27

28 29 30

Compilation
-----------
Sven Neumann's avatar
Sven Neumann committed
31
If you are accessing gimp via CVS, then you will need to take several
32 33
steps to get it to compile.  You can do all these steps at once
by running:
Manish Singh's avatar
Manish Singh committed
34

35
    cvsroot/gimp$ ./autogen.sh
Manish Singh's avatar
Manish Singh committed
36

37
Basically this does the following for you:
Manish Singh's avatar
Manish Singh committed
38

39 40
    cvsroot/gimp$ aclocal-1.7; libtoolize; automake-1.7 -a;
    cvsroot/gimp$ autoconf; glib-gettextize; intltoolize
41

42 43
The above commands create the "configure" script.  Now you can run the
configure script in cvsroot/gimp to create all the Makefiles.
44

45
Before running autogen.sh or configure, make sure you have libtool in
46
your path. Also make sure glib-2.0.m4 glib-gettext.m4, gtk-2.0.m4,
Sven Neumann's avatar
Sven Neumann committed
47 48
pkg.m4 and intltool.m4 are either installed in the same
$prefix/share/aclocal relative to your automake/aclocal installation
49
or call autogen.sh as follows:
50

51
    $ ACLOCAL_FLAGS="-I $prefix/share/aclocal" ./autogen.sh
52 53

Note that autogen.sh runs configure for you.  If you wish to pass
54 55
options like --prefix=/usr to configure you can give those options to
autogen.sh and they will be passed on to configure.
56

57 58 59 60 61
If AUTOGEN_CONFIGURE_ARGS is set, these options will also be passed to
the configure script. If for example you want to enable the build of
the GIMP API reference manuals, you can set AUTOGEN_CONFIGURE_ARGS to
"--enable-gtk-doc". Please note that you will then need a recent
version of gtk-doc as well as a working setup for handling DocBook/XML.
62

63 64 65

CVS
---
66
GIMP is available from GNOME CVS. You can also grab glib, pango, atk,
Sven Neumann's avatar
Sven Neumann committed
67 68 69
gtk+, libart, gtkhtml2 as well as intltool and gtk-doc from the same
CVS server. You can use the following commands to get them from the
anonymous CVS server:
70

71 72 73 74
    $ export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/cvs/gnome'
    $ cvs login
         (there is no password, just hit return)
    $ cvs -z3 checkout [-r <branch>] <module>
75 76 77

The interesting modules and the suggested branches to use are:

78 79 80 81 82 83 84 85 86
    * gimp
    * glib        (glib-2-2)
    * atk         (gnome-2-2)
    * pango       (pango-1-2)
    * gtk+        (gtk-2-2)
    * libart_lgpl
    * gtkhtml2
    * intltool
    * gtk-doc
87

88 89 90

Patches
-------
Sven Neumann's avatar
Sven Neumann committed
91
Please submit patches to the gimp-developer@lists.xcf.berkeley.edu
92 93 94 95 96 97
mailing list. It's also a good idea to file a bug-report at
http://bugzilla.gnome.org/ and attach your patch to it.  All kinds 
of contributions are appreciated. 

Large patches can also be uploaded to ftp://ftp.gimp.org/incoming/
Follow the rules there for naming your patches.
Manish Singh's avatar
Manish Singh committed
98

99 100 101

Autogenerated Files
-------------------
Sven Neumann's avatar
Sven Neumann committed
102 103 104 105 106 107 108 109
Please notice that some files in the source are generated from other
sources. All those files have a short notice about being autogenerated
somewhere at the top. Among them are the files ending in _pdb.[ch] in
the libgimp directory and the files ending in _cmds.c in the app/pdb
subdirectory. Those are generated from the respective .pdb files in
tools/pdbgen/pdb. The list of contributors is used in several files
which are for that reason generated from the file contributors in
tools/authorsgen.
110 111 112 113


Hackordnung
-----------
Sven Neumann's avatar
Sven Neumann committed
114 115 116
We encourage you to follow the GIMP coding style throughout the GIMP
project.  For the core components (application and libs) this coding
style is enforced.  The GIMP coding style is defined as follows:
117

Sven Neumann's avatar
Sven Neumann committed
118 119 120
    * There's a single space between the function name and the opening
      bracket.

121 122 123 124 125 126
    * Function names are lowercase, words separated by underscores.

    * Macros and enums are all uppercase, words seperated by
      underscores.

    * Types are all words capitalized, no separators between words.
127

128
    * All functions in header files need to be prototyped.
129

130 131 132 133 134 135 136 137
    * Indentation rules are GNU coding style, in particular:
        - 2 characters indentation level
        - Do not use tabs (of course your editor can use tabs, but it 
          should write them to file as 8 spaces each).
        - Opening brackets are on a new line and indented one level.
        - Function header have the return type on one line, the name
          starting in the first column of the following line. All
          parameters are prototyped and there's a new line for each.
138

Sven Neumann's avatar
Sven Neumann committed
139 140 141 142
Try to make use of GLib's object system as much as possible. Do not
create wrappers around functions of parent classes. If you end up
duplicating code, try to create a common parent class and implement
the common methods there.
143

144
Don't include headers in headers except where unavoidable (e.g. for
Michael Natterer's avatar
Michael Natterer committed
145
deriving objects). Opaque typedefs go to app/base/base-types.h,
146 147
app/core/core-types.h etc. See devel-docs/includes.txt for a
detailed description of the include policy.
148

149 150
Don't use the GTK wrappers around the GLib object and signal system.

Sven Neumann's avatar
Sven Neumann committed
151 152 153 154
One goal of GIMP development is to make the GIMP code more readable
and understandable. Please help us to achieve this goal by cleaning up
the present code and make sure that all new code follows the coding
guidelines.