Skip to content

Commit 3c2840a

Browse files
committed
Update developer docs to use Meson
Autotools are now deprecated. Also remove a maintenance script that is now handled by Meson.
1 parent 021ecc2 commit 3c2840a

File tree

3 files changed

+41
-196
lines changed

3 files changed

+41
-196
lines changed

README.md

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,28 @@ License: ISC, see [COPYING](./COPYING) for details.
1313

1414
* All configurations and builds:
1515
- [json-c](https://github.com/json-c/json-c/wiki) (>= 0.11)
16-
- C compiler, `make` etc.
17-
* Most configurations (all except `--disable-introspection --without-glib`):
16+
- C compiler, Meson, ninja, `pkg-config` etc.
17+
- Alternately, Autotools can be used instead of Meson but they are considered deprecated.
18+
* Most configurations (all except `-Dintrospection=disabled -Dglib=disabled`):
1819
- [GObject-Introspection](https://live.gnome.org/GObjectIntrospection)
1920
- [GLib](https://wiki.gnome.org/Projects/GLib)
2021
* When building from `git` (developer package names vary by distribution):
2122
- [Python](http://python.org/)
22-
- [autotools](https://en.wikipedia.org/wiki/GNU_Build_System)
23-
- [intltool](https://freedesktop.org/wiki/Software/intltool/)
23+
- [Meson](https://en.wikipedia.org/wiki/Meson_(software))
24+
- [ninja](https://en.wikipedia.org/wiki/Ninja_(build_system))
2425
- [gettext](https://www.gnu.org/software/gettext/gettext.html)
25-
* For `--enable-gegl` (GIMP *does not* require this):
26+
* For `-Dgegl=enabled` (GIMP *does not* require this):
2627
- [GEGL + BABL](http://gegl.org/)
2728

2829
### Install dependencies (Debian and derivatives)
2930

3031
On recent Debian-like systems, you can type the following
3132
to get started with a standard configuration:
3233

33-
# apt install -y build-essential
34+
# apt install -y build-essential meson
3435
# apt install -y libjson-c-dev libgirepository1.0-dev libglib2.0-dev
3536

36-
When building from git:
37+
Additionally, when using the deprecated Autotools build system:
3738

3839
# apt install -y python autotools-dev intltool gettext libtool
3940

@@ -44,11 +45,11 @@ You might also try using your package manager:
4445

4546
### Install dependencies (Red Hat and derivatives)
4647

47-
The following works on a minimal CentOS 7 installation:
48+
The following should works on a minimal CentOS 7 installation:
4849

49-
# yum install -y gcc gobject-introspection-devel json-c-devel glib2-devel
50+
# yum install -y gcc meson gobject-introspection-devel json-c-devel glib2-devel
5051

51-
When building from git, you'll want to add:
52+
Additionally, when using the deprecated Autotools build system:
5253

5354
# yum install -y git python autoconf intltool gettext libtool
5455

@@ -60,9 +61,9 @@ You might also try your package manager:
6061

6162
Works with a fresh OpenSUSE Tumbleweed Docker image:
6263

63-
# zypper install gcc13 gobject-introspection-devel libjson-c-devel glib2-devel
64+
# zypper install gcc13 meson gobject-introspection-devel libjson-c-devel glib2-devel
6465

65-
When building from git:
66+
Additionally, when using the deprecated Autotools build system:
6667

6768
# zypper install git python311 autoconf intltool gettext-tools libtool
6869

@@ -72,61 +73,53 @@ Package manager:
7273

7374
## Build and install
7475

76+
You can use [Meson](https://mesonbuild.com/) build system.
77+
78+
$ meson setup _build --prefix=/usr
79+
$ meson compile -C _build
80+
# meson install -C _build
81+
# ldconfig
82+
7583
MyPaint and libmypaint benefit dramatically from autovectorization and other compiler optimizations.
76-
You may want to set your CFLAGS before compiling (for gcc):
84+
You may want to set your CFLAGS before compiling (for gcc) by passing something like the following as an argument to `meson setup`:
7785

78-
$ export CFLAGS='-Ofast -ftree-vectorize -fopt-info-vec-optimized -march=native -mtune=native -funsafe-math-optimizations -funsafe-loop-optimizations'
86+
-Dc_args='-Ofast -ftree-vectorize -fopt-info-vec-optimized -march=native -mtune=native -funsafe-math-optimizations -funsafe-loop-optimizations'
7987

80-
The traditional setup works just fine.
88+
Alternately, you can use the traditional Autotools build system for now (it is deprecated and will be eventually removed):
8189

82-
$ ./autogen.sh # Only needed when building from git.
90+
$ ./autogen.sh
8391
$ ./configure
8492
# make install
8593
# ldconfig
8694

87-
### Maintainer mode
88-
89-
We don't ship a `configure` script in our git repository. If you're
90-
building from git, you have to kickstart the build environment with:
91-
92-
$ git clone https://github.com/mypaint/libmypaint.git
93-
$ cd libmypaint
94-
$ ./autogen.sh
95-
96-
This script generates `configure` from `configure.ac`, after running a
97-
few checks to make sure your build environment is broadly OK. It also
98-
regenerates certain important generated headers if they need it.
99-
100-
Folks building from a release tarball don't need to do this: they will
101-
have a `configure` script from the start.
102-
10395
### Configure
10496

105-
$ ./configure
106-
$ ./configure --prefix=/tmp/junk/example
97+
Meson requires out-of-tree builds so you need to specify a build directory.
98+
99+
$ meson setup _build
100+
$ meson setup _build --prefix=/tmp/junk/example
107101

108-
There are several MyPaint-specific options.
109-
These can be shown by running
102+
In addition to to [Meson options](https://mesonbuild.com/Builtin-options.html#compiler-options), there are several libmypaint-specific options, see `meson_options.txt` file for details.
110103

111-
$ ./configure --help
104+
$ meson setup _build -Dgegl=disabled -Ddocs=true -Di18n=enabled
112105

113106
### Build
114107

115-
$ make
108+
$ meson compile -C _build
116109

117110
Once MyPaint is built, you can run the test suite and/or install it.
118111

119112
### Test
120113

121-
$ make check
114+
$ meson test -C _build
122115

123116
This runs all the unit tests.
124117

125118
### Install
126119

127-
# make install
120+
# meson install -C _build
128121

129-
Uninstall libmypaint with `make uninstall`.
122+
Uninstall libmypaint with `meson uninstall -C _build`.
130123

131124
### Check availability
132125

@@ -172,11 +165,7 @@ for details of how you can begin contributing.
172165

173166
The distribution release can be generated with:
174167

175-
$ make dist
176-
177-
And it should be checked before public release with:
178-
179-
$ make distcheck
168+
$ meson dist -C _build
180169

181170
## Localization
182171

@@ -198,7 +187,7 @@ in `po/POTFILES.in`.
198187
You can update the .po files when translated strings in the code change
199188
using:
200189

201-
$ cd po && make update-po
190+
$ meson compile -C _build update-po
202191

203192
When the results of this are pushed, Weblate translators will see the
204193
new strings immediately.

po/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ We use [GNU gettext][gettext] for runtime translation of program text.
1616
## After updating program strings
1717

1818
After changing any string in the source text which makes use of the
19-
gettext macros, you will need to run `./po/update_translation.sh`
19+
gettext macros, you will need to run `meson compile -C _build update-po`
2020
and then commit the modified `po/libmypaint.pot` and `po/*.po`
2121
files along with your changes.
2222
Keeping this generated template file in the distribution
@@ -26,7 +26,7 @@ without having to ask us.
2626
if all you want to do is compare diffs,
2727
the `.pot` file alone can be updated by running:
2828
```
29-
./po/update_translations.sh --only-template
29+
meson compile -C _build libmypaint.pot
3030
```
3131

3232
# Information for translators
@@ -63,18 +63,16 @@ Before working on a translation,
6363
update the `.po` file for your language.
6464
For example, for the French translation, run:
6565

66-
./po/update_translations.sh fr
66+
meson compile -C _build update-po-fr
6767

6868
## Use/Test the translation
6969

7070
After modifying the translation,
7171
you need to rebuild and reinstall libmypaint to see the effect
7272
in MyPaint, or in other apps that use `libmypaint`.
73-
If you have already built it, and `make install` does what you want,
74-
you can just use:
73+
If you have already built it, you can just use:
7574

76-
make
77-
make install
75+
meson install -C _build
7876

7977
To run MyPaint with a specific translation on Linux,
8078
you can use the LANG environment variable

po/update_translations.sh

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)