Solarus can't be compiled in snapcraft Ubuntu 16.04-based Docker image
Snapcraft recommends compiling on a clean Ubuntu 16.04 LTS. Since most people don't have that, they provide a Docker image you can use to compile your Snap. Sadly, Solarus doesn't seem able to compile in it, and I'm seeing this error:
[ 37%] Building CXX object CMakeFiles/solarus.dir/src/graphics/BlendModeInfo.cpp.o
[ 37%] Building CXX object CMakeFiles/solarus.dir/src/graphics/Color.cpp.o
[ 38%] Building CXX object CMakeFiles/solarus.dir/src/graphics/Drawable.cpp.o
[ 38%] Building CXX object CMakeFiles/solarus.dir/src/graphics/Hq2xFilter.cpp.o
[ 39%] Building CXX object CMakeFiles/solarus.dir/src/graphics/Hq3xFilter.cpp.o
[ 39%] Building CXX object CMakeFiles/solarus.dir/src/graphics/Hq4xFilter.cpp.o
[ 39%] Building CXX object CMakeFiles/solarus.dir/src/graphics/Renderer.cpp.o
[ 40%] Building CXX object CMakeFiles/solarus.dir/src/graphics/sdlrenderer/SDLRenderer.cpp.o
[ 40%] Building CXX object CMakeFiles/solarus.dir/src/graphics/sdlrenderer/SDLSurfaceImpl.cpp.o
[ 41%] Building CXX object CMakeFiles/solarus.dir/src/graphics/sdlrenderer/SDLShader.cpp.o
[ 41%] Building CXX object CMakeFiles/solarus.dir/src/graphics/glrenderer/GlRenderer.cpp.o
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp: In member function ‘SDL_BlendMode Solarus::SDLRenderer::make_sdl_blend_mode(const Solarus::SurfaceImpl&, const Solarus::SurfaceImpl&, Solarus::BlendMode)’:
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:198:15: error: ‘SDL_BLENDFACTOR_SRC_ALPHA’ was not declared in this scope
SDL_BLENDFACTOR_SRC_ALPHA,
^
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:199:15: error: ‘SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA’ was not declared in this scope
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
^
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:200:15: error: ‘SDL_BLENDOPERATION_ADD’ was not declared in this scope
SDL_BLENDOPERATION_ADD,
^
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:201:15: error: ‘SDL_BLENDFACTOR_ONE’ was not declared in this scope
SDL_BLENDFACTOR_ONE,
^
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:203:37: error: ‘SDL_ComposeCustomBlendMode’ was not declared in this scope
SDL_BLENDOPERATION_ADD);
^
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:209:13: error: ‘SDL_BLENDFACTOR_ONE’ was not declared in this scope
SDL_BLENDFACTOR_ONE,
^
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:210:13: error: ‘SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA’ was not declared in this scope
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
^
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:211:13: error: ‘SDL_BLENDOPERATION_ADD’ was not declared in this scope
SDL_BLENDOPERATION_ADD,
^
/build/parts/launcher/src/src/graphics/sdlrenderer/SDLRenderer.cpp:214:35: error: ‘SDL_ComposeCustomBlendMode’ was not declared in this scope
SDL_BLENDOPERATION_ADD);
^
CMakeFiles/solarus.dir/build.make:2486: recipe for target 'CMakeFiles/solarus.dir/src/graphics/sdlrenderer/SDLRenderer.cpp.o' failed
make[2]: *** [CMakeFiles/solarus.dir/src/graphics/sdlrenderer/SDLRenderer.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/solarus.dir/all' failed
make[1]: *** [CMakeFiles/solarus.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Downloading parts list
cmake /build/parts/launcher/src -DCMAKE_INSTALL_PREFIX=
make -j4
Failed to run 'make -j4' for 'launcher': Exited with code 2.
Verify that the part is using the correct parameters and try again.
Any clues why this might be happening?
Snapcraft's Docker image might be slightly different from the real Ubuntu 16.04.
Edited by Alex Gleason