summaryrefslogtreecommitdiff
path: root/doc/guide/files/gnome.xml
blob: e34a6e8ee8244d116cd49048a0268bffee89ddaf (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
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<!-- $NetBSD: gnome.xml,v 1.7 2006/12/15 13:22:14 martti Exp $ -->

<chapter id="gnome"> <?dbhtml filename="gnome.html"?>
<title>GNOME packaging and porting</title>

<para>Quoting <ulink url="http://www.gnome.org/">GNOME's web
site</ulink>:</para>

<blockquote>
  <para>The GNOME project provides two things: The GNOME desktop
  environment, an intuitive and attractive desktop for users, and the
  GNOME development platform, an extensive framework for building
  applications that integrate into the rest of the desktop.</para>
</blockquote>

<para>pkgsrc provides a seamless way to automatically build and install
a complete GNOME environment <emphasis>under many different
platforms</emphasis>.  We can say with confidence that pkgsrc is one of
the most advanced build and packaging systems for GNOME due to its
included technologies buildlink3, the wrappers and tools framework and
automatic configuration file management.  Lots of efforts are put into
achieving a completely clean deinstallation of installed software
components.</para>

<para>Given that pkgsrc is <ulink
url="http://www.NetBSD.org/">NetBSD</ulink>'s official packaging system,
the above also means that great efforts are put into making GNOME work
under this operating system.  Recently, <ulink
url="http://www.dragonflybsd.org/">DragonFly BSD</ulink> also adopted
pkgsrc as its preferred packaging system, contributing lots of
portability fixes to make GNOME build and install under it.</para>

<para>This chapter is aimed at pkgsrc developers and other people
interested in helping our GNOME porting and packaging efforts.  It
provides instructions on how to manage the existing packages and some
important information regarding their internals.</para>

<note>
  <title>We need your help!</title>

  <para>Should you have some spare cycles to devote to NetBSD, pkgsrc
  and GNOME and are willing to learn new exciting stuff, please jump
  straight to the <ulink
  url="http://www.NetBSD.org/contrib/projects.html#gnome">pending
  work</ulink> list!  There is still a long way to go to get a
  fully-functional GNOME desktop under NetBSD and we need your help to
  achieve it!</para>
</note>

<sect1 id="meta-packages">
<title>Meta packages</title>

<para>pkgsrc includes three GNOME-related meta packages:</para>

<itemizedlist>
  <listitem>
    <para><filename role="pkg">meta-pkgs/gnome-base</filename>: Provides
    the core GNOME desktop environment.  It only includes the necessary
    bits to get it to boot correctly, although it may lack important
    functionality for daily operation.  The idea behind this package is
    to let end users build their own configurations on top of this one,
    first installing this meta package to achieve a functional setup and
    then adding individual applications.</para>
  </listitem>

  <listitem>
    <para><filename role="pkg">meta-pkgs/gnome</filename>: Provides a
    complete installation of the GNOME platform and desktop as defined
    by the GNOME project; this is based on the components distributed in
    the <filename>platform/x.y/x.y.z/sources</filename> and
    <filename>desktop/x.y/x.y.z/sources</filename> directories of the
    official FTP server.  Developer-only tools found in those
    directories are not installed unless required by some other
    component to work properly.  Similarly, packages from the bindings
    set (<filename>bindings/x.y/x.y.z/sources</filename>) are not pulled
    in unless required as a dependency for an end-user component.  This
    package "extends" <filename
    role="pkg">meta-pkgs/gnome-base</filename>.</para>
  </listitem>

  <listitem>
    <para><filename role="pkg">meta-pkgs/gnome-devel</filename>:
    Installs all the tools required to build a GNOME component when
    fetched from the CVS repository.  These are required to let the
    <command>autogen.sh</command> scripts work appropriately.</para>
  </listitem>
</itemizedlist>

<para>In all these packages, the <varname>DEPENDS</varname> lines are
sorted in a way that eases updates: a package may depend on other
packages listed before it but not on any listed after it.  It is very
important to keep this order to ease updates so... <emphasis>do not
change it to alphabetical sorting!</emphasis></para>

</sect1>

<sect1 id="new-package">
<title>Packaging a GNOME application</title>

<para>Almost all GNOME applications are written in C and use a common
set of tools as their build system.  Things get different with the new
bindings to other languages (such as Python), but the following will
give you a general idea on the minimum required tools:</para>

<itemizedlist>
  <listitem>
    <para>Almost all GNOME applications use the GNU Autotools as their
    build system.  As a general rule you will need to tell this to your
    package:</para>

    <programlisting>GNU_CONFIGURE=yes
USE_LIBTOOL=yes
USE_TOOLS+=gmake</programlisting>
  </listitem>

  <listitem>
    <para>If the package uses pkg-config to detect dependencies, add this
    tool to the list of required utilities:</para>

    <programlisting>USE_TOOLS+=pkg-config</programlisting>

    <para>Also use <filename role="pkg">pkgtools/verifypc</filename> at
    the end of the build process to ensure that you did not miss to
    specify any dependency in your package and that the version
    requirements are all correct.</para>
  </listitem>

  <listitem>
    <para>If the package uses intltool, be sure to add
    <literal>intltool</literal> to the <varname>USE_TOOLS</varname>
    to handle dependencies and to force the package to use the latest
    available version.</para>
  </listitem>

  <listitem>
    <para>If the package uses gtk-doc (a documentation generation
    utility), do <emphasis>not</emphasis> add a dependency on it.  The
    tool is rather big and the distfile should come with pregenerated
    documentation anyway; if it does not, it is a bug that you ought to
    report.  For such packages you should disable gtk-doc (unless it is
    the default):</para>

    <programlisting>CONFIGURE_ARGS+=--disable-gtk-doc</programlisting>

    <para>The default location of installed HTML files
    (<filename>share/gtk-doc/&lt;package-name&gt;</filename>) is correct
    and should not be changed unless the package insists on installing
    them somewhere else.  Otherwise programs as
    <command>devhelp</command> will not be able to open them.  You can
    do that with an entry similar to:</para>

    <programlisting>CONFIGURE_ARGS+=--with-html-dir=${PREFIX}/share/gtk-doc/...</programlisting>
  </listitem>
</itemizedlist>

<para>GNOME uses multiple <emphasis>shared</emphasis> directories and
files under the installation prefix to maintain databases.  In this
context, shared means that those exact same directories and files are
used among several different packages, leading to conflicts in the
<filename>PLIST</filename>.  pkgsrc currently includes functionality to
handle the most common cases, so you have to forget about using
<literal>@unexec ${RMDIR}</literal> lines in your file lists and
omitting shared files from them.  If you find yourself doing those,
<emphasis>your package is most likely incorrect</emphasis>.</para>

<para>The following table lists the common situations that result in
using shared directories or files.  For each of them, the appropriate
solution is given.  After applying the solution be sure to
<emphasis>regenerate the package's file list</emphasis> with
<command>make print-PLIST</command> and ensure it is correct.</para>

<table id="plist-handling">
  <title>PLIST handling for GNOME packages</title>

  <tgroup cols="2">
    <thead>
      <row>
        <entry>If the package...</entry>
        <entry>Then...</entry>
      </row>
    </thead>

    <tbody>
      <row>
        <entry>Installs OMF files under <filename>share/omf</filename>.</entry>
        <entry>See <xref linkend="scrollkeeper-data-files" />.</entry>
      </row>

      <row>
        <entry>Installs icons under the
        <filename>share/icons/hicolor</filename> hierarchy or updates
        <filename>share/icons/hicolor/icon-theme.cache</filename>.</entry>
        <entry>See <xref linkend="hicolor-theme" />.</entry>
      </row>

      <row>
        <entry>Installs files under
        <filename>share/mime/packages</filename>.</entry>
        <entry>See <xref linkend="mime-database" />.</entry>
      </row>

      <row>
        <entry>Installs <filename>.desktop</filename> files under
        <filename>share/applications</filename> and these include MIME
        information.</entry>
        <entry>See <xref linkend="desktop-files" />.</entry>
      </row>
    </tbody>
  </tgroup>
</table>

</sect1>

<sect1 id="full-update">
<title>Updating GNOME to a newer version</title>

<para>When seeing GNOME as a whole, there are two kinds of
updates:</para>

<variablelist>
  <varlistentry>
    <term>Major update</term>

    <listitem>
      <para>Given that there is still a very long way for GNOME 3 (if it
      ever appears), we consider a major update one that goes from a
      <literal>2.X</literal> version to a <literal>2.Y</literal> one,
      where <literal>Y</literal> is even and greater than
      <literal>X</literal>.  These are hard to achieve because they
      introduce lots of changes in the components' code and almost all
      GNOME distfiles are updated to newer versions.  Some of them can
      even break API and ABI compatibility with the previous major
      version series.  As a result, the update needs to be done all at
      once to minimize breakage.</para>

      <para>A major update typically consists of around 80 package
      updates and the addition of some new ones.</para>
    </listitem>
  </varlistentry>

  <varlistentry>
    <term>Minor update</term>

    <listitem>
      <para>We consider a minor update one that goes from a
      <literal>2.A.X</literal> version to a <literal>2.A.Y</literal>
      one where <literal>Y</literal> is greater than
      <literal>X</literal>.  These are easy to achieve because they do
      not update all GNOME components, can be done in an incremental way
      and do not break API nor ABI compatibility.</para>

      <para>A minor update typically consists of around 50 package
      updates, although the numbers here may vary a lot.</para>
    </listitem>
  </varlistentry>
</variablelist>

<para>In order to update the GNOME components in pkgsrc to a new stable
release (either major or minor), the following steps should be
followed:</para>

<orderedlist>
  <listitem>
    <para>Get a list of all the tarballs that form the new release by
    using the following commands.  These will leave the full list of the
    components's distfiles into the <filename>list.txt</filename>
    file:</para>

    <screen>&cprompt; <userinput>echo ls "*.tar.bz2" | \
    ftp -V ftp://ftp.gnome.org/pub/gnome/platform/x.y/x.y.z/sources/ | \
    awk '{ print $9 }' &gt;list.txt</userinput>
&cprompt; <userinput>echo ls "*.tar.bz2" | \
    ftp -V ftp://ftp.gnome.org/pub/gnome/desktop/x.y/x.y.z/sources/ | \
    awk '{ print $9 }' &gt;&gt;list.txt</userinput></screen>
  </listitem>

  <listitem>
    <para>Open each meta package's <filename>Makefile</filename> and
    bump their version to the release you are updating them to.  The
    three meta packages should be always consistent with versioning.
    Obviously remove any <varname>PKGREVISION</varname>s that might be
    in them.</para>
  </listitem>

  <listitem>
    <para>For each meta package, update all its
    <varname>DEPENDS</varname> lines to match the latest versions as
    shown by the above commands.  Do <emphasis>not</emphasis> list any
    newer version (even if found in the FTP) because the meta packages
    are supposed to list the exact versions that form a specific GNOME
    release.  Exceptions are permitted here if a newer version solves a
    serious issue in the overall desktop experience; these typically
    come in the form of a revision bump in pkgsrc, not in newer versions
    from the developers.</para>

    <para>Packages not listed in the <filename>list.txt</filename> file
    should be updated to the latest version available (if found in
    pkgsrc).  This is the case, for example, of the dependencies on the
    GNU Autotools in the <filename
    role="pkg">meta-pkgs/gnome-devel</filename> meta package.</para>
  </listitem>

  <listitem>
    <para>Generate a patch from the modified meta packages and extract the
    list of "new" lines.  This will provide you an outline on what
    packages need to be updated in pkgsrc and in what order:</para>

    <screen>&cprompt; <userinput>cvs diff -u gnome-devel gnome-base gnome | grep '^+D' &gt;todo.txt</userinput></screen>
  </listitem>

  <listitem>
    <para>For major desktop updates it is recommended to zap all your
    installed packages and start over from scratch at this point.</para>
  </listitem>

  <listitem>
    <para>Now comes the longest step by far: iterate over the contents
    of <filename>todo.txt</filename> and update the packages listed in
    it in order.  For major desktop updates none of these should be
    committed until the entire set is completed because there are chances
    of breaking not-yet-updated packages.</para>
  </listitem>

  <listitem>
    <para>Once the packages are up to date and working, commit them to
    the tree one by one with appropriate log messages.  At the end,
    commit the three meta package updates and all the corresponding
    changes to the <filename>doc/CHANGES-&lt;YEAR&gt;</filename> and
    <filename role="cvsweb">pkgsrc/doc/TODO</filename> files.</para>
  </listitem>
</orderedlist>

</sect1>

<sect1 id="patching">
<title>Patching guidelines</title>

<para>GNOME is a very big component in pkgsrc which approaches 100
packages.  Please, it is very important that you always, always,
<emphasis role="strong">always</emphasis> feed back any portability
fixes you do to a GNOME package to the mainstream developers (see <xref
linkend="components.patches.feedback" />).  This is the only way to get
their attention on portability issues and to ensure that future versions
can be built out-of-the box on NetBSD.  The less custom patches in
pkgsrc, the easier further updates are.  Those developers in charge of
issuing major GNOME updates will be grateful if you do that.</para>

<para>The most common places to report bugs are the <ulink
url="http://bugzilla.gnome.org/">GNOME's Bugzilla</ulink> and the <ulink
url="http://bugzilla.freedesktop.org/">freedesktop.org's
Bugzilla</ulink>.  Not all components use these to track bugs, but most
of them do.  Do not be short on your reports: always provide detailed
explanations of the current failure, how it can be improved to achieve
maximum portability and, if at all possible, provide a patch against CVS
head.  The more verbose you are, the higher chances of your patch being
accepted.</para>

<para>Also, please avoid using preprocessor magic to fix portability
issues.  While the FreeBSD GNOME people are doing a great job in porting
GNOME to their operating system, the official GNOME sources are now
plagued by conditionals that check for <varname>__FreeBSD__</varname>
and similar macros.  This hurts portability.  Please see our patching
guidelines (<xref linkend="components.patches.guidelines" />) for more
details.</para>

</sect1>

</chapter>