1 <chapter id="getting-wine">
2 <title>Getting Wine</title>
5 <title>The Many Forms of Wine</title>
7 The standard Wine distribution includes quite a few different
8 executables, libraries, and configuration files. All of these
9 must be set up properly for Wine to work well. This chapter
10 will guide you through the necessary steps to get Wine
11 installed on your system.
14 If you are running a distribution of Linux that uses packages
15 to keep track of installed software, you may be in luck: A
16 prepackaged version of Wine may already exist for your system.
17 The first three sections will tell you how to find the latest
18 Wine packages and get them installed. You should be careful,
19 though, about mixing packages between different distributions,
20 and even from different versions of the same distribution.
21 Often a package will only work on the distribution it's
22 compiled for. We'll cover <link
23 linkend="getting-dist-debian">Debian</link>, <link
24 linkend="getting-dist-redhat">Redhat</link>, and <link
25 linkend="getting-dist-other">other</link> distributions.
28 If you're not lucky enough to have a package available for
29 your operating system, or if you'd prefer a newer version of
30 Wine than already exists as a package, you may have to
31 download the Wine source code and compile it yourself on your
32 own machine. Don't worry, it's not too hard to do this,
33 especially with the many helpful tools that come with Wine.
34 You don't need any programming experience to compile and
35 install Wine, although it might be nice to have some minor
36 UNIX administrative skills. We'll cover how to retrieve and
37 compile the official source releases from the <link
38 linkend="getting-source-ftp">FTP archives</link>, and also how
39 to get the cutting edge up-to-the-minute fresh Wine source
40 code from <link linkend="getting-source-cvs">CVS (Concurrent
41 Versions System)</link>. Both processes of source code
42 installation are similar, and once you master one, you should
43 have no trouble dealing with the other one.
46 Finally, you may someday need to know how to apply a source
47 code patch to your version of Wine. Perhaps you've uncovered
48 a bug in Wine, reported it to the <ulink
49 url="mailto:wine-devel@winehq.com">Wine mailing list</ulink>,
50 and received a patch from a developer to hopefully fix the
51 bug. The last section in this chapter will show you how to
52 <link linkend="getting-upgrading">safely apply the
53 patch</link> and revert it if the patch doesn't work.
57 <sect1 id="getting-dist-debian">
58 <title>Getting Wine for a Debian System</title>
61 In most cases on a Debian system, you can install Wine with a
62 single command, as root:
65 # apt-get install wine
68 <command>apt-get</command> will connect to a Debian archive
69 across the Internet (thus, you must be online), then download
70 the Wine package and install it on your system. End of story.
74 Of course, Debian's pre-packaged version of Wine may not be the
75 most recent release. If you are running the stable version of
76 Debian, you may be able to get a slightly newer version of Wine
77 by grabbing the package from the unstable distribution, although
78 this may be a little risky, depending on how far the unstable
79 distribution has diverged from the stable one. You can find a
80 list of Wine binary packages for the various Debian releases
81 using the package search engine at <ulink url="http://www.debian.org">
82 www.debian.org</ulink>.
86 To install a package that's not part of your distribution, you
87 must use <command>dpkg</command> instead of
88 <command>apt-get</command>. Since <command>dpkg</command>
89 doesn't download the file for you, you must do it yourself.
90 Follow the link on the package search engine to the desired
91 package, then click on the <guibutton>Go To Download
92 Page</guibutton> button and follow the instructions. Save the
93 file to your hard drive, then run <command>dpkg</command> on it.
94 For example, if you saved the file to your home directory, you
95 might perform the following actions to install it:
99 <emphasis><Type in root password></emphasis>
101 # dpkg -i wine_0.0.20000109-3.deb
104 You may also want to install the
105 <systemitem>wine-doc</systemitem> package, and if you are
106 using Wine from the 2.3 distribution (Woody), the
107 <systemitem>wine-utils</systemitem> package as well.
111 <sect1 id="getting-dist-redhat">
112 <title>Getting Wine for a Redhat System</title>
115 Redhat/RPM users can use <ulink url="http://rpmfind.net/linux/RPM/">
116 rpmfind.net</ulink> to track down available Wine RPM binaries.
117 <ulink url="http://rpmfind.net/linux/RPM/WByName.html"> This
118 page</ulink> contains a list of all rpmfind packages that start with
119 the letter "W", including a few Wine packages
122 <!-- *** Should really flesh this out more! Any Redhat-running
128 <sect1 id="getting-dist-other">
129 <title>Getting Wine for Other Distributions</title>
132 The first place you should look if your system isn't Debian or
134 url="http://www.winehq.com/download/">WineHQ Download
135 Page</ulink>. This page lists many assorted archives of
136 binary (precompiled) Wine files.
140 <ulink url="http://ftpsearch.lycos.com/?form=medium">
141 Lycos FTPSearch</ulink> is another useful resource for
142 tracking down miscellaneous distribution packages.
145 <!-- *** Add other distributions, e.g., Mandrake, SUSE, Slackware *** -->
149 <sect1 id="getting-source-ftp">
150 <title>Getting Wine Source Code from the FTP Archive</title>
153 If the version of Wine you want does not exist in package form,
154 you can download the source code yourself and compile it on your
155 machine. Although this might seem a little intimidating at
156 first if you've never done it, you'll find that it'll often go
157 quite smoothly, especially on the newer Linux distributions.
161 The safest way to grab the source is from one of the official
162 FTP archives. An up to date listing is in the <ulink
163 url="http://www.winehq.com/source/ANNOUNCE">ANNOUNCE</ulink>
164 file in the Wine distribution (which you would have if you
165 already downloaded it). Here is a (possibly out of date) list
166 of FTP servers carrying Wine:
171 <ulink url="ftp://ftp.ibiblio.org/pub/Linux/ALPHA/wine/development/">
172 ftp://ftp.ibiblio.org/pub/Linux/ALPHA/wine/development/
178 <ulink url="ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/">
179 ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/
185 <ulink url="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/sunsite.unc.edu/ALPHA/wine/development/">
186 ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/sunsite.unc.edu/ALPHA/wine/development/
192 <ulink url="ftp://orcus.progsoc.uts.edu.au/pub/Wine/development/">
193 ftp://orcus.progsoc.uts.edu.au/pub/Wine/development/
199 The official releases are tagged by date with the format
200 "Wine-YYYYMMDD.tar.gz". Your best bet is to grab the latest
204 FIXME: Explain how to un-tar, compile, and install Wine from a tarball.
210 <sect1 id="getting-source-cvs">
211 <title>Getting Wine Source Code from CVS</title>
214 The official web page for Wine CVS is
215 <ulink url="http://www.winehq.com/development/">
216 http://www.winehq.com/development/</ulink>.
219 First, you need to get a copy of the latest Wine sources
220 using CVS. You can tell it where to find the source tree by
221 setting the <envar>CVSROOT</envar> environment variable. You
222 also have to log in anonymously to the wine CVS server. In
223 <command>bash</command>, it might look something like this:
226 $ export CVSROOT=:pserver:cvs@cvs.winehq.com:/home/wine
232 That'll pull down the entire Wine source tree from
233 winehq.com and place it in the current directory (actually
234 in the 'wine' subdirectory). CVS has a million command line
235 parameters, so there are many ways to pull down files, from
236 anywhere in the revision history. Later, you can grab just
243 <command>cvs update</command> works from inside the source tree.
244 You don't need the <envar>CVSROOT</envar> environment variable
245 to run it either. You just have to be inside the source tree.
246 The <parameter>-P</parameter>, <parameter>-A</parameter> and <parameter>-d</parameter>
247 options make sure your local Wine tree directory structure stays
248 in sync with the remote repository.
251 After you've made changes, you can create a patch with
252 <command>cvs diff -u</command>, which sends output to stdout
253 (the <parameter>-u</parameter> controls the format of the
254 patch). So, to create an <filename>my_patch.diff</filename>
255 file, you would do this:
258 $ cvs diff -u > my_patch.diff
261 You can call <command>cvs diff</command> from anywhere in the
262 tree (just like <command>cvs update</command>), and it will
263 always grab recursively from that point. You can also specify
264 single files or subdirectories:
267 $ cvs diff -u dlls/winaspi > my_aspi_patch.diff
270 Experiment around a little. It's fairly intuitive.
274 <sect1 id="getting-upgrading">
275 <title>Upgrading Wine with a Patch</title>
277 If you have the Wine source code, as opposed to a binary
278 distribution, you have the option of applying patches to the
279 source tree to fix bugs and add experimental features.
280 Perhaps you've found a bug, reported it to the <ulink
281 url="mailto:wine-devel@winehq.com">Wine mailing list</ulink>,
282 and received a patch file to fix the bug. You can apply the
283 patch with the <command>patch</command> command, which takes a
284 streamed patch from <filename>stdin</filename>:
288 $ patch -p0 < ../patch_to_apply.diff
291 To remove the patch, use the <parameter>-R</parameter> option:
294 $ patch -p0 -R < ../patch_to_apply.diff
297 If you want to do a test run to see if the patch will apply
298 successfully (e.g., if the patch was created from an older or
299 newer version of the tree), you can use the
300 <parameter>--dry-run</parameter> parameter to run the patch
301 without writing to any files:
304 $ patch -p0 --dry-run < ../patch_to_apply.diff
307 <command>patch</command> is pretty smart about extracting
308 patches from the middle of a file, so if you save an email with
309 an inlined patch to a file on your hard drive, you can invoke
310 patch on it without stripping out the email headers and other
311 text. <command>patch</command> ignores everything that doesn't
315 The <parameter>-p0</parameter> option to <command>patch</command>
316 tells it to keep the full file name from the patch file. For example,
317 if the file name in the patch file was
318 <filename>wine/programs/clock/main.c</filename>.
319 Setting the <parameter>-p0</parameter> option would apply the patch
320 to the file of the same name i.e.
321 <filename>wine/programs/clock/main.c </filename>.
322 Setting the <parameter>-p1</parameter> option would strip off the
323 first part of the file name and apply
324 the patch instead to <filename>programs/clock/main.c </filename>.
325 The <parameter>-p1</parameter> option would be useful if you named
326 your top level wine directory differently to the person who sent you
327 the patch. For the <parameter>-p1</parameter> option
328 <command>patch</command> should be run from the top level wine directory.
335 <!-- Keep this comment at the end of the file
338 sgml-parent-document:("wine-doc.sgml" "set" "book" "chapter" "")