summaryrefslogtreecommitdiffstats
path: root/README
blob: ce4bc7cad42900fe30b3b1f7b4f6719ddfda179e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
This document is heavily inspired by the Building Wayland document:
http://wayland.freedesktop.org/building.html

However, it is slightly more messy
:) If you encounter things you find unclear, and know of a better way of
expressing it, then please send a patch:)

Qt-Compositor is meant as a toolbox for making new funky Wayland compositors.

Pre-requisites on Linux (apt-get): git, autoconf, automake, libtool, libexpat1-dev
Pre-requisites on Mac OSX Snow Leopard: git, latest Gnu autoconf, latest Gnu automake, latest Gnu libtool, latest pkg-config.
Make sure you have /usr/local/bin on the $PATH before /usr/bin
  
1. To build wayland we need libffi + libffi headers on Linux. For Mac we need a special version of wayland/event-loop.c -- if you pull the distribution from the freedesktop.org, replace the event-loop.c with the one in this repo
 
# sudo apt-get install libffi-dev
On Mac ffi is part of the OS but you need to tell the the wayland configure
export FFI_CFLAGS=-I/usr/include/ffi
export FFI_LIBS-lffi

Qt-Compositor contains a copy of the Wayland libraries. We have not changed
them in any way, but they are provided for convenience so that you can compile
everything using qmake. However, I suggest you use the official Wayland
libraries. The only dependency they have is to ffi. The demos has some more
dependencies, but we are not going to compile those.

2. Clone Wayland from: git://anongit.freedesktop.org/wayland/wayland
# git clone git://anongit.freedesktop.org/wayland/wayland

3. Compile Wayland: ./autogen.sh -prefix=$HOME/install && make && make install

4. Set your PKG_CONFIG_PATH so that the location of the Wayland libraries are
picked up by Qt's configure. 
# export PKG_CONFIG_PATH=$HOME/install/lib/pkgconfig/

6. Set the library path to pick up the Wayland libraries
# export LD_LIBRARY_PATH=$HOME/install/lib

8. Get the build dependencies that you need for QtGui.
# sudo apt-get build-dep libqt4-gui

One of the dependencies that the wayland-demos compositor and client
applications has is xkbcommon. The Qt-Lighthouse wayland plugin has code to
read xkbcommon codes sent over the wayland protocol, so that Qt-Lighthouse
clients on Wayland will get keyboard functionality in other compositors.
However, Qt-Compositor doesn't have this requirement. The support for xkbcommon
is picked up by configure. If it is not detected the Wayland plug-in will be
compiled with the: QT_NO_WAYLAND_XKB.

libxkbcommon is available from: git://people.freedesktop.org/xorg/lib/libxkbcommon.git
Use typically the following line to configure it:
# ./autogen.sh --prefix=$HOME/install --with-xkb-config-root=/usr/share/X11/xkb

Its a good idea to use out of source builds when building Qt. A good setup
could be: $HOME/dev/qt-src/lighthouse where lighthouse is where you have a
complete checkout of the lighthouse repository.  Then you can have ie.:
$HOME/dev/qt-builds/lighthouse-debug

9. Clone Lighthouse from gitorious
# git clone git@gitorious.org:+qt-developers/qt/lighthouse.git
# $HOME/dev/qt-src/lighthouse
(you might want to use git remote etc. if you already have a clone of
qt-master)

10. Configure and compile Qt-Lighthouse. So from
$HOME/dev/qt-builds/lighthouse-debug do: ../../qt-src/lighthouse/configure -qpa
-developer-build && make

11. OK, now we have Lighthouse and Wayland libs on our system. To try Wayland
out we want the compositor to render into a XWindow(this is for development).
So we need to compile up a X back-end for lighthouse. They don't get built
automatically (yet). The Wayland plug-in will be ma

Go into the directory: $HOME/dev/qt-src/lighthouse/src/plugins/platforms/xcb
# make

12. When this is done, you are ready to compile the qwidget-compositor.  Enter
the directory with $QT-COMPOSITOR-DIR/examples/qwidget-compositor #qmake &&
make

Makes generates a executable in $QT-COMPOSITOR-DIR/bin. Execute it and pass in
-platform xcb
# $QT-COMPOSITOR-DIR/bin/qt-compositor -platform xcb

This should give you a blank window. If you now open a another terminal with
LD_LIBRARY_PATH set and run a simple Qt example with the -platform Wayland, it
should render into this window.