diff --git a/README.md b/README.md index 0143fd07..62da4437 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,17 @@ License: ISC, see [COPYING](./COPYING) for details. * All configurations and builds: - [json-c](https://github.com/json-c/json-c/wiki) (>= 0.11) - - C compiler, `make` etc. -* Most configurations (all except `--disable-introspection --without-glib`): + - C compiler, Meson, ninja, `pkg-config` etc. + - Alternately, Autotools can be used instead of Meson but they are considered deprecated. +* Most configurations (all except `-Dintrospection=disabled -Dglib=disabled`): - [GObject-Introspection](https://live.gnome.org/GObjectIntrospection) - [GLib](https://wiki.gnome.org/Projects/GLib) * When building from `git` (developer package names vary by distribution): - [Python](http://python.org/) - - [autotools](https://en.wikipedia.org/wiki/GNU_Build_System) - - [intltool](https://freedesktop.org/wiki/Software/intltool/) + - [Meson](https://en.wikipedia.org/wiki/Meson_(software)) + - [ninja](https://en.wikipedia.org/wiki/Ninja_(build_system)) - [gettext](https://www.gnu.org/software/gettext/gettext.html) -* For `--enable-gegl` (GIMP *does not* require this): +* For `-Dgegl=enabled` (GIMP *does not* require this): - [GEGL + BABL](http://gegl.org/) ### Install dependencies (Debian and derivatives) @@ -30,10 +31,10 @@ License: ISC, see [COPYING](./COPYING) for details. On recent Debian-like systems, you can type the following to get started with a standard configuration: - # apt install -y build-essential + # apt install -y build-essential meson # apt install -y libjson-c-dev libgirepository1.0-dev libglib2.0-dev -When building from git: +Additionally, when using the deprecated Autotools build system: # apt install -y python autotools-dev intltool gettext libtool @@ -44,11 +45,11 @@ You might also try using your package manager: ### Install dependencies (Red Hat and derivatives) -The following works on a minimal CentOS 7 installation: +The following should works on a minimal CentOS 7 installation: - # yum install -y gcc gobject-introspection-devel json-c-devel glib2-devel + # yum install -y gcc meson gobject-introspection-devel json-c-devel glib2-devel -When building from git, you'll want to add: +Additionally, when using the deprecated Autotools build system: # yum install -y git python autoconf intltool gettext libtool @@ -60,9 +61,9 @@ You might also try your package manager: Works with a fresh OpenSUSE Tumbleweed Docker image: - # zypper install gcc13 gobject-introspection-devel libjson-c-devel glib2-devel + # zypper install gcc13 meson gobject-introspection-devel libjson-c-devel glib2-devel -When building from git: +Additionally, when using the deprecated Autotools build system: # zypper install git python311 autoconf intltool gettext-tools libtool @@ -72,61 +73,53 @@ Package manager: ## Build and install +You can use [Meson](https://mesonbuild.com/) build system. + + $ meson setup _build --prefix=/usr + $ meson compile -C _build + # meson install -C _build + # ldconfig + MyPaint and libmypaint benefit dramatically from autovectorization and other compiler optimizations. -You may want to set your CFLAGS before compiling (for gcc): +You may want to set your CFLAGS before compiling (for gcc) by passing something like the following as an argument to `meson setup`: - $ export CFLAGS='-Ofast -ftree-vectorize -fopt-info-vec-optimized -march=native -mtune=native -funsafe-math-optimizations -funsafe-loop-optimizations' + -Dc_args='-Ofast -ftree-vectorize -fopt-info-vec-optimized -march=native -mtune=native -funsafe-math-optimizations -funsafe-loop-optimizations' -The traditional setup works just fine. +Alternately, you can use the traditional Autotools build system for now (it is deprecated and will be eventually removed): - $ ./autogen.sh # Only needed when building from git. + $ ./autogen.sh $ ./configure # make install # ldconfig -### Maintainer mode - -We don't ship a `configure` script in our git repository. If you're -building from git, you have to kickstart the build environment with: - - $ git clone https://github.com/mypaint/libmypaint.git - $ cd libmypaint - $ ./autogen.sh - -This script generates `configure` from `configure.ac`, after running a -few checks to make sure your build environment is broadly OK. It also -regenerates certain important generated headers if they need it. - -Folks building from a release tarball don't need to do this: they will -have a `configure` script from the start. - ### Configure - $ ./configure - $ ./configure --prefix=/tmp/junk/example +Meson requires out-of-tree builds so you need to specify a build directory. + + $ meson setup _build + $ meson setup _build --prefix=/tmp/junk/example -There are several MyPaint-specific options. -These can be shown by running +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. - $ ./configure --help + $ meson setup _build -Dgegl=disabled -Ddocs=true -Di18n=enabled ### Build - $ make + $ meson compile -C _build Once MyPaint is built, you can run the test suite and/or install it. ### Test - $ make check + $ meson test -C _build This runs all the unit tests. ### Install - # make install + # meson install -C _build -Uninstall libmypaint with `make uninstall`. +Uninstall libmypaint with `meson uninstall -C _build`. ### Check availability @@ -172,11 +165,7 @@ for details of how you can begin contributing. The distribution release can be generated with: - $ make dist - -And it should be checked before public release with: - - $ make distcheck + $ meson dist -C _build ## Localization @@ -198,7 +187,7 @@ in `po/POTFILES.in`. You can update the .po files when translated strings in the code change using: - $ cd po && make update-po + $ meson compile -C _build update-po When the results of this are pushed, Weblate translators will see the new strings immediately. diff --git a/po/README.md b/po/README.md index aca2d611..66366acd 100644 --- a/po/README.md +++ b/po/README.md @@ -16,7 +16,7 @@ We use [GNU gettext][gettext] for runtime translation of program text. ## After updating program strings After changing any string in the source text which makes use of the -gettext macros, you will need to run `./po/update_translation.sh` +gettext macros, you will need to run `meson compile -C _build update-po` and then commit the modified `po/libmypaint.pot` and `po/*.po` files along with your changes. Keeping this generated template file in the distribution @@ -26,7 +26,7 @@ without having to ask us. if all you want to do is compare diffs, the `.pot` file alone can be updated by running: ``` -./po/update_translations.sh --only-template +meson compile -C _build libmypaint.pot ``` # Information for translators @@ -63,18 +63,16 @@ Before working on a translation, update the `.po` file for your language. For example, for the French translation, run: - ./po/update_translations.sh fr + meson compile -C _build update-po-fr ## Use/Test the translation After modifying the translation, you need to rebuild and reinstall libmypaint to see the effect in MyPaint, or in other apps that use `libmypaint`. -If you have already built it, and `make install` does what you want, -you can just use: +If you have already built it, you can just use: - make - make install + meson install -C _build To run MyPaint with a specific translation on Linux, you can use the LANG environment variable