def find_gnu_arm(): path_gnu_arm = os.path.join(get_biicode_env_folder_path(), 'raspberry_cross_compilers') bin_path = os.path.join(path_gnu_arm, 'arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin') c_path = os.path.join(bin_path, 'arm-bcm2708hardfp-linux-gnueabi-gcc') cpp_path = os.path.join(bin_path, 'arm-bcm2708hardfp-linux-gnueabi-g++') if not os.path.exists(c_path) or not os.path.exists(c_path): return None, None return c_path, cpp_path
def _get_all_arduino_sdk_paths(): """Get all the paths we need to look at an SDK""" paths_to_look = [_get_standard_path()] for compatible in ARDUINO_SDK_COMPATIBLE_VERSIONS: version_path = os.path.join(get_biicode_env_folder_path(), "arduino-%s" % compatible) if OSInfo.is_mac(): version_path = os.path.join(version_path, "Arduino.app/Contents/Resources/Java") paths_to_look.append(version_path.replace('\\', '/')) return paths_to_look
def test_find_gnu_arm(self, exists): exists.return_value = False self.assertEqual((None, None), find_gnu_arm()) exists.return_value = True c_path, cpp_path = find_gnu_arm() inst_path = get_biicode_env_folder_path().replace('\\', '/') c_path = c_path.replace('\\', '/') cpp_path = cpp_path.replace('\\', '/') inst_path = '%s/raspberry_cross_compilers/arm-bcm2708/'\ 'arm-bcm2708hardfp-linux-gnueabi/bin/'\ 'arm-bcm2708hardfp-linux-gnueabi' % inst_path self.assertTrue(cpp_path.endswith('%s-g++' % inst_path)) self.assertTrue(c_path.endswith('%s-gcc' % inst_path))
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 _get_install_arduino_sdk_path(version): if OSInfo.is_mac(): decompress_to_folder = os.path.join(get_biicode_env_folder_path(), "arduino-%s" % version) else: decompress_to_folder = get_biicode_env_folder_path() return decompress_to_folder