Running EFL applications under Wayland based on Ubuntu 14.04, compile libdrm, mesa, wayland, weston, efl from sources

For correct functionality when running under Wayland you must use the latest versions of all the EFL components under Wayland. As a precursor to these steps you must have downloaded and compiled Wayland.

Setting up the environment

apt install git autoconf automake libtool autopoint check

Installing in a custom location, system wide install would break things.

export WLD=$HOME/install   # change this to another location if you prefer
export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/
export PATH=$WLD/bin:$PATH
export ACLOCAL_PATH=$WLD/share/aclocal
export ACLOCAL="aclocal -I $ACLOCAL_PATH"

mkdir -p $WLD/share/aclocal # needed by autotools

Do not set LD_LIBRARY_PATH as your default, it will break things.
Put the above in a script and source it in the terminal you wish to build the packages.


sudo apt-get install xutils-dev libpciaccess-dev

git clone
cd drm/
source ../ 
./ --prefix=$WLD 
make -j128 
make install 


apt-get install x11proto-dri3-dev:all x11proto-present-dev:all libudev-dev llvm

git clone
cd mesa
git checkout mesa-10.1.3
source ../ 
./ --prefix=$WLD --enable-egl --enable-opengl  --enable-gles2   --with-egl-platforms=x11,wayland,drm --enable-gbm --enable-shared-glapi   --with-gallium-drivers=r300,r600,swrast,nouveau  --enable-gallium-osmesa --enable-gallium-egl 
 make -j128  
 make install

apply below patch if encountered libdrm/nouveau.h not found error
apply this patch
or just copy
sudo cp /usr/include/libdrm/nouveau/nouveau.h /usr/include/libdrm/


apt install libffi-dev libexpat-dev libxml2-dev

git clone
# master head commit 0fa3474be36be5fee98bebb169df68dcf806e3f3
cd wayland
source ../
./ --prefix=$WLD --disable-documentation 
make -j128 
make install


git clone
cd wayland-protocols
# master, head commit d5ded4ddaf68b161fec23d75204d2153232c3a47
source ../
./ --prefix=$WLD 
make && make install 


apt install libmtdev-dev libudev-dev libevdev-dev libwacom-dev

git clone
git checkout 1.7.0 
source ../
./ --prefix=$WLD  --disable-libwacom
make -j128
make install


apt install libegl1-mesa-dev libgles2-mesa-dev libxcursor-dev libcairo2-dev libxcb-composite0-dev libgbm-dev libxkbcommon-dev libjpeg8-dev libpam0g-dev

git clone
# mater commit 9fe5d5fae9d41bb5f9ec070dbbc0567c738f4141
cd weston
source ../ 
./ --prefix=$WLD --disable-setuid-install 
make -j128 
make install 


if pkg-config --modversion xkbcommon < 0.5, then compile libxkbcommon

apt-get install libxcb-xkb-dev

git clone 
cd libxkbcommon
source ../
./ --prefix=$WLD 
make -j128
make install


apt-get install libssl-dev libluajit-5.1-dev libfribidi-dev libgif-dev libtiff-dev libmount-dev libblkid-dev libsndfile1-dev libbullet-dev
apt-get install libgstreamer1*

git clone
cd efl
# next commit will require systemd > 209,while ubuntu 14.04 only have 204
git reset --hard cec8a49b51b13670e5adaeb44940f3bece106fb4
source ../
./ --prefix=$WLD --enable-wayland --enable-ecore-wayland --enable-egl --with-opengl=es 
make install      


please confirm that struct wl_egl_window definition in wayland and mesa are same.
struct wl_egl_window {
struct wl_surface *surface;

int width;
int height;
int dx;
int dy;

int attached_width;
int attached_height;

void *private;
void (*resize_callback)(struct wl_egl_window *, void *);


otherwise you might got a crash here:
surface->win->surface === 0x3
while try to eglSwapBuffers
wl_surface_attach(surface->win->surface, surface->buffer[WL_BUFFER_FRONT],
surface->dx, surface->dy);

invaid arguments errors