chiark / gitweb /
Merge remote-tracking branch 'upstream/master' into macosx
[cura.git] / README.md
1 Cura
2 ====
3
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
5
6 Development
7 ===========
8
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.
11
12 Mac OS X
13 --------
14 The following section describes how to prepare environment for developing and packaing for Mac OS X.
15
16 ###Python
17 You'll need non-system, framework-based, universal with min deployment target set to 10.6 build of Python 2.7
18
19 **non-system**: it was not bundeled with distribution of Mac OS X. You can check this by `python -c "import sys; print sys.prefix"`. Output should *not* start with *"/System/Library/Frameworks/Python.framework/"*
20
21 **framework-based**: Output of `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"` should be non-empty string
22
23 **universal**: output of ``lipo -info `which python` `` include both i386 and x86_64. E.g *"Architectures in the fat file: /usr/local/bin/python are: i386 x86_64"*
24
25 **deployment target set to 10.6**: Output of ``otool -l `which python` `` should contain *"cmd LC_VERSION_MIN_MACOSX ... version 10.6"*
26
27 The easiest way to install it is via [Homebrew](http://mxcl.github.com/homebrew/): `brew install --fresh osx_python_cura.rb --universal` (TODO: upload the formula). Note you'll need to uninstall Python if you already have it installed
28
29 ###virtualenv
30 You may skip this step if you don't bother to use [virtualenv](http://pypi.python.org/pypi/virtualenv). It's not a requirement.
31
32 The main problem with virtualenv is that wxWidgets cannot be installed via pip. We'll have to build it manually from source by specifing prefix to our virtualenv. Assume you have virtualenv at *~/.virtualenvs/Cura*.
33
34 1. Download [the sources](http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2)
35 2. Configure project with the following flags: `./configure
36 3. `make install`
37 4. cd into the *wxPython* directory
38 5. Build extension:
39 6. Install Python bindings to wxWidgets
40
41 Another problem is that with current installation you'll be only able to package the app, but not test it. The problem is that Mac OS X requires to bundle GUI code.
42 The workaround is to add another executable which we will use only for debugging. Add the following script to *~/.virtualenvs/Cura/bin*:
43
44     #!/bin/bash
45     ENV=`python -c "import sys; print sys.prefix"
46     PYTHON=`python -c "import sys; print sys.real_prefix`/bin/python
47     export PYTHONHOME=$ENV
48     exec $PYTHON "$@"
49
50 Then to pacakge the app use the default virtualenv python and this script if you want to debug your code.
51
52 ###requirements
53
54
55
56
57 Packaging
58 ---------
59
60 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.
61 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.