summaryrefslogtreecommitdiff
path: root/building.html
blob: 68cf39e87480c995518003f4f5272549109ac966 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 

<head> 
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> 
<link href="wayland.css" rel="stylesheet" type="text/css">
<title>Wayland</title> 
</head>

<body>
<h1><img src="wayland.png"></h1>

<p>The instructions below assume some familiarity with git and
building and running experimental software.  And be prepared that this
project isn't at all useful right now, it's still very much a
prototype.  When the instructions suggest to clone a git repo, you can
of course just add a remote and fetch instead, if you have a clone of
that repo around already.  I usually install all software I'm working
on into $HOME/install, so that's what I'll use in the instructions
below, but you can use your favorite directory of course or install
over your system copy (pass --prefix=/usr --sysconfdir=/etc,
generally).</p>

<h2>Modesetting</h2>

<p>At this point, kernel modesetting is upstream for Intel, AMD and
nVidia chipsets.  Most distributions ship with kernel modesetting
enabled by default and will work with Wayland out of the box.  The
modesetting driver must also support the page flip ioctl, which only
the intel driver does at this point.</p>


<h2>Building mesa</h2>

<p>Wayland uses the mesa EGL stack, and all extensions required to run
EGL on KMS are now upstream on the master branch.  The 7.9 release of
mesa has all these extensions, but for the shm buffer feature you'll
need the GL_EXT_texture_format_BGRA8888 extension from mesa
master:</p>

<pre>
    $ git clone git://anongit.freedesktop.org/mesa/mesa
    $ cd mesa
    $ ./configure --prefix=$HOME/install  --enable-egl --enable-gles2
    $ make && make install
</pre>

<p>If you're using an intel chipset, it's best to also pass
<code>--disable-gallium</code> to ./configure, since otherwise libEGL
will try to load the gallium sw rasterizer before loading the Intel
DRI driver.</p>


<h2>libxkbcommon</h2>

<p>Wayland needs libxkbcommon for translating evdev keycodes to
keysyms.  For this you'll need development packages for xproto,
kbproto and libX11.</p>

<pre>
    $ git clone git://people.freedesktop.org/xorg/lib/libxkbcommon.git
    $ cd libxkbcommon/
    $ ./autogen.sh --prefix=$HOME/install
    $ make && make install
</pre>

<h2>cairo-gl</h2>

<p>The Wayland clients can render using cairo-gl, but fall back to
software when cairo-gl is not available.  cairo-gl is an experimental
cairo backend and has been available since cairo 1.10.  Unless your
distribution ships cairo with the gl backend enabled, you'll need to
compile your own version of cairo:</p>

<pre>
    $ git clone git://anongit.freedesktop.org/cairo
    $ cd cairo
    $ ./autogen.sh --prefix=$HOME/install --enable-gl
    $ make && make install
</pre>

<h2>Wayland</h2>

<p>With mesa and libxkbcommon in place, we can checkout and build
Wayland.  Aside from mesa, Wayland needs development packages for
gdk-pixbuf-2.0, libudev, libdrm, xcb-dri2, xcb-fixes (for X
compositor) cairo-gl, glib-2.0, gdk-2.0 (for poppler) and
poppler-glib:</p>

<pre>
    $ git clone git://anongit.freedesktop.org/wayland
    $ ./autogen.sh --prefix=$HOME/install --sysconfdir=/etc
    $ make && make install
</pre>

<p>Installing into a non-/usr prefix is fine, but the 70-wayland.rules
udev rule file has to be installed in /etc/udev/rules.d.  Once
installed, either reboot or run</p>

<pre>
    $ sudo udevadm trigger --subsystem-match=drm --subsystem-match=input
</pre>

<p>to make udev label the devices wayland will use.</p>

<p>If DISPLAY is set, the wayland compositor will run under X in a
window and take input from X.  Otherwise it will run on the KMS
framebuffer and take input from evdev devices.  Pick a background
image that you like and copy it to the Wayland source directory as
background.jpg or use the -b command line option:</p>

<pre>
    $ ./compositor -b my-image.jpg
</pre>

<p>To run clients, switch to a different VT and run the client from
there.  Or run it under X and start up the clients from a terminal
window.  There are a few demo clients available, but they are all
pretty simple and mostly for testing specific features in the wayland
protocol: 'terminal' is a simple terminal emulator, not very compliant
at all, but works well enough for bash</p>

<ul>
  <li>'flower' moves a flower around the screen, testing the frame protocol</li>
  <li>'gears' glxgears, but for wayland, currently broken</li>
  <li>'image' loads the image files passed on the command line and
  shows them</li>

  <li>'view' does the same for pdf files, but needs file URIs
    (file:///path/to/pdf)</li>
</ul>

</body>
</html>