How to use sdl2 on travis-ci

If you're using Continuous Integration to improve your code quality, maybe you're using to test each commit and report errors.

To build rainbrurph, I need SDL2 libraries and headers, unfortunately, the build fail with the following error message :
E: Unable to locate package libsd2-dev
This message is from apt-get which can't find the package in the repositories.

To know which distribution of GNU/Linux we're using, just look at the Buil system information of the travis-ci log :
Build system information on travis-ci

We're using Ubuntu 12.04. Next, we have to verify the availability of the library at the website and learn it was added on Trusty (14.04) while travis is running Precise (12.04).

To fix this issue we'll need to use a great feature of Ubuntu : ppa (for Personal Package Archives).  It's a way to populate apt-get directly from users work. After a quick search, I finally found a ppa using sdl2 here.

So we'll add to modify our travis-ci's before_install commands:
- sudo add-apt-repository -y ppa:team-xbmc/ppa
- sudo apt-get update -qq
- sudo apt-get install -y  libsdl2-dev
And finally it works.


Popular posts from this blog

How to make a map of variant in C++