Skip to content

Building patched python virtual environment

whirm edited this page Apr 26, 2013 · 16 revisions

Python

hg clone http://hg.jcea.es/cpython-2011
cd cpython-2011
hg checkout dtrace-issue13405_2.7
sudo apt-get install libncurses-dev
./configure --with-dtrace  --prefix=$PWD/../inst --enable-shared
cp Modules/Setup.dist Modules/Setup
make -j$(grep process /proc/cpuinfo | wc -l)
make install

virtualenv

virtualenv -p $PWD/inst/bin/python --system-site-packages --clear venv
. venv/bin/activate

libboost

cd src
sudo apt-get source libboost-python1.49-dev
sudo apt-get build-dep libboost-python1.49-dev
cd boost*
./bootstrap.sh
./b2 -j$(grep process /proc/cpuinfo | wc -l) --prefix=$PWD/../../inst install

Libtorrent and bindings

cd src
sudo apt-get source python-libtorrent
sudo apt-get build-dep python-libtorrent
cd libtorrent-rasterbar*
./configure --with-boost-python --with-boost=$PWD/../../inst/include/boost --with-boost-libdir=$PWD/../../inst/lib --with-boost-system=boost_system --prefix=$PWD/../../inst --enable-python-binding
make -j$(grep process /proc/cpuinfo | wc -l)
make install
cd ../../inst/lib
ln -s libboost_python.so libboost_python-py27.so.1.49.0
cd ../..
export LD_LIBRARY_PATH=$PWD/inst/lib #This may no longer be necessary
#Test that it actually works:
python -c "import libtorrent"

M2Crypto

cd src
apt-get source python-m2crypto
sudo apt-get build-dep python-m2crypto
cd m2crypto*
python setup.py build
python setup.py install
cd ../..
#Test that it actually works
python -c "import M2Crypto"

APSW

cd src
apt-get source python-apsw
cd python-apsw*
python setup.py install --prefix=../../inst/
cd ../..
#Test that it actually works
python -c "import apsw" 

Other deps

easy_install netifaces nose wxpython