This file is indexed.

/usr/share/doc/xorg/reference/dependencies.html is in xserver-xorg 1:7.6+12ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.6" />
<title>Dependencies between server and drivers</title>
<link rel="stylesheet" href="../xsf.css" type="text/css" />
<script type="text/javascript" src="../asciidoc-xhtml11.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install(2);
/*]]>*/
</script>
</head>
<body class="article">
<div id="header">
<h1><a href="../index.html">XSF</a> / Dependencies between server and drivers</h1>
<span id="author">Cyril Brulebois</span><br />
<span id="email"><tt>&lt;<a href="mailto:kibi@debian.org">kibi@debian.org</a>&gt;</tt></span><br />
<div id="toc">
  <div id="toctitle">Table of Contents</div>
  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="_upstream_side_abi_version_numbers">Upstream-side: ABI version numbers</h2>
<div class="sectionbody">
<div class="paragraph"><p>The X server defines several
<a href="http://en.wikipedia.org/wiki/Application_binary_interface">ABI</a> version numbers in the
<tt>hw/xfree86/common/xf86Module.h</tt> header, through the
<tt>SET_ABI_VERSION(maj,min)</tt> macro. In this document, the focus is on
<tt>ABI_VIDEODRV_VERSION</tt> and <tt>ABI_XINPUT_VERSION</tt>, which are
respectively about <tt>video</tt> drivers and <tt>input</tt> drivers.</p></div>
<div class="paragraph"><p>An example of input ABI is <tt>12.1</tt>, <tt>12</tt> being the <tt>major</tt>, <tt>1</tt> being
the <tt>minor</tt>.</p></div>
<div class="paragraph"><p>Like in usual shared libraries, the major is bumped when interfaces
are broken. There’s no compatibility at all in that case.</p></div>
<div class="paragraph"><p>The minor gets bumped when interfaces are added. In other words, if a
driver is working with <tt>x.y</tt>, it should also work with higher minors:
<tt>x.z</tt>; <tt>z&gt;y</tt>. The converse is not true, if a driver requires a given
minor (for example because it needs a new feature, like MultiTouch),
it won’t work with lower minors (which didn’t provide the needed
feature). Put another way: we have ascending compatibility with the
minors.</p></div>
<div class="paragraph"><p>Conclusion: We need to keep track of both major and minor.</p></div>
<div class="paragraph"><p>Thanks to <tt>pkg-config</tt> we can query them:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ pkg-config --variable=abi_videodrv xorg-server
9.0
$ pkg-config --variable=abi_xinput xorg-server
12.1</tt></pre>
</div></div>
<div style="page-break-after:always"></div>
</div>
</div>
<div class="sect1">
<h2 id="_debian_side_using_virtual_packages">Debian-side: Using virtual packages</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_server_s_build_system">Server’s build system</h3>
<div class="paragraph"><p>When <tt>xorg-server</tt> gets built, we use <tt>pkg-config</tt>’s output to
determine the current major. Through substitution variables, we add
two virtual packages in the <tt>Provides</tt> field of the server (for both
<tt>xserver-xorg-core</tt> and <tt>xserver-xorg-core-udeb</tt>): <tt>xorg-input-abi-$x</tt>
and <tt>xorg-video-abi-$y</tt>, where <tt>$x</tt> and <tt>$y</tt> are the major part of the
version queried through <tt>pkg-config</tt> variables.</p></div>
<div class="paragraph"><p>To handle ascending compatibility for minors, we maintain in
<tt>debian/serverminver</tt> the minimal version of <tt>xserver-xorg-core</tt> which
is needed. When a minor is bumped, we store the server version in that
file. This way, drivers built afterwards will depend on a <strong>minimal</strong>
version of the driver, the last which saw a minor version bump. In
other words: they will “depend on the server version they were built
against, or a higher/compatible one”.</p></div>
<div class="paragraph"><p>Both ABI and minimal server version are recorded in two files shipped
in <tt>xserver-xorg-dev</tt>, to be used while building drivers:</p></div>
<div class="ulist"><ul>
<li>
<p>
<tt>/usr/share/xserver-xorg/xinputdep</tt>
</p>
</li>
<li>
<p>
<tt>/usr/share/xserver-xorg/videodrvdep</tt>
</p>
</li>
</ul></div>
<div class="paragraph"><p>Example for <tt>xinputdep</tt>:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>xorg-input-abi-11, xserver-xorg-core (&gt;= 2:1.8.99.904)</tt></pre>
</div></div>
<div class="paragraph"><p>To make sure we bump the <tt>debian/serverminver</tt> when there’s a minor
ABI change, there’s a <tt>abibumpcheck</tt> target (on which <tt>clean</tt>
depends), which extracts input and video ABI from the upstream header,
and compares them to the previous ones stored in
<tt>debian/serverminver</tt>, failing and diffing is something changed.</p></div>
</div>
<div class="sect2">
<h3 id="_driver_s_control_file">Driver’s control file</h3>
<div class="paragraph"><p>Drivers also use substitution variables in their control file,
replaced at build time.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt># Input driver:
Depends: ${xinpdriver:Depends}, …
Provides: ${xinpdriver:Provides}

# Video driver:
Depends: ${xviddriver:Depends}, …
Provides: ${xviddriver:Provides}</tt></pre>
</div></div>
<div class="paragraph"><p>For now, <tt>${xinpdriver:Provides}</tt> is always replaced with
<tt>xorg-driver-input</tt>, and <tt>${xviddriver:Provides}</tt> is always replaced
with <tt>xorg-driver-video</tt>. Hopefully provided packages will not change,
but using substitution variables is cheap, and makes it easy to add
tweaks afterwards if needed.</p></div>
</div>
<div class="sect2">
<h3 id="_driver_s_build_system">Driver’s build system</h3>
<div class="paragraph"><p>To set those variables, we ship a <tt>dh_xsf_substvars</tt> script in
<tt>xserver-xorg-dev</tt> starting with <tt>2:1.9.4</tt>, to be run before
<tt>dh_gencontrol</tt>. It iterates on the packages listed by
<tt>dh_listpackages</tt> (very old <tt>debhelper</tt> command) and does the
following work:</p></div>
<div class="ulist"><ul>
<li>
<p>
It reads variables from the files mentioned above.
</p>
</li>
<li>
<p>
If a package name ends with <tt>-udeb</tt>, it replaces
   <tt>xserver-xorg-core</tt> with <tt>xserver-xorg-core-udeb</tt>.
</p>
</li>
<li>
<p>
If a package name ends with <tt>-dbg</tt>, it does nothing for this
   package. Debug packages usually depend strictly on the non-debug
   packages, which in turn have appropriate dependencies.
</p>
</li>
<li>
<p>
If a package name starts with <tt>xserver-xorg-input-</tt>, it appends
   <tt>xinpdriver:Depends=…</tt> and <tt>xinpdriver:Provides=…</tt> to this
   package’s substvars file.
</p>
</li>
<li>
<p>
If a package name starts with <tt>xserver-xorg-video-</tt>, it appends
   <tt>xviddriver:Depends=…</tt> and <tt>xviddriver:Provides=…</tt> to this
   package’s substvars file.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Why such heuristics? The idea is to avoid getting “unused substitution
variable” warning messages while building. And since there’s a clear
<tt>xserver-xorg-{input,video}-*</tt> namespace, we can use that to specify
only input-related variables for input drivers, and only video-related
variables for video drivers.</p></div>
<div class="paragraph"><p>To make it easy to compute substvars when using <tt>dh</tt>, a <tt>dh</tt> sequence
(<tt>xsf.pm</tt>) is shipped. As of <tt>2:1.9.4-1</tt>, it inserts
<tt>dh_xsf_substvars</tt> right before the <tt>dh_gencontrol</tt> call. Other
repetitive tasks could also be automated this way.</p></div>
<div style="page-break-after:always"></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_sample_driver_packaging">Sample driver packaging</h2>
<div class="sectionbody">
<div class="paragraph"><p>The following assumes:</p></div>
<div class="ulist"><ul>
<li>
<p>
The upstream build system is sane enough, which lets us run
   <tt>autoreconf</tt> at build time.
</p>
</li>
<li>
<p>
It is a <tt>video</tt> driver. For an <tt>input</tt> driver, replace both
   <tt>xviddriver</tt> occurrences with <tt>xinpdriver</tt>.
</p>
</li>
</ul></div>
<div class="sect2">
<h3 id="_sample_debian_control_file">Sample debian/control file</h3>
<div class="listingblock">
<div class="content">
<pre><tt>Build-Depends:
 debhelper (&gt;= 8),
 dh-autoreconf,
 quilt,
 xserver-xorg-dev (&gt;= 2:1.9.4),</tt></pre>
</div></div>
<div class="listingblock">
<div class="content">
<pre><tt>Depends:
 ${shlibs:Depends},
 ${misc:Depends},
 ${xviddriver:Depends},
Provides:
 ${xviddriver:Provides}</tt></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_sample_debian_rules_file">Sample debian/rules file</h3>
<div class="listingblock">
<div class="content">
<pre><tt>#!/usr/bin/make -f

# Configuration:
#override_dh_auto_configure:
#        dh_auto_configure -- --with-FOO --without-BAR

# Install in debian/tmp to retain control through dh_install:
override_dh_auto_install:
        dh_auto_install --destdir=debian/tmp

# Kill *.la files, and forget no-one:
override_dh_install:
        find debian/tmp -name '*.la' -delete
        dh_install --fail-missing

## Debug package:
#override_dh_strip:
#        dh_strip --dbg-package=xserver-xorg-video-DRIVER-dbg

# That's a plugin, use appropriate warning level:
override_dh_shlibdeps:
        dh_shlibdeps -- --warnings=6

%:
        dh $@ --with quilt,autoreconf,xsf --builddirectory=build/</tt></pre>
</div></div>
<div class="paragraph"><p>Some comments:</p></div>
<div class="ulist"><ul>
<li>
<p>
<tt>dh_auto_configure</tt>: Commented out since there’s usually no
   specific option to pass when building drivers. Sometimes needed to
   get a related utility built.
</p>
</li>
<li>
<p>
<tt>dh_auto_install</tt>: It behaves differently when operating on a
   single package (it installs under <tt>debian/PACKAGE</tt> instead of
   <tt>debian/tmp</tt>), so make it use <tt>debian/tmp</tt> in all cases. This way,
   <tt>dh_install</tt> has to be used (see below). That also means that a
   binary package (<em>e.g.</em> a debug package) can be added without
   changing this part.
</p>
</li>
<li>
<p>
<tt>dh_install</tt>: No point in keeping the <tt>.la</tt> files. Also, using
   <tt>--fail-missing</tt> makes sure every file installed by upstream is
   installed in some package, or explicitly ignored.
</p>
</li>
<li>
<p>
<tt>dh_strip</tt>: Commented out, there’s only a few drivers shipping a
   debug package.
</p>
</li>
<li>
<p>
<tt>dh_shlibdeps</tt>: The comment really says it all.
</p>
</li>
<li>
<p>
<tt>dh</tt>: The order is important! We want patching to happen before
   autoreconfiguring (both <tt>quilt</tt> and <tt>autoreconf</tt> insert commands
   before <tt>dh_auto_configure</tt>, and after <tt>dh_clean</tt>). Also, we build
   out-of-tree. The <tt>xsf</tt> sequence is explained in the previous part.
</p>
</li>
</ul></div>
<div class="paragraph"><p>If one needs to build several flavours,
<a href="http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-fbdev.git;a=blob;f=debian/rules"><tt>fbdev</tt>’s rules file</a>
can be used as an example.</p></div>
<div style="page-break-after:always"></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_staying_tuned">Staying tuned</h2>
<div class="sectionbody">
<div class="paragraph"><p>Staying informed of driver-related changes can be a bit difficult in
the following cases:</p></div>
<div class="ulist"><ul>
<li>
<p>
If one maintains a single driver within the X Strike Force, one
   might not notice the few mails about drivers in the heavy mail flow
   on <tt>debian-x@</tt>.
</p>
</li>
<li>
<p>
If one maintains a driver outside the X Strike Force, one is
   probably not subscribed to the mailing list at all.
</p>
</li>
</ul></div>
<div class="paragraph"><p>For those reasons, a mail alias is being set up to gather all
maintainers interested in receiving driver-related mails.</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2011-06-06 07:22:56 UTC
</div>
</div>
</body>
</html>