HACKING 6.2 KB

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