Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added bootstrap script

  • Loading branch information...
commit eac5473542ec7be121434a40c8705c8775692de2 1 parent 2e561b3
Anthony Oliver authored August 22, 2012
25  README.markdown
Source Rendered
@@ -40,21 +40,24 @@ This is how to install SimpleCV under a python virtual environment [virtualenv]
40 40
 
41 41
 Run the following commands:
42 42
 
43  
-    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
  43
+    sudo apt-get install python-opencv python-setuptools python-pip gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev mercurial
44 44
     sudo pip install virtualenv
45  
-    virtualenv virtualSCV
46  
-    cd virtualSCV
  45
+    virtualenv venv
  46
+    cd venv
47 47
     mkdir src
48  
-    cp /usr/local/lib/python2.7/dist-packages/cv* ./lib/python2.7/site-packages
49  
-    ./bin/pip install numpy
50  
-    ./bin/pip install scipy
  48
+    ln -s /usr/local/lib/python2.7/dist-packages/cv2.so lib/python2.7/site-packages/cv2.so
  49
+    ln -s /usr/local/lib/python2.7/dist-packages/cv.py lib/python2.7/site-packages/cv.py
  50
+    ./bin/pip install https://github.com/numpy/numpy/zipball/master
  51
+    ./bin/pip install https://github.com/scipy/scipy/zipball/master
51 52
     ./bin/pip install PIL
52 53
     ./bin/pip install ipython
53  
-    hg clone http://bitbucket.org/pygame/pygame src/pygame
54  
-    source bin/activate
55  
-    cd src/pygame
56  
-    python setup.py -setuptools install
57  
-    pip install https://github.com/ingenuitas/SimpleCV/zipball/master
  54
+    mkdir src
  55
+    wget -O src/pygame.tar.gz https://bitbucket.org/pygame/pygame/get/6625feb3fc7f.tar.gz
  56
+    cd src
  57
+    tar zxvf pygame.tar.gz
  58
+    cd ..
  59
+    ./bin/python src/pygame-pygame-6625feb3fc7f/setup.py -setuptools install
  60
+    ./bin/pip install https://github.com/ingenuitas/SimpleCV/zipball/master
58 61
   
59 62
 
60 63
 
11  requirements.txt
... ...
@@ -1,8 +1,5 @@
1  
-SimpleCV
2  
-
3  
-pygame>=1.9.1
4  
-PIL==1.1.7
5  
-nose>=1.0.0
6  
-ipython>=0.12
7  
-numpy>=numpy-2.0.0
  1
+https://github.com/numpy/numpy/zipball/master
  2
+https://github.com/scipy/scipy/zipball/master
  3
+PIL
  4
+ipython
8 5
 
47  scripts/mkvirt.py
... ...
@@ -0,0 +1,47 @@
  1
+import os
  2
+import virtualenv, textwrap
  3
+
  4
+here = os.path.dirname(os.path.abspath(__file__))
  5
+base_dir = os.path.dirname(here)
  6
+
  7
+print "Creating SimpleCV Bootstrap Install Script: simplecv-bootstrap.py"
  8
+
  9
+output = virtualenv.create_bootstrap_script(textwrap.dedent("""
  10
+import os, subprocess
  11
+
  12
+def after_install(options, home_dir):
  13
+    base_dir = os.path.dirname(home_dir)
  14
+    logger.notify('Installing SimpleCV into Virtual Environment')
  15
+    
  16
+    os.chdir(home_dir)
  17
+    print 'Current Directory:', os.getcwd()
  18
+    print 'dir list:', os.listdir(os.getcwd())
  19
+    print 'Symlinking OpenCV'
  20
+    os.symlink('/usr/local/lib/python2.7/dist-packages/cv2.so', os.path.join(os.getcwd(),'lib/python2.7/site-packages/cv2.so'))
  21
+    os.symlink('/usr/local/lib/python2.7/dist-packages/cv.py', os.path.join(os.getcwd(),'lib/python2.7/site-packages/cv.py'))
  22
+    subprocess.call(['pwd'])
  23
+    os.mkdir('src')
  24
+    os.chdir('src')
  25
+    subprocess.call(['wget','-O','pygame.tar.gz','http://github.com/xamox/pygame/tarball/master'])
  26
+    subprocess.call(['tar','zxvf','pygame.tar.gz'])
  27
+    print 'Runing setup for pygame'
  28
+    subprocess.call(['ls'])
  29
+    os.chdir('../')
  30
+    print 'Current Directory:', os.getcwd()
  31
+    print os.getcwd()
  32
+    subprocess.call(['./bin/python','src/xamox-pygame-3e48d10/setup.py','install'])
  33
+
  34
+
  35
+"""))
  36
+f = open('simplecv-bootstrap.py', 'w').write(output)
  37
+
  38
+
  39
+#~ sudo apt-get install python-opencv python-setuptools python-pip gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev mercurial
  40
+
  41
+#~ source bin/activate
  42
+#~ cd src/pygame
  43
+#~ python setup.py -setuptools install
  44
+#~ pip install https://github.com/ingenuitas/SimpleCV/zipball/masteriii
  45
+#    call_subprocess(['python','setup.py','-setuptools','install'], show_stdout=True)
  46
+#call_subprocess([join(home_dir, 'bin', 'pip'),'install','-r','requirements.txt'], show_stdout=True)
  47
+    
53  scripts/virtualenv-bootstrap.sh
... ...
@@ -0,0 +1,53 @@
  1
+#!/bin/bash
  2
+
  3
+reset
  4
+echo "This Script Creates a python virtual environment for SimpleCV"
  5
+echo ""
  6
+echo ""
  7
+read -p "Continue [Y/n]? " -n 1
  8
+if [[ $REPLY =~ ^[Nn]$ ]]
  9
+then
  10
+		echo ""
  11
+    exit 1
  12
+fi
  13
+
  14
+read -p "Install System Level Dependencies [y/N]? " -n 1
  15
+if [[ $REPLY =~ ^[Yy]$ ]]
  16
+then
  17
+		echo ""
  18
+		echo "Installing System Dependencies....."
  19
+    sudo apt-get install python-opencv python-setuptools python-pip gfortran g++ liblapack-dev libsdl1.2-dev libsmpeg-dev
  20
+fi
  21
+
  22
+
  23
+echo "Creating Virtual Environment"
  24
+virtualenv venv
  25
+echo "Entering Virtual Environment"
  26
+cd venv
  27
+echo "Symbolic Linking OpenCV"
  28
+ln -s /usr/local/lib/python2.7/dist-packages/cv2.so lib/python2.7/site-packages/cv2.so
  29
+ln -s /usr/local/lib/python2.7/dist-packages/cv.py lib/python2.7/site-packages/cv.py
  30
+echo "Installing dependencies"
  31
+./bin/pip install https://github.com/numpy/numpy/zipball/master
  32
+./bin/pip install https://github.com/scipy/scipy/zipball/master
  33
+./bin/pip install PIL
  34
+./bin/pip install ipython
  35
+echo "Downloading pygame"
  36
+mkdir src
  37
+wget -O src/pygame.tar.gz https://bitbucket.org/pygame/pygame/get/6625feb3fc7f.tar.gz
  38
+cd src
  39
+tar zxvf pygame.tar.gz
  40
+cd ..
  41
+echo "Running setup for pygame"
  42
+./bin/python src/pygame-pygame-6625feb3fc7f/setup.py -setuptools install
  43
+./bin/pip install https://github.com/ingenuitas/SimpleCV/zipball/master
  44
+
  45
+reset
  46
+echo "SimpleCV should now be installed in the virtual environment"
  47
+echo "to run just type:"
  48
+echo ""
  49
+echo "cd venv"
  50
+echo "source bin/activate"
  51
+echo "simplecv"
  52
+echo ""
  53
+

0 notes on commit eac5473

Please sign in to comment.
Something went wrong with that request. Please try again.