# Install Macports

# We'll install a relatively high-level package first, with a lot of dependencies,
# so that we pick up everything along the way

# Chaco is an enthought plotting package that'll 
sudo port install py26-chaco
sudo port select python python26

sudo port install py26-ipython
sudo port select --set ipython ipython26
sudo port install opencv +python26

sudo port install py26-gtk
sudo port install py26-matplotlib +cairo+gtk2

sudo ln -s easy_install-2.6 /opt/local/bin/easy_install
sudo easy_install python
sudo easy_install matplotlib
sudo port install py26-game
sudo easy_install PIL
sudo easy_install SimpleCV
sudo easy_install --upgrade traits
sudo easy_install --upgrade enable
sudo easy_install --upgrade traitsui


# Kinect
# -----
sudo port install git-core
sudo port install libtool
sudo port install libusb-devel
cd ~/Downloads
git clone https://github.com/OpenKinect/libfreenect.git
git clone http://git.libusb.org/libusb.git
cd libusb
./autogen.sh
patch -p1 < ../libfreenect/platform/osx/libusb-osx-kinect.diff
./configure LDFLAGS='-framework IOKit -framework CoreFoundation'
make
sudo make install
cd ../libfreenect
mkdir build
cd build
ccmake ..
# Hit "C", then hit "G"
cmake ..
make
sudo make install
# Python time
cd ../wrappers/python
open setup.py
# Add 											'-I', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include', after line 45
python setup.py install


# TODO:

# CouchDB
# -----
sudo port install couchdb py26-couchdb py26-couchdbkit
