clean up the QT+= stuff in the project files
[profile/ivi/qtwayland.git] / README
1 This document is heavily inspired by the Building Wayland document:
2 http://wayland.freedesktop.org/building.html
3
4 However, it is slightly more messy
5 :) If you encounter things you find unclear, and know of a better way of
6 expressing it, then please send a patch:)
7
8 Qt-Compositor is meant as a toolbox for making new funky Wayland compositors.
9
10 Pre-requisites on Linux (apt-get): git, autoconf, automake, libtool, libexpat1-dev
11 Pre-requisites on Mac OSX Snow Leopard: git, latest Gnu autoconf, latest Gnu automake, latest Gnu libtool, latest pkg-config.
12 Make sure you have /usr/local/bin on the $PATH before /usr/bin
13   
14 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
15  
16 # sudo apt-get install libffi-dev
17 On Mac ffi is part of the OS but you need to tell the the wayland configure
18 export FFI_CFLAGS=-I/usr/include/ffi
19 export FFI_LIBS-lffi
20
21 Qt-Compositor contains a copy of the Wayland libraries. We have not changed
22 them in any way, but they are provided for convenience so that you can compile
23 everything using qmake. However, I suggest you use the official Wayland
24 libraries. The only dependency they have is to ffi. The demos has some more
25 dependencies, but we are not going to compile those.
26
27 2. Clone Wayland from: git://anongit.freedesktop.org/wayland/wayland
28 # git clone git://anongit.freedesktop.org/wayland/wayland
29
30 3. Compile Wayland: ./autogen.sh -prefix=$HOME/install && make && make install
31
32 4. Set your PKG_CONFIG_PATH so that the location of the Wayland libraries are
33 picked up by Qt's configure. 
34 # export PKG_CONFIG_PATH=$HOME/install/lib/pkgconfig/
35
36 6. Set the library path to pick up the Wayland libraries
37 # export LD_LIBRARY_PATH=$HOME/install/lib
38
39 8. Get the build dependencies that you need for QtGui.
40 # sudo apt-get build-dep libqt4-gui
41
42 One of the dependencies that the wayland-demos compositor and client
43 applications has is xkbcommon. The Qt-Lighthouse wayland plugin has code to
44 read xkbcommon codes sent over the wayland protocol, so that Qt-Lighthouse
45 clients on Wayland will get keyboard functionality in other compositors.
46 However, Qt-Compositor doesn't have this requirement. The support for xkbcommon
47 is picked up by configure. If it is not detected the Wayland plug-in will be
48 compiled with the: QT_NO_WAYLAND_XKB.
49
50 libxkbcommon is available from: git://people.freedesktop.org/xorg/lib/libxkbcommon.git
51 Use typically the following line to configure it:
52 # ./autogen.sh --prefix=$HOME/install --with-xkb-config-root=/usr/share/X11/xkb
53
54 Its a good idea to use out of source builds when building Qt. A good setup
55 could be: $HOME/dev/qt-src/lighthouse where lighthouse is where you have a
56 complete checkout of the lighthouse repository.  Then you can have ie.:
57 $HOME/dev/qt-builds/lighthouse-debug
58
59 9. Clone Lighthouse from gitorious
60 # git clone git@gitorious.org:+qt-developers/qt/lighthouse.git
61 # $HOME/dev/qt-src/lighthouse
62 (you might want to use git remote etc. if you already have a clone of
63 qt-master)
64
65 10. Configure and compile Qt-Lighthouse. So from
66 $HOME/dev/qt-builds/lighthouse-debug do: ../../qt-src/lighthouse/configure -qpa
67 -developer-build && make
68
69 11. OK, now we have Lighthouse and Wayland libs on our system. To try Wayland
70 out we want the compositor to render into a XWindow(this is for development).
71 So we need to compile up a X back-end for lighthouse. They don't get built
72 automatically (yet). The Wayland plug-in will be ma
73
74 Go into the directory: $HOME/dev/qt-src/lighthouse/src/plugins/platforms/xcb
75 # make
76
77 12. When this is done, you are ready to compile the qwidget-compositor.  Enter
78 the directory with $QT-COMPOSITOR-DIR/examples/qwidget-compositor #qmake &&
79 make
80
81 Makes generates a executable in $QT-COMPOSITOR-DIR/bin. Execute it and pass in
82 -platform xcb
83 # $QT-COMPOSITOR-DIR/bin/qt-compositor -platform xcb
84
85 This should give you a blank window. If you now open a another terminal with
86 LD_LIBRARY_PATH set and run a simple Qt example with the -platform Wayland, it
87 should render into this window.