Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added bootstrap script

  • Loading branch information...
commit eac5473542ec7be121434a40c8705c8775692de2 1 parent 2e561b3
@xamox xamox authored
View
25 README.markdown
@@ -40,21 +40,24 @@ This is how to install SimpleCV under a python virtual environment [virtualenv]
Run the following commands:
- sudo apt-get install ipython python-opencv python-scipy python-numpy python-pygame python-setuptools python-pip git gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev mercurial
+ sudo apt-get install python-opencv python-setuptools python-pip gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev mercurial
sudo pip install virtualenv
- virtualenv virtualSCV
- cd virtualSCV
+ virtualenv venv
+ cd venv
mkdir src
- cp /usr/local/lib/python2.7/dist-packages/cv* ./lib/python2.7/site-packages
- ./bin/pip install numpy
- ./bin/pip install scipy
+ ln -s /usr/local/lib/python2.7/dist-packages/cv2.so lib/python2.7/site-packages/cv2.so
+ ln -s /usr/local/lib/python2.7/dist-packages/cv.py lib/python2.7/site-packages/cv.py
+ ./bin/pip install https://github.com/numpy/numpy/zipball/master
+ ./bin/pip install https://github.com/scipy/scipy/zipball/master
./bin/pip install PIL
./bin/pip install ipython
- hg clone http://bitbucket.org/pygame/pygame src/pygame
- source bin/activate
- cd src/pygame
- python setup.py -setuptools install
- pip install https://github.com/ingenuitas/SimpleCV/zipball/master
+ mkdir src
+ wget -O src/pygame.tar.gz https://bitbucket.org/pygame/pygame/get/6625feb3fc7f.tar.gz
+ cd src
+ tar zxvf pygame.tar.gz
+ cd ..
+ ./bin/python src/pygame-pygame-6625feb3fc7f/setup.py -setuptools install
+ ./bin/pip install https://github.com/ingenuitas/SimpleCV/zipball/master
View
11 requirements.txt
@@ -1,8 +1,5 @@
-SimpleCV
-
-pygame>=1.9.1
-PIL==1.1.7
-nose>=1.0.0
-ipython>=0.12
-numpy>=numpy-2.0.0
+https://github.com/numpy/numpy/zipball/master
+https://github.com/scipy/scipy/zipball/master
+PIL
+ipython
View
47 scripts/mkvirt.py
@@ -0,0 +1,47 @@
+import os
+import virtualenv, textwrap
+
+here = os.path.dirname(os.path.abspath(__file__))
+base_dir = os.path.dirname(here)
+
+print "Creating SimpleCV Bootstrap Install Script: simplecv-bootstrap.py"
+
+output = virtualenv.create_bootstrap_script(textwrap.dedent("""
+import os, subprocess
+
+def after_install(options, home_dir):
+ base_dir = os.path.dirname(home_dir)
+ logger.notify('Installing SimpleCV into Virtual Environment')
+
+ os.chdir(home_dir)
+ print 'Current Directory:', os.getcwd()
+ print 'dir list:', os.listdir(os.getcwd())
+ print 'Symlinking OpenCV'
+ os.symlink('/usr/local/lib/python2.7/dist-packages/cv2.so', os.path.join(os.getcwd(),'lib/python2.7/site-packages/cv2.so'))
+ os.symlink('/usr/local/lib/python2.7/dist-packages/cv.py', os.path.join(os.getcwd(),'lib/python2.7/site-packages/cv.py'))
+ subprocess.call(['pwd'])
+ os.mkdir('src')
+ os.chdir('src')
+ subprocess.call(['wget','-O','pygame.tar.gz','http://github.com/xamox/pygame/tarball/master'])
+ subprocess.call(['tar','zxvf','pygame.tar.gz'])
+ print 'Runing setup for pygame'
+ subprocess.call(['ls'])
+ os.chdir('../')
+ print 'Current Directory:', os.getcwd()
+ print os.getcwd()
+ subprocess.call(['./bin/python','src/xamox-pygame-3e48d10/setup.py','install'])
+
+
+"""))
+f = open('simplecv-bootstrap.py', 'w').write(output)
+
+
+#~ sudo apt-get install python-opencv python-setuptools python-pip gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev mercurial
+
+#~ source bin/activate
+#~ cd src/pygame
+#~ python setup.py -setuptools install
+#~ pip install https://github.com/ingenuitas/SimpleCV/zipball/masteriii
+# call_subprocess(['python','setup.py','-setuptools','install'], show_stdout=True)
+#call_subprocess([join(home_dir, 'bin', 'pip'),'install','-r','requirements.txt'], show_stdout=True)
+
View
53 scripts/virtualenv-bootstrap.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+reset
+echo "This Script Creates a python virtual environment for SimpleCV"
+echo ""
+echo ""
+read -p "Continue [Y/n]? " -n 1
+if [[ $REPLY =~ ^[Nn]$ ]]
+then
+ echo ""
+ exit 1
+fi
+
+read -p "Install System Level Dependencies [y/N]? " -n 1
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+ echo ""
+ echo "Installing System Dependencies....."
+ sudo apt-get install python-opencv python-setuptools python-pip gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev
+fi
+
+
+echo "Creating Virtual Environment"
+virtualenv venv
+echo "Entering Virtual Environment"
+cd venv
+echo "Symbolic Linking OpenCV"
+ln -s /usr/local/lib/python2.7/dist-packages/cv2.so lib/python2.7/site-packages/cv2.so
+ln -s /usr/local/lib/python2.7/dist-packages/cv.py lib/python2.7/site-packages/cv.py
+echo "Installing dependencies"
+./bin/pip install https://github.com/numpy/numpy/zipball/master
+./bin/pip install https://github.com/scipy/scipy/zipball/master
+./bin/pip install PIL
+./bin/pip install ipython
+echo "Downloading pygame"
+mkdir src
+wget -O src/pygame.tar.gz https://bitbucket.org/pygame/pygame/get/6625feb3fc7f.tar.gz
+cd src
+tar zxvf pygame.tar.gz
+cd ..
+echo "Running setup for pygame"
+./bin/python src/pygame-pygame-6625feb3fc7f/setup.py -setuptools install
+./bin/pip install https://github.com/ingenuitas/SimpleCV/zipball/master
+
+reset
+echo "SimpleCV should now be installed in the virtual environment"
+echo "to run just type:"
+echo ""
+echo "cd venv"
+echo "source bin/activate"
+echo "simplecv"
+echo ""
+
Please sign in to comment.
Something went wrong with that request. Please try again.