Python Bindings Build HOWTO

For win32

  1. Install cross-compilation environment with mingw32-runtime >= 3.15 (VLC 1.0.0 requires this). E.g. Ubuntu Karmic Alpha 2.
  2. Follow instructions on wiki:BrowserPluginBuildHOWTO
  3. Retrieve python bindings via git as per wiki:VlcUbuntuHowto (intrepid instructions)
  4. Obtain Python 2.5.4 source, extract in build dir.
  5. Remove test for cross-compilation from test %zd printf() format support from configure script.
  6. Configure Python for cross-compile:
    ./configure --host=mingw32 --with-gcc=i586-mingw32msvc-gcc --with-cxx=i586-mingw32msvc-g++ --enable-shared --with-threads
  7. Obtain python25.dll for Python 2.5.4 from \windows\system32 after Python 2.5.4 binary installer was run, put in build dir.
  8. Copy bindings to compiled vlc-1.0.0
  9. Run following commands (supposedly the equivalent of running "python setup build build_ext" in Win32 space.
    cd bindings/python
    i586-mingw32msvc-gcc -mthreads -fno-strict-aliasing -g -O3 -Wall -Wstrict-prototypes  -I../.. -I./../../include -I/usr/win32/include -I../../../Python-2.5.4 -I../../../Python-2.5.4/Include -c ./vlc_module.c -o ../../bindings/python/./vlc_module.o -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE  -O3 -ffast-math -funroll-loops -mtune=pentium2 -g
    i586-mingw32msvc-g++  -Wsign-compare -Wall -mms-bitfields -pipe -shared ../../bindings/python/./vlc_module.o ../../src/.libs/libvlc.dll.a ../../../python25.dll -o ../../bindings/python/vlc.pyd -g -lkernel32 -L/usr/win32/lib -liconv /usr/win32/lib/libintl.a /usr/win32/lib/libiconv.a -lws2_32 -lnetapi32 -lwinmm -mwindows
  1. Copy created vlc.pyd to a checkout of the source.
  2. Create VLC win32 binary distro:
    cd ../..
    make package-win32-base
  1. Copy the created vlc-1.0.0 dir as vlc to the checkout.
  2. Run
    cd checkout
    copy vlc\libvlc.dll .
    copy vlc\libvlccore.dll .
  1. Make sure VLCWrapper does not use --http-reconnect and that plugin-path is set to the checkout\vlc\plugins dir.

For Ubuntu

See VlcUbuntuHowto