1# libmypaint - MyPaint brush engine library 2 3[![Translation status](https://hosted.weblate.org/widgets/mypaint/-/libmypaint/svg-badge.svg)](https://hosted.weblate.org/engage/mypaint/?utm_source=widget) 4[![Travis Build Status](https://travis-ci.org/mypaint/libmypaint.svg?branch=master)](https://travis-ci.org/mypaint/libmypaint) 5[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/mypaint/libmypaint?branch=master&svg=true)](https://ci.appveyor.com/project/jonnor/libmypaint) 6 7This is the brush library used by MyPaint. A number of other painting 8programs use it too. 9 10License: ISC, see [COPYING](./COPYING) for details. 11 12## Dependencies 13 14* All configurations and builds: 15 - [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`): 18 - [GObject-Introspection](https://live.gnome.org/GObjectIntrospection) 19 - [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): 26 - [GEGL + BABL](http://gegl.org/) 27 28### Install dependencies (Debian and derivatives) 29 30On recent Debian-like systems, you can type the following 31to get started with a standard configuration: 32 33 $ sudo apt install -y build-essential 34 $ sudo apt install -y libjson-c-dev libgirepository1.0-dev libglib2.0-dev 35 36When building from git: 37 38 $ sudo apt install -y python autotools-dev intltool gettext libtool 39 40You might also try using your package manager: 41 42 $ sudo apt build-dep mypaint # will get additional deps for MyPaint (GUI) 43 $ sudo apt build-dep libmypaint # may not exist; included in mypaint 44 45### Install dependencies (Red Hat and derivatives) 46 47The following works on a minimal CentOS 7 installation: 48 49 $ sudo yum install -y gcc gobject-introspection-devel json-c-devel glib2-devel 50 51When building from git, you'll want to add: 52 53 $ sudo yum install -y git python autoconf intltool gettext libtool 54 55You might also try your package manager: 56 57 $ sudo yum builddep libmypaint 58 59## Build and install 60 61MyPaint and libmypaint benefit dramatically from autovectorization and other compiler optimizations. 62You may want to set your CFLAGS before compiling (for gcc): 63 64 $ export CFLAGS='-Ofast -ftree-vectorize -fopt-info-vec-optimized -march=native -mtune=native -funsafe-math-optimizations -funsafe-loop-optimizations' 65 66The traditional setup works just fine. 67 68 $ ./autogen.sh # Only needed when building from git. 69 $ ./configure 70 $ sudo make install 71 $ sudo ldconfig 72 73### Maintainer mode 74 75We don't ship a `configure` script in our git repository. If you're 76building from git, you have to kickstart the build environment with: 77 78 $ git clone https://github.com/mypaint/libmypaint.git 79 $ cd libmypaint 80 $ ./autogen.sh 81 82This script generates `configure` from `configure.ac`, after running a 83few checks to make sure your build environment is broadly OK. It also 84regenerates certain important generated headers if they need it. 85 86Folks building from a release tarball don't need to do this: they will 87have a `configure` script from the start. 88 89### Configure 90 91 $ ./configure 92 $ ./configure --prefix=/tmp/junk/example 93 94There are several MyPaint-specific options. 95These can be shown by running 96 97 $ ./configure --help 98 99### Build 100 101 $ make 102 103Once MyPaint is built, you can run the test suite and/or install it. 104 105### Test 106 107 $ make check 108 109This runs all the unit tests. 110 111### Install 112 113 $ sudo make install 114 115Uninstall libmypaint with `make uninstall`. 116 117### Check availability 118 119Make sure that pkg-config can see libmypaint before trying to build with it. 120 121 $ pkg-config --list-all | grep -i mypaint 122 123If it's not found, you'll need to add the relevant pkgconfig directory to 124the `pkg-config` search path. For example, on CentOS, with a default install: 125 126 $ sudo sh -c "echo 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig' >>/etc/environment" 127 128Make sure ldconfig can see libmypaint as well 129 130 $ sudo ldconfig -p |grep -i libmypaint 131 132If it's not found, you'll need to add the relevant lib directory to 133the LD_LIBRARY_PATH: 134 135 $ export LD_LIBRARY_PATH=/usr/local/lib 136 $ sudo sh -c "echo 'LD_LIBRARY_PATH=/usr/local/lib' >>/etc/environment 137 138Alternatively, you may want to enable /usr/local for libraries. Arch and Redhat derivatives: 139 140 $ sudo sh -c "echo '/usr/local/lib' > /etc/ld.so.conf.d/usrlocal.conf" 141 $ sudo ldconfig 142 143## Contributing 144 145The MyPaint project welcomes and encourages participation by everyone. 146We want our community to be skilled and diverse, 147and we want it to be a community that anybody can feel good about joining. 148No matter who you are or what your background is, we welcome you. 149 150Please note that MyPaint is released with a 151[Contributor Code of Conduct](CODE_OF_CONDUCT.md). 152By participating in this project you agree to abide by its terms. 153 154Please see the file [CONTRIBUTING.md](CONTRIBUTING.md) 155for details of how you can begin contributing. 156 157## Making releases 158 159The distribution release can be generated with: 160 161 $ make dist 162 163And it should be checked before public release with: 164 165 $ make distcheck 166 167## Localization 168 169Contribute translations here: <https://hosted.weblate.org/engage/mypaint/>. 170 171The list of languages is maintained in [po/LINGUAS](po/LINGUAS). 172Currently this file lists all the languages we have translations for. 173It can be regenerated with: 174 175 $ ls po/*.po | sed 's$^.*po/\([^.]*\).po$\1$' | sort > po/LINGUAS 176 177You can also disable languages by removing them from the list if needed. 178 179A list of files where localizable strings can be found is maintained 180in `po/POTFILES.in`. 181 182### Strings update 183 184You can update the .po files when translated strings in the code change 185using: 186 187 $ cd po && make update-po 188 189When the results of this are pushed, Weblate translators will see the 190new strings immediately. 191 192## Documentation 193 194Further documentation can be found in the libmypaint wiki: 195<https://github.com/mypaint/libmypaint/wiki>. 196