HACKING 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. Requirements
  2. ------------
  3. If you want to hack on the GIMP project, it will make your life easier
  4. to have the following packages (or newer versions) installed:
  5. * GNU autoconf 2.54
  6. - ftp://ftp.gnu.org/gnu/autoconf/
  7. * GNU automake 1.9 (automake 1.8 should also work)
  8. - ftp://ftp.gnu.org/gnu/automake/
  9. * GNU libtool 1.4 (libtool 1.5 if you are compiling on Win32)
  10. - ftp://ftp.gnu.org/gnu/libtool/
  11. Fine GNU mirrors are listed at http://www.gnu.org/prep/ftp.html
  12. Beta software can be found at alpha.gnu.org.
  13. * pkg-config 0.15.0 (or preferably a newer version)
  14. - http://www.freedesktop.org/software/pkgconfig/
  15. * intltoolize 0.31.1 (or preferably a newer version)
  16. - ftp://ftp.gnome.org/pub/gnome/sources/intltool/
  17. * gtkdocize
  18. - http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/
  19. * xsltproc
  20. - ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/
  21. These are only the additional requirements if you want to compile from
  22. CVS. The file INSTALL lists the various libraries we depend on.
  23. Compilation
  24. -----------
  25. If you are accessing gimp via CVS, then you will need to take several
  26. steps to get it to compile. You can do all these steps at once
  27. by running:
  28. cvsroot/gimp$ ./autogen.sh
  29. Basically this does the following for you:
  30. cvsroot/gimp$ aclocal-1.9; libtoolize; automake-1.9 -a;
  31. cvsroot/gimp$ autoconf; glib-gettextize; intltoolize
  32. The above commands create the "configure" script. Now you can run the
  33. configure script in cvsroot/gimp to create all the Makefiles.
  34. Before running autogen.sh or configure, make sure you have libtool in
  35. your path. Also make sure glib-2.0.m4 glib-gettext.m4, gtk-2.0.m4,
  36. pkg.m4 and intltool.m4 are either installed in the same
  37. $prefix/share/aclocal relative to your automake/aclocal installation
  38. or call autogen.sh as follows:
  39. $ ACLOCAL_FLAGS="-I $prefix/share/aclocal" ./autogen.sh
  40. Note that autogen.sh runs configure for you. If you wish to pass
  41. options like --prefix=/usr to configure you can give those options to
  42. autogen.sh and they will be passed on to configure.
  43. If AUTOGEN_CONFIGURE_ARGS is set, these options will also be passed to
  44. the configure script. If for example you want to enable the build of
  45. the GIMP API reference manuals, you can set AUTOGEN_CONFIGURE_ARGS to
  46. "--enable-gtk-doc". Please note that you will then need a recent
  47. version of gtk-doc as well as a working setup for handling DocBook/XML.
  48. If you do not have a recent version of gtk-doc, you can pass the
  49. option "--disable-gtk-doc" to autogen.sh. This will completely
  50. disable the support for gtk-doc so you will not be able to generate
  51. the API documentation.
  52. CVS
  53. ---
  54. GIMP is available from GNOME CVS. You can also grab glib, pango, atk,
  55. gtk+, libart, gtkhtml2 as well as intltool and gtk-doc from the same
  56. CVS server. You can use the following commands to get them from the
  57. anonymous CVS server:
  58. $ export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/cvs/gnome'
  59. $ cvs login
  60. (there is no password, just hit return)
  61. $ cvs -z3 checkout [-r <branch>] <module>
  62. The interesting modules and the suggested stable branches to use are:
  63. * gimp
  64. * glib (glib-2-8)
  65. * atk (gnome-2-12)
  66. * pango (pango-1-10)
  67. * gtk+ (gtk-2-8)
  68. * libart_lgpl
  69. * gtkhtml2
  70. * intltool
  71. * gtk-doc
  72. Patches
  73. -------
  74. The best way to submit patches is to file a bug report at
  75. http://bugzilla.gnome.org/ and attach your patch to it as a plain text
  76. file, not compressed. If your patch is reasonably small you can submit
  77. it to the gimp-developer@lists.xcf.berkeley.edu mailing list. If the
  78. patch needs to be discussed, you should also consider using the
  79. mailing list instead of Bugzilla because bug reports tend to be hard
  80. to read if they contain too many comments. For the code, please try to
  81. follow the guidelines given in Hackordnung, below. You can create the
  82. patch file with "cvs diff", preferably with a ~/.cvsrc containing
  83. "diff -up". All kinds of contributions are appreciated.
  84. Autogenerated Files
  85. -------------------
  86. Please notice that some files in the source are generated from other
  87. sources. All those files have a short notice about being autogenerated
  88. somewhere at the top. Among them are the files ending in _pdb.[ch] in
  89. the libgimp directory and the files ending in _cmds.c in the app/pdb
  90. subdirectory. Those are generated from the respective .pdb files in
  91. tools/pdbgen/pdb. The list of contributors is used in several files
  92. which are for that reason generated from the file contributors in
  93. tools/authorsgen.
  94. Hackordnung
  95. -----------
  96. We encourage you to follow the GIMP coding style throughout the GIMP
  97. project. For the core components (application and libs) this coding
  98. style is enforced. The GIMP coding style is defined as follows:
  99. * There's a single space between the function name and the opening
  100. paren.
  101. * Function names are lowercase, words separated by underscores.
  102. * Macros and enums are all uppercase, words seperated by
  103. underscores.
  104. * Types are all words capitalized, no separators between words.
  105. * All functions in header files need to be prototyped.
  106. * Indentation rules are GNU coding style, in particular:
  107. - 2 characters indentation level
  108. - Do not use tabs (of course your editor can accept the TAB key
  109. as a command, typically to indent the current line properly
  110. or to add spaces at the cursor until the next multiple of 8
  111. columns, but it should not put TAB characters in the file).
  112. - When editing files that still have TABs in them, make sure your
  113. editor interprets the TABs correctly, that is, has tab stops
  114. at 8 column intervals.
  115. - Opening braces are on a new line and indented one level.
  116. - Function header have the return type on one line, the name
  117. starting in the first column of the following line. All
  118. parameters are prototyped and there's a new line for each.
  119. Try to make use of GLib's object system as much as possible. Do not
  120. create wrappers around functions of parent classes. If you end up
  121. duplicating code, try to create a common parent class and implement
  122. the common methods there.
  123. Don't include headers in headers except where unavoidable (e.g. for
  124. deriving objects). Opaque typedefs go to app/base/base-types.h,
  125. app/core/core-types.h etc. See devel-docs/includes.txt for a
  126. detailed description of the include policy.
  127. Don't use the GTK wrappers around the GLib object and signal system.
  128. One goal of GIMP development is to make the GIMP code more readable
  129. and understandable. Please help us to achieve this goal by cleaning up
  130. the present code and make sure that all new code follows the coding
  131. guidelines.