== Building backwards compatible binaries on OS X

Building yubioath-desktop compatible with OS X 10.7 (Lion) requires the `CFLAGS` variable to be set.
All dependencies also needs to be built with this flag.

    export CFLAGS="-mmacosx-version-min=10.7"

=== Python

Install Python 2.7 from python.org

=== CMake
Install CMake from cmake.org
    
    ln -s /Applications/CMake.app/Contents/bin/cmake /usr/local/bin/cmake

=== Swig
Download swig-3.0.8.tar.gz source from swig.org
    
    tar -xzcf swig-3.0.8.tar.gz
    cd swig-3.0.8
    curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
    sh Tools/pcre-build.sh
   ./configure
    make
    make install

=== Qt 4
A patch is included in this repository to make Qt 4.8.6 compile on OS X.
    
    curl -O http://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
    tar -xzvf qt-everywhere-opensource-src-4.8.6.tar.gz
    cd qt-everywhere-opensource-src-4.8.6
    patch < yubioath-desktop/doc/qt4-8-6-on-osx.patch
    ./configure
    make
    make install
    
    ln -s /usr/local/Trolltech/Qt-4.8.6/bin/qmake /usr/local/bin/qmake

=== Wheel, pyscard, pycrypto
    pip install wheel
    pip install pyscard
    pip install pycrypto

=== PySide
    curl -O wget https://pypi.python.org/packages/source/P/PySide/PySide-1.2.4.tar.gz
    tar -xzcf PySide-1.2.4.tar.gz
    cd PySide-1.2.4
    python2.7 setup.py bdist_wheel
    pip install dist/PySide-1.2.4-cp27-none-linux-x86_64.whl

=== Build .app 
    python setup.py executable
