]> git.saurik.com Git - wxWidgets.git/blame - debian/README.HowToBuild.txt
reset the associated view frame pointer when the frame is deleted directly instead...
[wxWidgets.git] / debian / README.HowToBuild.txt
CommitLineData
7d690809
RD
1How to build the Debian wx packages
2===================================
3
4This file is currently just a brain dump of my experiences with
5building the Debian wx packages, based on various experimentations,
6and Googling around. Please don't take anything said here as
0a77a468 7authoritative or written in stone. Although I've been able to get
7d690809
RD
8things to work fairly reliably, I still feel pretty clueless about
9some things.
10
11
12Overview
13--------
14
0a77a468 15Contrary to how RPM and other packaging systems work, building Debian
7d690809
RD
16packages is done with an expanded source tree instead of using a
17tarball. Inside the toplevel of the source tree you'll find a subdir
18named debian, and within this dir are various files used by the build.
19The most important of these are the control file and the rules file.
0a77a468 20The control file specifies the metadata about each package, such as
7d690809
RD
21name, description, dependencies, etc. Interestingly, the version
22number of the current build is not in the control file as might be
23expected, but is instead taken from the changelog file. I guess this
24is a way for debian to make sure that there is always an updated
25changelog for every release, but it is very non-intuitive to say the
26least. The rules file is a Makefile, and is executable with a #! that
27runs make on itself. This lets you execute commands from the toplevel
28source dir like:
29
30 ./debian/rules build
31
32While theoretically you could build the wx packages directly from your
33CVS workspace this won't work (currently) for a couple reasons.
34First, the debian/rules file is currently looking at the name of the
35toplevel source dir and extracting from it the flavour name (if
36present) for use in passing to --with-flavor configure flag. (I'm
37considering changing how it finds this value for 2.7 so, for example,
690c6e8e 38the debian packages could also be built from the wxPython source
7d690809
RD
39tarball...) Second, since the build tools use the current source dir
40for creating the source package, you'll probably want to start with a
0a77a468 41clean source tree that has had unnecessary things removed from it.
7d690809
RD
42There is a Makefile target that will create a minimized and clean
43source tree for you, and will name it as debian/rules expects. To use
44it go to a build dir where you've already run configure, and then run:
45
46 make debian-dist
47
48This will result in a new source tree with a name like
49wxwidgets2.7-2.7.0.0 that is located as a sibling to the toplevel of
50the current source tree.
51
52
53Environment
54-----------
55
0a77a468 56The various dpkg helper tools will use some environment settings to
7d690809
RD
57provide default values. I have these set:
58
59 DEBFULLNAME='Robin Dunn'
60 DEBEMAIL=robin@alldunn.com
61 DEBSIGN_KEYID='Robin Dunn <robin@alldunn.com>'
62 DEBUILD_DPKG_BUILDPACKAGE_OPTS='-i -ICVS -I.svn'
63
64Notice the DEBSIGN_KEYID value. If this is set (and you have a
65matching gnupg key) then the packages will be digitally signed when
66they are built.
67
68If you are building packages that you intend to be installable on
0a77a468
VZ
69machines other than your own, then I recommend that you either have a
70separate machine with a minimal OS install, or set up a chroot
7d690809 71environment and do the builds there. The reason for this is to
0a77a468 72minimize unexpected extra dependencies that the built packages will
7d690809
RD
73have because of extra things you have installed on your desktop
74system, for example OpenGL libs installed by your video card drivers.
75Using a chroot will also allow you to build packages for different
76versions of Debian (or Ubuntu) if desired. There is a good
77description of setting up a chroot environment here:
78
79 https://wiki.ubuntu.com/DebootstrapChroot
80
0a77a468
VZ
81In addition to the base system packages, you'll need to install in
82the chroot environment any packages needed for building wxWidgets
7d690809
RD
83(compilers, make, autoconf, gtk and image libs, lib-dev's, python,
84python-dev, etc.) as well as the packages listed in the next section.
85
86
87Build Packages
88--------------
89
0a77a468 90There are a number of helper packages that are used when building
7d690809
RD
91debian packages. Here are some that I have in my chroot, there may be
92some others that I am not seeing at the moment:
93
94 debhelper
95 devscripts
96 dh-make
97 dpkg-dev
98 fakeroot
99 lintian
100 diff
101 patch
102
103
104Doing the Build
105---------------
106
107Ok, if you are not totally confused by this point you should have a
108minimal source tree produced by "make debian-dist" that is accessible
109by your chroot or other minimal install system. (Unless you are only
110making packages for yourself, then doing the build on in your main
111desktop environment would be okay.) The first step is to chdir to
112the top level of this source tree.
113
0a77a468 114If you haven't already you'll want to edit debian/changelog to make an
7d690809
RD
115entry for the current build. If the version number is changing since
116the last build then you'll need a whole new section. If you are just
117updating something in the same version then you can just get by with
118editing the current changelog entry. The 'dch' tool can be used to
119open the file in an editor with the cursor positioned for you. If you
120use 'dch -i' then it will create a new changelog entry for you with
121the proper syntax. Don't forget to copy this file back to your CVS
122workspace if appropriate.
123
124Our debian/control file is generated from debian/control.in, so you
125can force it to be created now by running the following. You may want
0a77a468 126to do this to verify its contents before proceeding with the build.
7d690809
RD
127
128 ./debian/rules debian/control
129
130To run just the compile/link/etc. portions of the build you can do
131this:
132
133 ./debian/rules build
134
135To also make a set of test binaries you can do this:
136
54aa3821 137 fakeroot ./debian/rules binary
7d690809
RD
138
139To clean up from prior builds you can do this:
140
141 fakeroot ./debian/rules clean
142
0a77a468 143And to automate the entire process (build, binaries, source packages,
7d690809
RD
144digital signing, etc.) you can do this:
145
146 dpkg-buildpackage -rfakeroot
147
148When finished the binary and source packages will be left in the
149parent dir of the source tree.
150
151
31a8ceaf
VZ
152Automating the process
153----------------------
154
155The script debian/build_all automates the above stepds and builds both
156wxWidgets and wxPython packages in both ANSI and Unicode modes. You should do
157the build manually at least the first time however to make sure you have all
158the prerequisites and the build doesn't fail.
159
7d690809
RD
160
161Other Sources of Information
162----------------------------
163
164http://liw.iki.fi/liw/talks/debian-packaging-tutorial.pdf
165http://women.alioth.debian.org/wiki/index.php/English/BuildingTutorial
166http://women.alioth.debian.org/wiki/index.php/English/AdvancedBuildingTips
167http://www.wiggy.net/presentations/2001/DebianWalkThrough/handouts/handouts.html
168http://www.debian.org/doc/manuals/maint-guide/index.en.html
169http://www.isotton.com/debian/docs/repository-howto/repository-howto.html
170