# Path: gitversion.py
# def get_version(**kwargs):
#     ''' Calculate a valid PEP440 version number based on git history.
# 
#     If possible the version is computed from the output of ``git describe``.
#     If that is successful, the version string is written to the file
#     ``RELEASE-VERSION``.
# 
#     If ``git describe`` fails (most likely because we’re in an unpacked
#     copy of an sdist rather than in a git working copy) then we fall back
#     on reading the contents of the ``RELEASE-VERSION`` file.
# 
#     '''
#     cached_version = get_cached_version()
#     git_version = get_git_version(**kwargs)
# 
#     if git_version is None:
#         if cached_version is None:
#             raise RuntimeError('can not determine version number')
#         return cached_version
# 
#     if cached_version != git_version:
#         set_cached_version(git_version)
#     return git_version


from setuptools import setup, find_packages
from glob import glob
from gitversion import get_version
    from cx_Freeze import setup, Executable  # noqa
import json
import codecs
import sys
import os
import platform


if sys.argv[1] in ('build', 'bdist_msi', 'bdist_mac', 'bdist_dmg',
                   'install_exe'):

    cxfreeze_options = {
        'options': {
            'build_exe': {
                'includes': ['numpy.core._methods',
                             'numpy.lib.format',
                             'pyqtgraph.debug',
                             'pyqtgraph.ThreadsafeTimer',
                             'vispy.app.backends._pyqt5',
                             ],
                'include_files': [],
                'packages': ['asyncio'],
                'excludes': ['tkinter']
            },
            'bdist_mac': {
                'iconfile': 'icon-256.icns',
                'bundle_name': 'Crazyflie client',
            },
        },
        'executables': [Executable("bin/cfclient", icon='bitcraze.ico')],
    }
    if platform.system() == 'Darwin':
        cxfreeze_options['options']['build_exe']['include_files'] = [
                ('/usr/local/lib/libusb-1.0.0.dylib', 'libusb.dylib'),
                ('/usr/local/lib/libSDL2-2.0.0.dylib', 'libSDL2.dylib'),
            ]

# Path: gitversion.py
# def get_version(**kwargs):
#     ''' Calculate a valid PEP440 version number based on git history.
# 
#     If possible the version is computed from the output of ``git describe``.
#     If that is successful, the version string is written to the file
#     ``RELEASE-VERSION``.
# 
#     If ``git describe`` fails (most likely because we’re in an unpacked
#     copy of an sdist rather than in a git working copy) then we fall back
#     on reading the contents of the ``RELEASE-VERSION`` file.
# 
#     '''
#     cached_version = get_cached_version()
#     git_version = get_git_version(**kwargs)
# 
#     if git_version is None:
#         if cached_version is None:
#             raise RuntimeError('can not determine version number')
#         return cached_version
# 
#     if cached_version != git_version:
#         set_cached_version(git_version)
#     return git_version


# Path: setup.py
from setuptools import setup, find_packages
from glob import glob
from gitversion import get_version
    from cx_Freeze import setup, Executable  # noqa
import json
import codecs
import sys
import os
import platform



if sys.argv[1] in ('build', 'bdist_msi', 'bdist_mac', 'bdist_dmg',
                   'install_exe'):

    cxfreeze_options = {
        'options': {
            'build_exe': {
                'includes': ['numpy.core._methods',
                             'numpy.lib.format',
                             'pyqtgraph.debug',
                             'pyqtgraph.ThreadsafeTimer',
                             'vispy.app.backends._pyqt5',
                             ],
                'include_files': [],
                'packages': ['asyncio'],
                'excludes': ['tkinter']
            },
            'bdist_mac': {
                'iconfile': 'icon-256.icns',
                'bundle_name': 'Crazyflie client',
            },
        },
        'executables': [Executable("bin/cfclient", icon='bitcraze.ico')],
    }
    if platform.system() == 'Darwin':
        cxfreeze_options['options']['build_exe']['include_files'] = [
                ('/usr/local/lib/libusb-1.0.0.dylib', 'libusb.dylib'),
                ('/usr/local/lib/libSDL2-2.0.0.dylib', 'libSDL2.dylib'),
            ]

else: