Skip to content

Commit c9243c0

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 c9243c0

File tree

3 files changed

+42
-199
lines changed

3 files changed

+42
-199
lines changed

README.md

Lines changed: 37 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,27 @@ License: ISC, see [COPYING](./COPYING) for details.
1212
## Dependencies
1313

1414
* All configurations and builds:
15+
- C compiler, linker etc.
16+
- [Python](http://python.org/)
17+
- [Meson](https://en.wikipedia.org/wiki/Meson_(software)) and [ninja](https://en.wikipedia.org/wiki/Ninja_(build_system))
18+
- Alternately, Autotools can be used instead but they are now considered deprecated.
1519
- [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`):
20+
- [gettext](https://www.gnu.org/software/gettext/gettext.html) (unless `-Di18n=disabled`)
21+
* Most configurations (all except `-Dintrospection=disabled -Dglib=disabled`):
1822
- [GObject-Introspection](https://live.gnome.org/GObjectIntrospection)
1923
- [GLib](https://wiki.gnome.org/Projects/GLib)
20-
* When building from `git` (developer package names vary by distribution):
21-
- [Python](http://python.org/)
22-
- [autotools](https://en.wikipedia.org/wiki/GNU_Build_System)
23-
- [intltool](https://freedesktop.org/wiki/Software/intltool/)
24-
- [gettext](https://www.gnu.org/software/gettext/gettext.html)
25-
* For `--enable-gegl` (GIMP *does not* require this):
24+
* For `-Dgegl=enabled` (GIMP *does not* require this):
2625
- [GEGL + BABL](http://gegl.org/)
2726

2827
### Install dependencies (Debian and derivatives)
2928

3029
On recent Debian-like systems, you can type the following
3130
to get started with a standard configuration:
3231

33-
# apt install -y build-essential
32+
# apt install -y build-essential meson
3433
# apt install -y libjson-c-dev libgirepository1.0-dev libglib2.0-dev
3534

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

3837
# apt install -y python autotools-dev intltool gettext libtool
3938

@@ -44,11 +43,11 @@ You might also try using your package manager:
4443

4544
### Install dependencies (Red Hat and derivatives)
4645

47-
The following works on a minimal CentOS 7 installation:
46+
The following should works on a minimal CentOS 7 installation:
4847

49-
# yum install -y gcc gobject-introspection-devel json-c-devel glib2-devel
48+
# yum install -y gcc meson gobject-introspection-devel json-c-devel glib2-devel
5049

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

5352
# yum install -y git python autoconf intltool gettext libtool
5453

@@ -60,9 +59,9 @@ You might also try your package manager:
6059

6160
Works with a fresh OpenSUSE Tumbleweed Docker image:
6261

63-
# zypper install gcc13 gobject-introspection-devel libjson-c-devel glib2-devel
62+
# zypper install gcc13 meson gobject-introspection-devel libjson-c-devel glib2-devel
6463

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

6766
# zypper install git python311 autoconf intltool gettext-tools libtool
6867

@@ -72,61 +71,53 @@ Package manager:
7271

7372
## Build and install
7473

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

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

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

82-
$ ./autogen.sh # Only needed when building from git.
88+
$ ./autogen.sh
8389
$ ./configure
8490
# make install
8591
# ldconfig
8692

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-
10393
### Configure
10494

105-
$ ./configure
106-
$ ./configure --prefix=/tmp/junk/example
95+
Meson requires out-of-tree builds so you need to specify a build directory.
10796

108-
There are several MyPaint-specific options.
109-
These can be shown by running
97+
$ meson setup _build
98+
$ meson setup _build --prefix=/tmp/junk/example
11099

111-
$ ./configure --help
100+
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.
101+
102+
$ meson setup _build -Dgegl=disabled -Ddocs=true -Di18n=enabled
112103

113104
### Build
114105

115-
$ make
106+
$ meson compile -C _build
116107

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

119110
### Test
120111

121-
$ make check
112+
$ meson test -C _build
122113

123114
This runs all the unit tests.
124115

125116
### Install
126117

127-
# make install
118+
# meson install -C _build
128119

129-
Uninstall libmypaint with `make uninstall`.
120+
Uninstall libmypaint with `meson uninstall -C _build`.
130121

131122
### Check availability
132123

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

173164
The distribution release can be generated with:
174165

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

181168
## Localization
182169

@@ -198,7 +185,7 @@ in `po/POTFILES.in`.
198185
You can update the .po files when translated strings in the code change
199186
using:
200187

201-
$ cd po && make update-po
188+
$ meson compile -C _build update-po
202189

203190
When the results of this are pushed, Weblate translators will see the
204191
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)