Building wxPython for Development
In this page i'm describing how to build wxPython for development on opensuse 10.2. The instructions can also be used for other distributions.
For the build i used wxPython-src from http://wxpython.org/download.php#sources
At the time of writing this this is http://prdownloads.sourceforge.net/wxpython/wxPython-src-2.8.1.1.tar.bz2
If there is the need, you can find the full instructions at http://wxpython.org/BUILD.html
- Extract the wxPython source archive in a directory like ~/src.
- cd wxPython-src-2.8.1.1/
- mkdir bld; cd bld
- Now create the file .configure with the following content:
../configure --prefix=/opt/wx/2.8 \
--with-gtk \
--with-gnomeprint \
--with-opengl \
--enable-debug \
--enable-geometry \
--enable-graphics_ctx \
--enable-sound --with-sdl \
--enable-mediactrl \
--enable-display \
--disable-debugreport \
--enable-unicode \
\
--with-libjpeg=builtin \
--with-libpng=builtin \
--with-libtiff=builtin \
--with-zlib=builtin
- chmod +x .configure
- ./.configure
- At the end of the output you should have:
Configured wxWidgets 2.8.1 for `i686-pc-linux-gnu' Which GUI toolkit should wxWidgets use? GTK+ 2 Should wxWidgets be compiled into single library? no Should wxWidgets be compiled in debug mode? yes Should wxWidgets be linked as a shared library? yes Should wxWidgets be compiled in Unicode mode? yes What level of wxWidgets compatibility should be enabled? wxWidgets 2.4 no wxWidgets 2.6 yes Which libraries should wxWidgets use? jpeg builtin png builtin regex builtin tiff builtin zlib builtin odbc no expat sys libmspack no sdl yes
- If this is not the case, you are missing some dev-packages
- You should install the missing packages. Then do:
- rm -r *; ./.configure
- Do this until you have the same configure output like the above.
- After you configured wx, you should create the file .make:
make $* \
&& make -C contrib/src/gizmos $* \
&& make -C contrib/src/stc $*
- chmod +x .make
- Now compile by running:
- ./.make
- If you get errors, you again don't have all used dev-packages installed
- After you successfully compiled wx, you have to install it:
- sudo ./.make install
- Now create the file ~/bin/set_wx28 with the following content:
export PATH=/opt/wx/2.8/bin:$PATH export LD_LIBRARY_PATH=/opt/wx/2.8/lib:$LD_LIBRARY_PATH export PYTHONPATH=~/src/wxPython-src-2.8.1.1/wxPython
- Instead of putting this into ~/bin/set_wx28 you could also put the tree lines into ~/.bashrc
(but this would prevent using your old wxPython) - Now run:
- source ~/bin/set_wx28
- You should now have the new variables in your shell. Prove it by:
- echo $PATH
- Do you have "/opt/wx/2.8/bin" in your path? Ok.
- cd ../wxPython
- python2.5 setup.py build_ext --inplace --debug
- After that, try to run the demo:
- cd demo
- python demo.py
- That's all.
- Whenever you open a new shell and want to use wx28 remember to source your ~/bin/set_wx28 first.
