4 It uses standard distutils, so:
7 python setup.py install
9 You need python-gammu and wxPython [1] (Unicode enabled build) installed to
10 run and install this program. If you want support for scanning bluetooth
11 devices, you need PyBluez [2]. For incoming events notifications, you
14 For Windows you also have to install Pywin32 [4].
16 If you want to obey dependency checking at build time for any reason,
17 you can use --skip-deps option.
19 [1]: http://wxpython.org/
20 [2]: http://org.csail.mit.edu/pybluez/
21 [3]: http://www.freedesktop.org/wiki/Software/DBusBindings
22 [4]: https://sourceforge.net/projects/pywin32/
25 Cross compilation for Windows on Linux
26 ======================================
28 First we'll need wxWidgets and wxPython. You can install both using
29 packages provided on their home pages. If you want to build, read next
32 wxWidgets was built with that command line (adapted from BUILD.txt in
35 CXX=i586-mingw32msvc-g++ CC=i586-mingw32msvc-gcc ./configure --with-msw \
36 --host=i586-mingw32msvc --target=i586-mingw32msvc --prefix=/opt/wx/2.8 \
37 --enable-unicode --enable-optimise --enable-debug_flag --enable-shared --disable-rpath \
38 --with-expat=builtin --with-regex=builtin
40 To build windows python extentions, I prefered to use windows python
41 running with wine making python.exe/wine invoke linux's i386-mingw32-*
42 toolchain. This let distutils believe it can use the Cygwin/MinGW32
43 compiler (-mno-cygwin) without patching.
45 So, install wine and install python on wine:
46 msiexec /i python-2.5.1.msi
48 At the top of your wxPython source tree, copy MakeFakeWin.sh and
49 launch it with the first part of your mingw crosscompiler name without
50 '-gcc'. For example, if your mingw crosscompiler is called i586-mingw32msvc-gcc:
51 ./MakeFakeWin.sh i586-mingw32msvc
53 Now gcc.exe, g++.exe, dllwrap.exe, dlltool.exe and wx-config.exe
54 have been created in CWD. These are links to a real windows executable
55 (wine_linux_launcher.exe) that call the locally created
56 wine_linux_launcher.sh script, with executable name + all invocation
57 arguments as parameters, and wait for result files for both return value
58 and stdout be created and finally pass result back to calling app, i.e.
59 python.exe, in the windows way... To summary, it let distutils do
60 os.popen and os.spawn as expected.
61 For the time being please replace in generated wine_linux_launcher.sh line
62 i586-mingw32msvc-$bzname $res > ${exename}_stdout
64 i586-mingw32msvc-$bzname $res -lstdc++ > ${exename}_stdout
66 wine 'c:\Python25\python.exe' setup.py COMPILER=mingw32 CORE_ONLY=1 WX_CONFIG="wx-config" build
67 wine 'c:\Python25\python.exe' setup.py COMPILER=mingw32 CORE_ONLY=1 WX_CONFIG="wx-config" install -f
69 If wine complains about COMSPEC environment variable use
73 wine pywin32-210.win32-py2.5.exe
75 At the top of your wammu source tree, copy MakeFakeWin.sh and
76 launch it with the first part of your mingw crosscompiler name without
77 '-gcc'. For example, if your mingw crosscompiler is called i586-mingw32msvc-gcc:
78 ./MakeFakeWin.sh i586-mingw32msvc
80 wine c:\\python25\\python setup.py build -c mingw32
82 TODO - create a package using py2exe.
84 Now you can run wine c:\\python25\\python wammu.py
86 If it complains (end of traceback):
87 File "C:\Python25\lib\random.py", line 108, in seed
88 a = long(_hexlify(_urandom(16)), 16)
89 WindowsError: [Error -2146893801] Windows Error 0x80090017
91 It's because of wine problem. Then use the following patch:
93 --- wammu.py.orig 2007-05-07 11:22:24.000000000 +0300
94 +++ wammu.py 2007-11-23 05:40:22.654590589 +0200
99 +def ni(i): raise NotImplementedError
102 # Try to import iconv_codec to allow working on chinese windows
107 # vim: et ts=4 sw=4 sts=4 tw=72 spell spelllang=en_us