~ubuntu-branches/ubuntu/maverick/wxwidgets2.8/maverick-proposed

« back to all changes in this revision

Viewing changes to wxPython/docs/BUILD.html

  • Committer: Bazaar Package Importer
  • Author(s): Devid Filoni
  • Date: 2007-11-06 18:25:13 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20071106182513-809agqds6igh7mqo
Tags: 2.8.6.1-0ubuntu1
* New upstream version, based on the upstream tarball
  wxPython-src-2.8.6.1.tar.bz2, renamed debian to debian-upstream.
* Provide a get-orig-source target to do the repackaging.
* Fix "substvar-source-version-is-deprecated" lintian warnings.
* Remove duplicate Description field in debian/control.
* Add "\" at the end of line 8 in debian/python-wxtools.menu to fix
  "bad-test-in-menu-item" lintian error.
* Provide .xpm icons to fix "menu-icon-not-in-xpm-format" lintian errors,
  changed Icon field in debian/python-wxtools.menu.
* Fix "wrong-name-for-upstream-changelog" lintian warnings.
* Remove "Application;" from Categories field in debian/pycrust.desktop,
  debian/pyshell.desktop, debian/xrced.desktop.
* Switch "Apps" to "Applications" in debian/python-wxtools.menu to fix
  "menu-item-uses-apps-section" lintian warnings.
* Drop the icon extension from debian/pycrust.desktop,
  debian/pyshell.desktop, debian/xrced.desktop.
* Add dpatch support.
* Add "WX_CONFIG" patch.
* debian/rules:
  - added .xpm icons to install-gtk-py-tools target
  - added "docs/changes.txt" to dh_installchangelogs in binary-common target
  - added "\" at the end of "install-examples install-msw-dev
    install-msw-dbg install-headers-msw" line in .PHONY

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
one of the released wxPython-src-2.8.* tarballs.  I'll also assume that
18
18
you know your way around your system, the compiler, etc. and most
19
19
importantly, that you know what you are doing!  ;-)</p>
20
 
<p>If you want to also install the version of wxPython you build to be in
 
20
<p>If you want to also install the version of wxPython you build into
21
21
your site-packages dir and be your default version of wxPython, then a
22
22
few additional steps are needed, and you may want to use slightly
23
23
different options.  See the <a class="reference" href="INSTALL.html">INSTALL</a> document for more details.  If
40
40
<p>In the text below I'll use WXDIR with environment variable syntax
41
41
(either $WXDIR or %WXDIR%) to refer to the top level directory where
42
42
your wxWidgets and wxPython sources are located.  It will equate to
43
 
whereever you checked out the wxWidgets module from CVS, or untarred
 
43
where ever you checked out the wxWidgets code from SVN, or untarred
44
44
the wxPython-src tarball to.  You can either substitute the $WXDIR text
45
45
below with your actual dir, or set the value in the environment and
46
46
use it just like you see it below.</p>
47
47
<p>If you run into what appears to be compatibility issues between
48
48
wxWidgets and wxPython while building wxPython, be sure you are using
49
49
the wxWidgets sources included with the wxPython-src tarball or the
50
 
CVS snapshot, and not a previously installed version or a version
 
50
SVN snapshot, and not a previously installed version or a version
51
51
installed from one of the standard wxWidgets installers.  With the
52
52
&quot;unstable&quot; releases (have a odd-numbered minor release value, where
53
53
the APIs are allowed to change) there are often significant
76
76
             --with-gnomeprint \
77
77
             --with-opengl \
78
78
             --enable-debug \
 
79
             --enable-debug_gdb \
79
80
             --enable-geometry \
80
81
             --enable-graphics_ctx \
81
82
             --enable-sound --with-sdl \
82
83
             --enable-mediactrl \
83
84
             --enable-display \
84
 
             --disable-debugreport \
85
85
</pre>
86
86
<p>On OS X of course you'll want to use --with-mac instead of
87
87
--with-gtk and --with-gnomeprint.</p>
154
154
LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH on OS X) to /opt/wx/2.8/lib.</p>
155
155
</li>
156
156
<li><p class="first">I also have a script to help me build wxPython and it is checked in
157
 
to the CVS as wxWidgets/wxPython/b, but you probably don't want to
 
157
to the source repository as wxPython/b, but you probably don't want to
158
158
use it as it's very cryptic and expects that you want to run SWIG,
159
159
so if you don't have the latest patched up version of SWIG then
160
160
you'll probably get stuck.  So in this document I'll just give the
236
236
</ol>
237
237
</div>
238
238
<div class="section">
239
 
<h1><a id="building-on-windows" name="building-on-windows">Building on Windows</a></h1>
 
239
<h1><a id="building-on-windows-with-ms-visual-c" name="building-on-windows-with-ms-visual-c">Building on Windows with MS Visual C++</a></h1>
240
240
<p>The Windows builds currently require the use of Microsoft Visual C++.
241
241
Theoretically, other compilers (such as mingw32 or the Borland
242
242
compilers) can also be used but I've never done the work to make that
246
246
to accommodate that.  (And send the patches to me.)</p>
247
247
<p>The standard Python 2.3 and earlier are built with MS Visual C 6.0 and
248
248
so you must also build with MSVC 6 in order to be used with the stock
249
 
python.exe.  If you woudl rather use a different version of
 
249
python.exe.  If you would rather use a different version of
250
250
VisualStudio keep in mind that you'll also have to build Python and
251
251
any other extension modules that you use with that compiler because a
252
252
different version of the C runtime library is used.  The stock Python
425
425
</li>
426
426
</ol>
427
427
</div>
 
428
<div class="section">
 
429
<h1><a id="building-on-windows-with-cygwin-mingw32" name="building-on-windows-with-cygwin-mingw32">Building on Windows with Cygwin/MingW32</a></h1>
 
430
<p>Starting with release 2.8.6.1 wxPython is also able to be built for
 
431
the stock Python on Windows using the cywin environnment and the
 
432
mingw32 compiler.  It can probably also be done with a few
 
433
modifications to these instructions without cygwin, using just the
 
434
standalone mingw32 compiler and MSYS, but that has not been tested
 
435
yet.  Another potential option is to build wxWidgets and wxPython for
 
436
cygwin and the cygwin version of Python, but the details for that also
 
437
has not yet been worked out.  If you do work out the details then
 
438
please send me patches for this document.</p>
 
439
<p>This build has some aspects of both of the builds desctibed above, but
 
440
leans more towards the Unix-like style of doing things.  If you have
 
441
any questions about the steps detailed in these instructions please
 
442
read the above sections as well, as the answer could be there.</p>
 
443
<ol class="arabic">
 
444
<li><p class="first">If you don't already have cygwin installed on your Windows box
 
445
please do so know.  Make sure you have these additional packages
 
446
installed as well:</p>
 
447
<blockquote>
 
448
<p>autoconf
 
449
automake
 
450
gcc-core
 
451
gcc-g++
 
452
gcc-mingw
 
453
gcc-mingw-core
 
454
gcc-mingw-g++
 
455
make
 
456
mingw-runtime
 
457
mingw-zlib
 
458
patch
 
459
w32api</p>
 
460
</blockquote>
 
461
</li>
 
462
<li><p class="first">Create a build directory in the main wxWidgets dir, and configure
 
463
wxWidgets.  Notice that we set some environment variables so
 
464
configure will know to override the defaults for some compiler and
 
465
linker flags settings, this is what causes the mingw32 compiler to
 
466
be used even though we are in the full cygwin environment:</p>
 
467
<pre class="literal-block">
 
468
cd $WXDIR
 
469
mkdir bld
 
470
cd bld
 
471
 
 
472
CC=&quot;gcc -mno-cygwin -mwindows&quot;  \
 
473
CXX=&quot;g++ -mno-cygwin -mwindows&quot; \
 
474
LDFLAGS=&quot;-mno-cygwin -mwindows&quot; \
 
475
../configure \
 
476
    --with-msw \
 
477
    --build=i686-pc-mingw32 \
 
478
    --prefix=/opt/wx/2.8 \
 
479
    --enable-unicode \
 
480
    --enable-debug \
 
481
    --enable-debug_gdb \
 
482
    --enable-geometry \
 
483
    --enable-display \
 
484
    --enable-shared \
 
485
    --with-expat=builtin \
 
486
    --with-regex=builtin \
 
487
    --with-zlib=builtin
 
488
</pre>
 
489
<p>Read the note above in the unix-like section for why I used
 
490
/opt/wx/2.8 for the prefix, and for some discussion about what your
 
491
options are.  For a cygwin environment the default of using
 
492
/usr/local for the prefix would also be a good choice.  Note that
 
493
the wx DLLs will be installed to {prefix}/lib and since DLLs need
 
494
to be found in the PATH you'll either want to add that dir to your
 
495
PATH if it isn't already there, or be prepared to move those DLLs
 
496
someplace else when the build is finished.</p>
 
497
<p>If you don't need to use the debugger you can leave off the
 
498
--enable-debug and --enable-debug_gdb flags, and add the
 
499
--enable-optimise flag to cause the compiler to generate more
 
500
efficient code.  I recommend that you also add the
 
501
--enable-debug_flag flag so that some C++ runtime checks will be
 
502
turned into Python exceptions when they fail.</p>
 
503
</li>
 
504
<li><p class="first">To build and install wxWidgets you could just use the &quot;make&quot;
 
505
command but there are a couple other libraries besides the main
 
506
wxWidgets libs that also need to be built so I make a script called
 
507
&quot;.make&quot; to do it all for me so I don't forget anything.  This is
 
508
what it looks like:</p>
 
509
<pre class="literal-block">
 
510
make $* \
 
511
    &amp;&amp; make -C contrib/src/gizmos $* \
 
512
    &amp;&amp; make -C contrib/src/stc $*
 
513
</pre>
 
514
<p>So you just use .make as if it where make:</p>
 
515
<pre class="literal-block">
 
516
.make
 
517
.make install
 
518
</pre>
 
519
<p>This is going to take a while as GCC on Windows is very slow.  This
 
520
would be a good time to go take a nap, or have dinner, or both.
 
521
When it's done you should have an installed set of files under
 
522
/opt/wx/2.8 (or whatever prefix you used) containing just
 
523
wxWidgets.  Now to use this version of wxWidgets you just need to
 
524
add /opt/wx/2.8/bin and /opt/wx/2.8/lib to the PATH.</p>
 
525
</li>
 
526
<li><p class="first">Building wxPython is very similar to how it is done for the other
 
527
build styles.  We simply run the setup.py in the wxPython dir, and
 
528
pass it some commands and flags.  Make sure that the Python that
 
529
you use for running setup.py is the one that you want to use when
 
530
running wxPython apps.  In other words, if you have the cygwin
 
531
Python installed, or multiple versions of stock Windows Python,
 
532
then use the full pathname to python.exe to make sure you use the
 
533
right one.</p>
 
534
<blockquote>
 
535
<dl class="docutils">
 
536
<dt>python setup.py COMPILER=mingw32 </dt>
 
537
<dd><p class="first last">BUILD_GLCANVAS=0 BUILD_ACTIVEX=0 WX_CONFIG=&quot;bash.exe -e /opt/wx/2.8/bin/wx-config&quot; build_ext --inplace</p>
 
538
</dd>
 
539
</dl>
 
540
</blockquote>
 
541
<p>This builds the wxPython extension modules and places them directly
 
542
in the wx package dir located in the source tree.  This is
 
543
convenient for testing the build or running the demo and samples
 
544
without needing to do an install to site-packages and possibly
 
545
disturbing the wxPython you already have installed.  You just need
 
546
to set PYTHONPATH so Python will find this version of the wx
 
547
package first.  When you are ready to install this build you can do
 
548
it by adding 'install' to the command line and running it again.
 
549
See the INSTALL.txt file for more details.</p>
 
550
<p>Notice that we had to turn off the building of the wx.glcanvas and
 
551
wx.activex modules.  There are also a few other features that are
 
552
not currently supported by this build, most notably the
 
553
wx.GraphicsContext and wx.media.MediaCtrl families of classes.
 
554
Hopefully that will improve over time.</p>
 
555
</li>
 
556
</ol>
 
557
</div>
428
558
</div>
429
559
</body>
430
560
</html>