The instructions is based on building wayland-weston on Ubuntu prebuilt image. The same can be applied to other build systems as well.
PREREQUISITIES
The following is the software environment required:
- Ubuntu Oneiric (11.10) distribution. (Download Pre-built Ubuntu demo image from www.freescale.com/imx6)
- Wayland/Weston : Wayland dependencies are listed in http://wayland.freedesktop.org/building.html.
- 0001-DRM-condition.patch and 0002-Enable-weston-for-Vivante-GPU.patches for Weston.
WAYLAND VERSION
This release is based on Wayland 1.1.0 version.
BUILDING
- The steps are based on wayland building from http://wayland.freedesktop.org/building.html.
- Download wayland-1.1.0.tar.xz from http://wayland.freedesktop.org/releases.html
3. Setting up the environment. This need to be performed on the target
$export WLD=/usr
$export LD_LIBRARY_PATH=$WLD/lib
$export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/
$export ACLOCAL="aclocal -I $WLD/share/aclocal"
Also, create the 'share/aclocal' directory.
$mkdir -p $WLD/share/aclocal
Let us consider, extracting the package to /opt
$cd /opt
$tar xvvf wayland-1.1.0.tar.xz
$cd wayland-1.1.0
$ ./configure --prefix=$WLD --disable-documentation
$ make
$ make install
4. Setting up GPU-VIV graphics drivers
The GPU-VIV graphics drivers are available as part of BSP release.
Get the gpu-viv-wl-bin-mx6q-{VER}.tar.gz for 4.0.0 release gpu-viv-wl-bin-mx6q-3.0.35-4.0.0.tar.gz from the BSP-Source/pkgs
Extract to the target $ROOTFS
The prebuilt root file system (rootfs) may come with prebuilt GPU driver. By default, it may set to EGL framebuffer.
To enable Wayland/Weston support, make EGL and GAL point to correct binaries as shown below:
$ ls –l $(ROOTFS)/usr/lib/libEGL.so*
libEGL.so -> libEGL-wl.so
libEGL.so.1 -> libEGL-wl.so
$ ls –l $(ROOTFS)/usr/lib/libGAL.so
libGAL.so -> libGAL-wl.so
5. Build the libxkbcommon as in http://wayland.freedesktop.org/building.html
6. We will need Cairo stack as Weston clients depend on Cairo for rendering. Please build Cairo as described in http://wayland.freedesktop.org/building.html, but note that, for now, we do not enable gl backend for Cairo, so the '--enable-gl --enable-xcb' flags must not be used when building.
7. Building Weston
Now add the following environment settings in the terminal window. (Note the "`"- backtick - character).
export WLD=/usr
export LD_LIBRARY_PATH=$WLD/lib
export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/
export ACLOCAL="aclocal -I $WLD/share/aclocal"
export LD_LIBRARY_PATH="/usr/lib"
export LDFLAGS="-lwayland-server -lwayland-client -lwayland-server -lwayland-cursor -lpixman-1"
export COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1"
export COMPOSITOR_CFLAGS="-I $WLD/include -I $WLD/include/pixman-1 -L$SDK_DIR/drivers -DLINUX=1 -DEGL_API_FB -DEGL_API_WL"
export CLIENT_CFLAGS="-I $WLD/include -I $WLD/include/cairo -I $WLD/include/pixman-1"
export CLIENT_LIBS="-lGLESv2 -lEGL -lwayland-client -lwayland-cursor -lxkbcommon"
export SIMPLE_EGL_CLIENT_CFLAGS="-DLINUX=1 -DEGL_API_FB -DEGL_API_WL -I $WLD/include"
export SIMPLE_EGL_CLIENT_LIBS="-lGLESv2 -lEGL -lwayland-client -lwayland-cursor"
export IMAGE_LIBS="-lwayland-cursor"
export WESTON_INFO_LIBS="-lwayland-client"
Apply the two patches 0001-DRM-condition.patch and 0002-Enable-weston-for-Vivante-GPU.patch.
Build the Weston.
$cd /opt
$tar xvvf weston-1.1.1.tar.xz
$ cd weston-1.1.1
$ ./configure --prefix=$WLD \
--disable-setuid-install \
--disable-x11-compositor --disable-drm-compositor \
--disable-rpi-compositor --disable-wayland-compositor \
--disable-weston-launch --disable-libunwind \
--disable-xwayland-test \
WESTON_NATIVE_BACKEND="fbdev-backend.so"
$ make
$ make install
RUNNING
Also, Weston must be run as root. copy weston.ini and weston-desktop-shell.ini to /root/.config/ . In terminal window,
export LD_LIBRARY_PATH="/usr/lib"
export XDG_RUNTIME_DIR=/tmp
Execute 'src/weston'. You should see a blue screen fading in. In a different terminal, enter 'clients/simple-shm &'. You should see a scrolling color pattern. You can then enter 'clients/simple-egl &' to see a 3D client action.