MyPaint master build error (openSUSE Tumbleweed)

I’m attempting to build MyPaint from the master branch, and installed all the needed dependencies as listed here.

MyPaint version: master branch

Operating System + Version: openSUSE Tumbleweed
KDE Plasma 5.9.4

This is the output I’m getting when running python setup.py demo:

running demo                                                                                                                                                                                                                                   
running build_ext                                                                                                                                                                                                                              
building 'lib._mypaintlib' extension                                                                                                                                                                                                           
swigging lib/mypaintlib.i to lib/mypaintlib_wrap.cpp                                                                                                                                                                                           
swig -python -Wall -noproxydel -c++ -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/pygobject-3.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/pkg/libxkbcommon -I/usr/include/wayland -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmypaint -I/usr/include/json-c -DNO_TESTS -o lib/mypaintlib_wrap.cpp lib/mypaintlib.i    
gcc -pthread -fno-strict-aliasing -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fwrapv -fPIC -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/pygobject-3.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/pkg/libxkbcommon -I/usr/include/wayland -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmypaint -I/usr/include/json-c -I/usr/include/python2.7 -c lib/mypaintlib_wrap.cpp -o build/temp.linux-x86_64-2.7/lib/mypaintlib_wrap.o -Wall -Wno-sign-compare -Wno-write-strings -D_POSIX_C_SOURCE=200809L -DNO_TESTS -g -fopenmp -pthread -O3                                                                                                                                                                                                                                             
In file included from /usr/include/python2.7/Python.h:8:0,
                 from lib/mypaintlib_wrap.cpp:173:
/usr/include/python2.7/pyconfig.h:1193:0: warning: "_POSIX_C_SOURCE" redefined
 #define _POSIX_C_SOURCE 200112L                                                                                                                                                                                                               
                                                                                                                                                                                                                                               
<command-line>:0:0: note: this is the location of the previous definition
In file included from lib/mypaintlib.hpp:18:0,
                 from lib/mypaintlib_wrap.cpp:3140:
lib/tiledsurface.hpp: In member function ‘void TiledSurface::set_symmetry_state(bool, float, float, SymmetryType, int)’:
lib/tiledsurface.hpp:49:10: error: ‘MyPaintSymmetryType’ was not declared in this scope
         (MyPaintSymmetryType)symmetry_type, rot_symmetry_lines);
          ^~~~~~~~~~~~~~~~~~~
error: command 'gcc' failed with exit status 1 

Could someone tell me what’s happening? Am I missing anything?

I’m pretty sure you are building against an older version of libmypaint. Get the newest libmypaint here

build and install that (instructions here), then build mypaint.

I think the instructions should be updated to include building libmypaint from src instead of fetching packages (that might be out of date). Generally those packages work but there was a recent update that requires changes to both mypaint and libmypaint.

Thanks! It builds successfully now and everything seems to work. :slight_smile: