Failed to build

Please fill out the topic template below so we can help you faster.

Description of the Problem, or Question?

I tried building MyPaint from source as mentioned in the github page
I ran python setup.py demo before installing it and I found that I don’t have some dependencies.
libmypaint >= 1.5
pygobject-3.0
lcms2
mypaint-brushes-2.0

I then tried to install libmypaint from https://github.com/mypaint/libmypaint#build-and-install. I looked at it and found that I needed to install some dependencies as well. One of them is https://github.com/json-c/json-c
I have followed the steps there which is

./configure --prefix=/some/install/path
make
make check
make install

I tried to run it again but I got this

checking for JSON... no
configure: error: Package requirements (json) were not met:

No package 'json' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables JSON_CFLAGS
and JSON_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

So now I’m confused. The output of make install when installing jason was this

Making install in .
make[1]: Entering directory '/home/fatih/Downloads/json-c'
make[2]: Entering directory '/home/fatih/Downloads/json-c'
 /bin/mkdir -p '/home/Downloads/json-c/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libjson-c.la '/home/Downloads/json-c/lib'
libtool: install: /usr/bin/install -c .libs/libjson-c.so.4.0.0 /home/Downloads/json-c/lib/libjson-c.so.4.0.0
libtool: install: (cd /home/Downloads/json-c/lib && { ln -s -f libjson-c.so.4.0.0 libjson-c.so.4 || { rm -f libjson-c.so.4 && ln -s libjson-c.so.4.0.0 libjson-c.so.4; }; })
libtool: install: (cd /home/Downloads/json-c/lib && { ln -s -f libjson-c.so.4.0.0 libjson-c.so || { rm -f libjson-c.so && ln -s libjson-c.so.4.0.0 libjson-c.so; }; })
libtool: install: /usr/bin/install -c .libs/libjson-c.lai /home/Downloads/json-c/lib/libjson-c.la
libtool: install: /usr/bin/install -c .libs/libjson-c.a /home/Downloads/json-c/lib/libjson-c.a
libtool: install: chmod 644 /home/Downloads/json-c/lib/libjson-c.a
libtool: install: ranlib /home/Downloads/json-c/lib/libjson-c.a
libtool: warning: remember to run 'libtool --finish /usr/local/lib'
 /bin/mkdir -p '/home/Downloads/json-c/include/json-c'
 /usr/bin/install -c -m 644 arraylist.h debug.h json.h json_c_version.h json_config.h json_inttypes.h json_object.h json_object_iterator.h json_pointer.h json_tokener.h json_util.h json_visit.h linkhash.h printbuf.h '/home/Downloads/json-c/include/json-c'
 /bin/mkdir -p '/home/Downloads/json-c/lib/pkgconfig'
 /usr/bin/install -c -m 644 json-c.pc '/home/Downloads/json-c/lib/pkgconfig'
make[2]: Leaving directory '/home/fatih/Downloads/json-c'
make[1]: Leaving directory '/home/fatih/Downloads/json-c'
Making install in tests
make[1]: Entering directory '/home/fatih/Downloads/json-c/tests'
make[2]: Entering directory '/home/fatih/Downloads/json-c/tests'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/fatih/Downloads/json-c/tests'
make[1]: Leaving directory '/home/fatih/Downloads/json-c/tests'

Maybe someone out there who has successfully built mypaint could help me?

Basic System Details

Elementary OS Hera
MyPaint version:
2.0.0

Thank you!

The basic rule of thumb when installing dependencies is:

If the dependency is available in my distribution’s repositories, and the version of that dependency is not too low, use that one instead of building from source.

Elementary OS is a debian derivative using apt/dpkg, so you should be able to install what you need by running:
sudo apt-get install libjson-c-dev

You need the -dev variant, since it includes header files required for compilation.


As for why your own build doesn’t work: the build system has no way of knowing that it should look under $HOME/Downloads/json-c/lib/pkgconfig to find information about the location of the files it needs. You can tell it to look there, but in this case I would recommend just using apt-get (or just apt, if you have it).

Thanks for the replies! I didn’t know json-c is in the repos.

I’ve ran the command for installing libmypaint and it seems to works fine as intended.

./autogen.sh    # Only needed when building from git.
./configure
sudo make install
sudo ldconfig

I then tried to run python setup.py demo to test it and it still outputs this

Package libmypaint was not found in the pkg-config search path.
Perhaps you should add the directory containing `libmypaint.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libmypaint' found
Package pygobject-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pygobject-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pygobject-3.0' found
Package lcms2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lcms2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lcms2' found
Package mypaint-brushes-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mypaint-brushes-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mypaint-brushes-2.0' found

The following required dependencies were not found:
libmypaint >= 1.5
pygobject-3.0
lcms2
mypaint-brushes-2.0

I’ve tried to run the check availability section of libmypaint readme and I got this output.

$ pkg-config --list-all | grep -i mypaint
libmypaint-2.0                 libmypaint - MyPaint's brushstroke rendering library (2.0.0-beta)
$ sudo ldconfig -p |grep -i libmypaint
	libmypaint-2.0.so.0 (libc6,x86-64) => /usr/local/lib/libmypaint-2.0.so.0
	libmypaint-2.0.so (libc6,x86-64) => /usr/local/lib/libmypaint-2.0.so
	libmypaint-1.4.so.0 (libc6,x86-64) => /usr/lib/libmypaint-1.4.so.0
	libmypaint-1.3.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libmypaint-1.3.so.0
	libmypaint-gegl.so.0 (libc6,x86-64) => /usr/lib/libmypaint-gegl.so.0
	libmypaint-gegl.so (libc6,x86-64) => /usr/lib/libmypaint-gegl.so

sudo sh -c "echo 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig' >>/etc/environment"

Now I think this is probably the same problem that you mentioned in your second paragraph. I looked around and found that the file in question in the output (libmypaint.pc) is in /usr/local/lib/pkgconfig. Do you know how to solve this?

Ok, the problem here is that you’re building the 2.0.x branch (or release tarball), which requires libmypaint >= 1.5.0, whereas you have built and installed libmypaint-2.0 (the master branch - and note the dash, it’s not libmypaint 2.0, it’s libmypaint-2.0, a separate package).

I would suggest building the master branch of MyPaint instead (which uses libmypaint-2.0), since that contains additional bug fixes, but if you don’t want to do that you can build/install libmypaint 1.5.0 instead (instructions below).


If you already have a clone of the libmypaint repo, run git checkout libmypaint-v1.5.x (if that branch isn’t there, run git fetch --all) and do the build/install steps again (including running autogen.sh, because some files need to be generated again). That should fix it.

Thanks! I didn’t realize that I was using the source from the tarball in the downloads page. I cloned the master branch from github and it’s fine now just needed to install the remaining dependencies.

I’ve installed the remaining dependencies and I got mypaint up and running now. Thanks a lot @jpll

If anyone wanted to use this thread to build their own mypaint here’s the guide I found on how to install the remaining dependencies (at least on Ubuntu)
lcms2 https://askubuntu.com/questions/1029077/installing-lcms2
pygobject-3.0 https://stackoverflow.com/questions/12861914/no-package-pygobject-3-0-found
mypaint-brushes-2.0 https://github.com/mypaint/mypaint-brushes