4 If you are reading this, then you are looking at the *development* version of Cura. If you just want to use Cura look at the following location: https://github.com/daid/Cura/wiki
9 Cura is developed in Python. Getting Cura up and running for development is not very difficult. If you copy the python and pypy from a release into your Cura development checkout then you can use Cura right away, just like you would with a release.
10 For development with git, check the help on github. Pull requests is the fastest way to get changes into Cura.
16 Cura development comes with a script "package.sh", this script has been designed to run under unix like OSes (Linux, MacOS). Running it from sygwin is not a priority.
17 The "package.sh" script generates a final release package. You should not need it during development, unless you are changing the release process. If you want to distribute your own version of Cura, then the package.sh script will allow you to do that.
22 The following section describes how to prepare working environment for developing and packaing for Mac OS X.
23 The working environment consist of build of Python, build of wxPython and all required Python packages.
25 We assume you already have Apple hardware with [64bit processor](http://support.apple.com/kb/HT3696) and you are familiar with tools like [virtualenv](http://pypi.python.org/pypi/virtualenv), [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/en/latest/) and [pip](http://www.pip-installer.org/en/latest/). Also ensure you have modern compiler installed.
29 You'll need **non-system**, **framework-based**, **universal** with **deployment target set to 10.6** build of Python 2.7
31 **non-system**: Python is not bundeled with distribution of Mac OS X. Output of
32 `python -c "import sys; print sys.prefix"`
33 Output should *not* start with *"/System/Library/Frameworks/Python.framework/"*.
35 **framework-based**: Output of
36 `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"`
37 should be non-empty string.
39 **universal**: Output of
40 ``lipo -info `which python` ``
41 should include both i386 and x86_64. E.g *"Architectures in the fat file: /usr/local/bin/python are: i386 x86_64"*.
43 **deployment target set to 10.6**: Output of
44 ``otool -l `which python` ``
45 should contain *"cmd LC_VERSION_MIN_MACOSX ... version 10.6"*.
47 The easiest way to install it is via [Homebrew](http://mxcl.github.com/homebrew/):
48 `brew install --fresh https://github.com/downloads/GreatFruitOmsk/Cura/python.rb --universal`
49 Note if you already have Python installed via Homebrew, you have to uninstall it first.
52 ###Configure Virtualenv
53 Create new virtualenv. If you have [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/en/latest/) installed:
56 wxPython cannot be installed via pip, we have to build it from source by specifing prefix to our virtualenv.
58 Assuming you have virtualenv at *~/.virtualenvs/Cura/* and [wxPython sources](http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2) at *~/Downloads/wxPython-src-2.9.4.0/*:
60 1. `cd` into *~/Downloads/wxPython-src-2.9.4.0/* and configure the sources:
62 ./configure --enable-universal_binary=i386,x86_64 \
63 --prefix=$HOME/.virtualenvs/Cura/ \
65 --with-libjpeg=builtin \
66 --with-libpng=builtin \
67 --with-libtiff=builtin \
70 --with-macosx-version-min=10.6 \
84 Note to speedup the process I recommend you to enable multicore build by adding the -j*cores* flag:
86 3. `cd` into *~/Downloads/wxPython-src-2.9.4.0/wxPython/*
87 4. Build wxPython (Note `python` is the python of your virtualenv):
89 python setup.py build_ext \
91 WX_CONFIG=$HOME/.virtualenvs/Cura/bin/wx-config \
93 INSTALL_MULTIVERSION=0 \
98 5. Install wxPython (Note `python` is the python of your virtualenv):
100 python setup.py install \
101 --prefix=$HOME/.virtualenvs/Cura/ \
103 WX_CONFIG=$HOME/.virtualenvs/Cura/bin/wx-config \
105 INSTALL_MULTIVERSION=0 \
110 6. Create file *~/.virtualenvs/Cura/bin/pythonw* with the following content:
113 ENV=`python -c "import sys; print sys.prefix"`
114 PYTHON=`python -c "import sys; print sys.real_prefix"`/bin/python
115 export PYTHONHOME=$ENV
118 At this point virtualenv is configured for wxPython development.
119 Remember to use `python` for pacakging and `pythonw` to run app for debugging.
122 ###Install Python Packages
123 Required python packages are specified in *requirements.txt* and *requirements_darwin.txt*
124 If you use virtualenv, installing requirements as easy as `pip install -r requirements_darwin.txt`
126 At time of writing PyObjC 2.5 is not available via pip, so you have to install it manually (Note `python` is the python of your virtualenv):
128 1. Download [PyObjC 2.5](https://bitbucket.org/ronaldoussoren/pyobjc/get/pyobjc-2.5.zip)
129 2. Extract the archive and `cd` into the directory
130 3. `python install.py`
131 If build fails, try to use clang: `CC=/usr/bin/clang python install.py`
134 ###Package Cure into application
135 Ensure that `package.sh` build target (see the very top of the file) is:
137 #BUILD_TARGET=${1:-all}
142 Also ensure that virtualenv is activated, so `python` points to the python of your virtualenv (e.g. ~/.virtualenvs/Cura/bin/python).
146 Cura was built (and each build was tested) on the following platforms:
151 - 10.8.3 (Jan 8 Seed)
153 With following tools, libs and python pacakges:
155 - Python 2.7.3 (installed via [Homebrew](http://mxcl.github.com/homebrew/) by using custom [formula](https://github.com/downloads/GreatFruitOmsk/Cura/python.rb) with *--universal* option)
156 - [wxPython 2.9.4.0](http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2)
157 - virtualenvwrapper 3.6
159 - llvm-gcc 4.2 (/usr/bin/cc == /usr/bin/llvm-gcc-4.2)
160 - clang 2.1, 3.0 (PyObjC 2.5 failed to build with llvm-gcc)
161 - [PyObjC 2.5](https://bitbucket.org/ronaldoussoren/pyobjc/get/pyobjc-2.5.zip)