def _install_cmake_win(user_io, bii_paths): filename = download(_get_cmake_download_url(), 'cmake%s.zip' % _CMAKE_VERSION) user_io.out.info("Unzipping cmake") install_path = bii_paths.user_bii_home decompress(filename, install_path) return_path = os.path.join(install_path, "cmake-%s-win32-x86/bin" % _CMAKE_VERSION) cmake_path = return_path.replace('\\', '/') return cmake_path
def _install_cmake_mac(user_io): filename = download(_get_cmake_download_url(), 'cmake%s.dmg' % _CMAKE_VERSION) user_io.out.writeln('Click on Agree and drag CMake.app to your Applications folder') os.system('open %s' % filename) user_io.request_string('Please press ENTER when finished installing cmake') if not os.path.exists('/Applications/CMake.app/Contents/bin/'): user_io.out.error('CMake.app not found in Applications folder') return '/Applications/CMake.app/Contents/bin/'
def _install_cmake_mac(user_io): filename = download(_get_cmake_download_url(), 'cmake%s.dmg' % _CMAKE_VERSION) user_io.out.writeln( 'Click on Agree and drag CMake.app to your Applications folder') os.system('open %s' % filename) user_io.request_string('Please press ENTER when finished installing cmake') if not os.path.exists('/Applications/CMake.app/Contents/bin/'): user_io.out.error('CMake.app not found in Applications folder') return '/Applications/CMake.app/Contents/bin/'
def _install_cmake_linux(user_io, bii_paths): url = _get_cmake_download_url() basename = os.path.basename(url) package_name = os.path.basename(url) uncompressed_name = basename.replace(".tar.gz", "") filename = download(url, package_name) user_io.out.info("Extracting cmake") install_path = bii_paths.user_bii_home if not os.path.exists(install_path): os.mkdir(install_path) decompress(filename, install_path) cmake_path = os.path.join(install_path, uncompressed_name) bin_path = os.path.join(cmake_path, "bin") return bin_path
def _install_arduino_sdk(user_io): url = get_arduino_download_url(CURRENT_VERSION) decompress_to_folder = _get_install_arduino_sdk_path(CURRENT_VERSION) if url: filename = download(url, url.split("/")[-1]) user_io.out.info("Unzipping arduino SDK. Please wait, this can take a while...") if not os.path.exists(decompress_to_folder): os.makedirs(decompress_to_folder) decompress(filename, decompress_to_folder) osinfo = OSInfo.capture() if osinfo.family == 'Windows' and osinfo.subfamily == '8': drivers = '%s/drivers' % decompress_to_folder user_io.out.warn('Windows 8 does not automatically detect Arduino drivers.\n' 'When installing the drivers, please use this folder: %s' % drivers)
def install_mingw(user_io, optional): install = True if optional: user_io.out.writeln('MinGW is a free GNU C/C++ compiler and tools for windows\n' 'You need it to build C/C++ applications if you are not using\n' 'another compiler as e.g. Visual Studio', front=Color.CYAN) install = user_io.request_boolean('Do you want to install MinGW?', True) if install: user_io.out.writeln('Downloading mingw tools', front=Color.GREEN) filename = download(get_mingw_download_url(), 'MinGW.zip') user_io.out.info("Unzipping mingw. Please wait, this can take a while...") decompress(filename, 'C:\\') mingwpath = 'C:/MinGW/bin' mingwpath = mingwpath.replace('/', '\\') add2path(mingwpath) user_io.out.success("MinGW installed in %s!" % mingwpath) return True
def install_gnu_arm(user_io): if not OSInfo.is_linux(): raise ClientException("ARM Cross compile only works on Linux") install_linux_x32_compatibility(user_io) c_path, cpp_path = find_gnu_arm() if c_path is None or cpp_path is None: url = S3_URL + "raspberry_cross_compilers.tgz" filename = download(url, url.split("/")[-1]) user_io.out.info("Unzipping arm gnu SDK") install_path = get_biicode_env_folder_path() if not os.path.exists(install_path): os.mkdir(install_path) decompress(filename, install_path) user_io.out.success('Installed GNU ARM compilers for RPI') # Try to find again c_path, cpp_path = find_gnu_arm() else: user_io.out.writeln('The arm gnu is already downloaded', front=Color.GREEN) return c_path, cpp_path
def install_mingw(user_io, optional): install = True if optional: user_io.out.writeln( 'MinGW is a free GNU C/C++ compiler and tools for windows\n' 'You need it to build C/C++ applications if you are not using\n' 'another compiler as e.g. Visual Studio', front=Color.CYAN) install = user_io.request_boolean('Do you want to install MinGW?', True) if install: user_io.out.writeln('Downloading mingw tools', front=Color.GREEN) filename = download(get_mingw_download_url(), 'MinGW.zip') user_io.out.info( "Unzipping mingw. Please wait, this can take a while...") decompress(filename, 'C:\\') mingwpath = 'C:/MinGW/bin' mingwpath = mingwpath.replace('/', '\\') add2path(mingwpath) user_io.out.success("MinGW installed in %s!" % mingwpath) return True