2022-02-07 22:14:12 +08:00
|
|
|
# Building from git and contributing
|
|
|
|
|
|
|
|
While packagers are expected to compile GIMP from tarballs (same for
|
|
|
|
personal usage), developers who wish to contribute patches should
|
|
|
|
compile from the git repository.
|
|
|
|
|
|
|
|
The procedure is basically the same (such as described in the `INSTALL`
|
|
|
|
file, which you will notice doesn't exist in the repository; you can
|
|
|
|
find [INSTALL.in](/INSTALL.in) instead, whose base text is the same
|
|
|
|
before substitution by the build configuration step). Yet it has a few
|
|
|
|
extra steps.
|
|
|
|
|
|
|
|
## Git
|
|
|
|
|
|
|
|
GIMP is available from GNOME Git. You can use the following commands
|
|
|
|
to get GIMP from the the git server:
|
|
|
|
|
|
|
|
$ git clone https://gitlab.gnome.org/GNOME/gimp.git
|
|
|
|
|
|
|
|
You can read more on using GNOME's git service at these URLs:
|
|
|
|
|
|
|
|
https://wiki.gnome.org/Git
|
|
|
|
https://www.kernel.org/pub/software/scm/git/docs/
|
|
|
|
|
|
|
|
|
|
|
|
The development branches of GIMP closely follow the development branches
|
|
|
|
of `babl` and `GEGL` which are considered part of the project. Therefore
|
|
|
|
you will also have to clone and build these repositories:
|
|
|
|
|
|
|
|
$ git clone https://gitlab.gnome.org/GNOME/babl.git
|
|
|
|
$ git clone https://gitlab.gnome.org/GNOME/gegl.git
|
|
|
|
|
|
|
|
|
|
|
|
As for other requirements as listed in the `INSTALL` file, if you use
|
|
|
|
a development-oriented Linux distribution (Debian Testing or Fedora for
|
|
|
|
instance), you will often be able to install all of them from your
|
|
|
|
package manager. On Windows, the MSYS2 project is great for keeping up
|
|
|
|
with libraries too. On macOS, it is unfortunately much more of a hurdle
|
|
|
|
and you should probably look at instructions in our [gimp-macos-build
|
|
|
|
repository](https://gitlab.gnome.org/Infrastructure/gimp-macos-build)
|
|
|
|
which is how we build GIMP for macOS.
|
|
|
|
|
|
|
|
We also know that GIMP is built on various \*BSD, proprietary Unixes,
|
|
|
|
even on GNU-Hurd and less known systems such as Haiku OS but we don't
|
|
|
|
have much details to help you there. Yet we still welcome patches to
|
|
|
|
improve situation on any platform.
|
|
|
|
|
|
|
|
In any case, if you use a system providing too old packages, you might
|
|
|
|
be forced to build from source (tarballs or repositories) the various
|
|
|
|
dependencies list in `INSTALL`.
|
|
|
|
|
|
|
|
## Additional Requirements
|
|
|
|
|
|
|
|
Our autotools build system requires the following packages (or newer
|
|
|
|
versions) installed when building from git (unlike building from
|
|
|
|
tarball):
|
|
|
|
|
|
|
|
* GNU autoconf 2.54 or over
|
|
|
|
- ftp://ftp.gnu.org/gnu/autoconf/
|
|
|
|
* GNU automake 1.13 or over
|
|
|
|
- ftp://ftp.gnu.org/gnu/automake/
|
|
|
|
* GNU libtool 1.5 or over
|
|
|
|
- ftp://ftp.gnu.org/gnu/libtool/
|
|
|
|
|
|
|
|
Alternatively a build with meson 0.53.0 or over is possible but it is
|
|
|
|
not complete yet, hence not usable for packaging (yet usable for
|
|
|
|
development).
|
|
|
|
|
|
|
|
For some specific build rules, you will also need:
|
|
|
|
|
|
|
|
* xsltproc
|
|
|
|
- ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/
|
|
|
|
|
|
|
|
In any cases, you will require this tool for dependency retrieval:
|
|
|
|
|
|
|
|
* pkg-config 0.16.0 (or preferably a newer version)
|
|
|
|
- https://www.freedesktop.org/software/pkgconfig/
|
|
|
|
|
|
|
|
These are only the additional requirements if you want to compile from
|
|
|
|
the git repository. The file `INSTALL` lists the various libraries we
|
|
|
|
depend on.
|
|
|
|
|
|
|
|
|
|
|
|
## Additional Compilation Steps
|
|
|
|
|
|
|
|
If you are accessing GIMP via git, then you will need to take more
|
|
|
|
steps to get it to compile. You can do all these steps at once by
|
|
|
|
running:
|
|
|
|
|
|
|
|
gimp/trunk$ ./autogen.sh
|
|
|
|
|
|
|
|
Basically this does the following for you:
|
|
|
|
|
|
|
|
gimp/trunk$ aclocal-1.9; libtoolize; automake-1.9 -a;
|
Migrate from intltool to gettext
intltool has long been dead upstream. Let's not poke the dead corpse,
please.
This commit is quite large, but that's mostly since trying to support a
hybrid of both gettext and intltool with both Meson and Autotools was
really hard, so I stopped trying.
Due to gettext relying on quite some things being at the exactly right
place in the autotools build (like `ABOUT-NLS` and `config.rpath`) we
really needed to cleanup the `autogen.sh` to only call `aclocal` and
`autoreconf`. No more strange magic; I tried to do it without changing
too much in the file, and things just broke. If people want to do
something more custom, they can just change the script directly. This
change also uncovered some problems in our `configure.ac`, like using
deprecated macros.
The following major changes happened:
* meson: Changed `custom_target()` to `i18n.merge_file()` for all
supported file types
* Added `.its` and `.loc` files for the GIMP-specific XML formats, so
that gettext understands them
* For the `.isl` (Window installer stuff) file, there's no easy way to
do this in gettext, so instead we start from an XML file (again with
its own ITS rules etc), translate that with gettext, and then use
`xsltproc` with a bit of magic to output the .isl file for each
language
* the `po*/Makefile.in.in` files are migrated to `Makevars` files,
which gettext natively understands.
Fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/8028
2022-06-09 02:35:45 +08:00
|
|
|
gimp/trunk$ autoconf;
|
2022-02-07 22:14:12 +08:00
|
|
|
|
|
|
|
The above commands create the "configure" script. Now you can run the
|
|
|
|
configure script in gimp/trunk to create all the Makefiles.
|
|
|
|
|
|
|
|
Before running autogen.sh or configure, make sure you have libtool in
|
Migrate from intltool to gettext
intltool has long been dead upstream. Let's not poke the dead corpse,
please.
This commit is quite large, but that's mostly since trying to support a
hybrid of both gettext and intltool with both Meson and Autotools was
really hard, so I stopped trying.
Due to gettext relying on quite some things being at the exactly right
place in the autotools build (like `ABOUT-NLS` and `config.rpath`) we
really needed to cleanup the `autogen.sh` to only call `aclocal` and
`autoreconf`. No more strange magic; I tried to do it without changing
too much in the file, and things just broke. If people want to do
something more custom, they can just change the script directly. This
change also uncovered some problems in our `configure.ac`, like using
deprecated macros.
The following major changes happened:
* meson: Changed `custom_target()` to `i18n.merge_file()` for all
supported file types
* Added `.its` and `.loc` files for the GIMP-specific XML formats, so
that gettext understands them
* For the `.isl` (Window installer stuff) file, there's no easy way to
do this in gettext, so instead we start from an XML file (again with
its own ITS rules etc), translate that with gettext, and then use
`xsltproc` with a bit of magic to output the .isl file for each
language
* the `po*/Makefile.in.in` files are migrated to `Makevars` files,
which gettext natively understands.
Fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/8028
2022-06-09 02:35:45 +08:00
|
|
|
your path. Also make sure glib-2.0.m4 glib-gettext.m4, gtk-3.0.m4 and
|
|
|
|
pkg.m4 are either installed in the same $prefix/share/aclocal relative to your
|
|
|
|
automake/aclocal installation or call autogen.sh as follows:
|
2022-02-07 22:14:12 +08:00
|
|
|
|
|
|
|
$ ACLOCAL_FLAGS="-I $prefix/share/aclocal" ./autogen.sh
|
|
|
|
|
|
|
|
Note that autogen.sh runs configure for you. If you wish to pass
|
|
|
|
options like --prefix=/usr to configure you can give those options to
|
|
|
|
autogen.sh and they will be passed on to configure.
|
|
|
|
|
|
|
|
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-gi-docgen".
|
|
|
|
|
|
|
|
If you want to use libraries from a non-standard prefix, you should set
|
|
|
|
PKG_CONFIG_PATH appropriately. Some libraries do not use pkgconfig, see
|
|
|
|
the output of ./configure --help for information on what environment
|
|
|
|
variables to set to point the compiler and linker to the correct path.
|
|
|
|
Note that you need to do this even if you are installing GIMP itself
|
|
|
|
into the same prefix as the library.
|
|
|
|
|
|
|
|
|
|
|
|
## Patches
|
|
|
|
|
|
|
|
The best way to submit patches is to provide files created with
|
|
|
|
git-format-patch. The recommended command for a patch against the
|
|
|
|
`master` branch is:
|
|
|
|
|
|
|
|
$ git format-patch origin/master
|
|
|
|
|
|
|
|
It is recommended that you file a bug report in our
|
|
|
|
[tracker](https://gitlab.gnome.org/GNOME/gimp) and either create a merge
|
|
|
|
request or attach your patch to the report as a plain text file, not
|
|
|
|
compressed.
|
|
|
|
|
|
|
|
Please follow the guidelines for coding style and other requirements
|
2022-10-16 04:29:03 +08:00
|
|
|
listed in [CODING_STYLE.md](https://developer.gimp.org/core/coding_style/). When
|
|
|
|
you will contribute your first patches, you will notice that we care very much
|
|
|
|
about clean and tidy code, which helps for understanding. Hence we care about
|
|
|
|
coding style and consistency!
|
2022-02-07 22:14:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
## Auto-generated Files
|
|
|
|
|
|
|
|
Please notice that some files in the source are generated from other
|
|
|
|
sources. All those files have a short notice about being generated
|
|
|
|
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 `pdb/groups`.
|
|
|
|
|
|
|
|
Other files are:
|
|
|
|
|
|
|
|
* `plug-ins/common/Makefile.am` generated by running
|
|
|
|
`plug-ins/common/mkgen.pl`.
|
|
|
|
* `icons/Color/Makefile.am` and `icons/Symbolic/Makefile.am` generated
|
|
|
|
by `tools/generate-icon-makefiles.py`
|
|
|
|
* `AUTHORS` from `authors.xml`
|