Skip to content

Commit

Permalink
Updated packaging for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Mar 16, 2016
1 parent 087a656 commit 81d3cbe
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
30 changes: 20 additions & 10 deletions doc/development/darwin.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ If you are a developer and you want to modify the code, contribute, build packag

### Tools

#### Install FTDI driver
* [FTDI USB Driver](http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_3.dmg)

#### Install Homebrew
```bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Expand All @@ -23,12 +26,11 @@ brew install git
```

#### Python
Install non-system, framework-based, universal [Python](http://www.python.org/ftp/python/2.7.6/python-2.7.6-macosx10.6.dmg). Not with brew
Install non-system, framework-based, universal [Python](http://www.python.org/ftp/python/2.7.6/python-2.7.6-macosx10.6.dmg). Not with brew.

#### Python tools
```bash
sudo easy_install pip
sudo -H pip install -U pip setuptools
pip install -U pip setuptools
```

### Dependencies
Expand All @@ -38,32 +40,40 @@ Following dependencies are included in dmg package, but if you want to install i
#### OpenCV
```bash
brew tap homebrew/science
brew info opencv
brew install opencv
```

```bash
sudo ln -s /usr/local/Cellar/opencv/2.4.12_2/lib/python2.7/site-packages/cv.py /Library/Python/2.7/site-packages/cv.py
sudo ln -s /usr/local/Cellar/opencv/2.4.12_2/lib/python2.7/site-packages/cv2.so /Library/Python/2.7/site-packages/cv2.so
```

#### wxPython
```bash
brew install wxpython
```

NOTE: in order to build Horus for other Mac OS X versions you must to install official dmg

* [wxPython](http://downloads.sourceforge.net/wxpython/3.0.2.0/wxPython3.0-osx-3.0.2.0-cocoa-py2.7.dmg). Not with brew

```bash
sudo installer -pkg /path/to/pkg -target /
sudo ln -s /usr/local/Cellar/wxpython/3.0.2.0/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx /Library/Python/2.7/site-packages/wx
```

#### Python modules
```bash
sudo -H pip install -U pyserial pyopengl pyopengl-accelerate numpy scipy matplotlib==1.4.0 pyobjc-framework-qtkit
pip install -U pyserial pyopengl pyopengl-accelerate numpy scipy matplotlib==1.4.0 pyobjc-framework-qtkit
```

NOTE: if 'xcodebuild' fails, try:

```bash
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
```

In order to generate dmg package, some extra dependencies are needed

#### Packaging dependencies
```bash
sudo -H pip install -U py2app==0.7.2
pip install -U py2app==0.7.2
```

To reduce the package size, "tests" directories must be removed
Expand Down
18 changes: 14 additions & 4 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ if [ $BUILD_TARGET = "win32" ]; then
fi

# Update version data
sed -i "s/__datetime__ = ''/__datetime__ = '$DATETIME'/;" src/horus/__init__.py
sed -i "s/__commit__ = ''/__commit__ = '$COMMIT'/;" src/horus/__init__.py
if [ $BUILD_TARGET = "darwin" ]; then
sed -i "" "s/__datetime__ = ''/__datetime__ = '$DATETIME'/;" src/horus/__init__.py
sed -i "" "s/__commit__ = ''/__commit__ = '$COMMIT'/;" src/horus/__init__.py
else
sed -i "s/__datetime__ = ''/__datetime__ = '$DATETIME'/;" src/horus/__init__.py
sed -i "s/__commit__ = ''/__commit__ = '$COMMIT'/;" src/horus/__init__.py
fi

if [ $BUILD_TARGET = "version" ]
then
Expand Down Expand Up @@ -322,5 +327,10 @@ if [ $BUILD_TARGET = "win32" ]; then
fi

# Restore version data
sed -i "s/__datetime__ = '$DATETIME'/__datetime__ = ''/;" src/horus/__init__.py
sed -i "s/__commit__ = '$COMMIT'/__commit__ = ''/;" src/horus/__init__.py
if [ $BUILD_TARGET = "darwin" ]; then
sed -i "" "s/__datetime__ = '$DATETIME'/__datetime__ = ''/;" src/horus/__init__.py
sed -i "" "s/__commit__ = '$COMMIT'/__commit__ = ''/;" src/horus/__init__.py
else
sed -i "s/__datetime__ = '$DATETIME'/__datetime__ = ''/;" src/horus/__init__.py
sed -i "s/__commit__ = '$COMMIT'/__commit__ = ''/;" src/horus/__init__.py
fi
2 changes: 1 addition & 1 deletion setup_mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from horus import __version__

APP = ['horus']
DATA_FILES = ['doc', 'res']
DATA_FILES = ['res']

PLIST = {
u'CFBundleName': u'Horus',
Expand Down
8 changes: 4 additions & 4 deletions src/horus/engine/algorithms/image_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ def __init__(self):
self._flush_stream_laser = 2
self._flush_stream_pattern = 0
elif system == 'Darwin':
self._flush_texture = 3
self._flush_laser = 3
self._flush_pattern = 3
self._flush_texture = 4
self._flush_laser = 4
self._flush_pattern = 4
self._flush_stream_texture = 0
self._flush_stream_laser = 3
self._flush_stream_laser = 2
self._flush_stream_pattern = 0
elif system == 'Windows':
self._flush_texture = 4
Expand Down

0 comments on commit 81d3cbe

Please sign in to comment.