Posts: 1
Joined: Sun Nov 18, 2012 12:37 pm

Clutter & Cogl on raspberry pi without X server

Sun Oct 12, 2014 9:10 am

Hi All,

Clutter is a really nice graphics library / scene graph for making user interfaces from Intel. It handles drawing to the screen, text rendering, input events and works through GLES so is fast. It has bindings to lots of languages (python, javascript, ...). Basically it is an awesome way to use the HDMI output without running an X server.

I couldn't find any instructions for getting this working on the pi and it took me a while to work out. It required patching cogl for the specific GLES initialization required on the PI.

To install it on raspbian (these instructions will build it in /home/pi/dev/build):

Code: Select all

# Install base libraries
sudo apt-get install autoconf libtool automake libgudev-1.0-dev libxkbcommon-dev libudev-dev libmtdev-dev libev-dev gobject-introspection libgirepository1.0-dev python-gi-cairo

# Define some variables !!!
export LIBS="-lGLESv2 -lEGL  -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -lm"
export CPPFLAGS="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
export LDFLAGS="-L/opt/vc/lib"
export LD_LIBRARY_PATH=/home/pi/dev/build/lib:/opt/vc/lib
export PKG_CONFIG_PATH=/home/pi/dev/build/lib/pkgconfig
export XDG_DATA_DIRS=/home/pi/dev/build/share
export GI_TYPELIB_PATH=/home/pi/dev/build/lib/girepository-1.0

# Download my patched Cogl-1.18.0 branch
git clone [email protected]:adamlofts/cogl.git
./ --prefix=/home/pi/dev/build --enable-gl=no --enable-xlib-egl-platform=no --enable-gles2=yes --enable-null-egl-platform=yes --disable-glibtest --without-x --enable-introspection=yes
make install

# Checkout libevdev (git://
./ --prefix=/home/pi/dev/build && make && make install

# Checkout libinput (git://
./ --prefix=/home/pi/dev/build && make && make install

# Download Clutter-1.2.0
./ --prefix=/home/pi/dev/build --enable-egl-backend=yes --enable-evdev-input=yes --enable-x11-backend=no --without-x --enable-maintainer-flags=no --enable-gdk-backend=no --enable-introspection=yes
make && make install

Return to “Graphics programming”