MCPcopy Create free account
hub / github.com/kivy/python-for-android / build_arch

Method build_arch

pythonforandroid/recipes/icu/__init__.py:54–113  ·  view source on GitHub ↗
(self, arch)

Source from the content-addressed store, hash-verified

52 return join(self.ctx.root_dir, 'recipes', 'icu')
53
54 def build_arch(self, arch):
55 env = self.get_recipe_env(arch).copy()
56 build_root = self.get_build_dir(arch.arch)
57
58 def make_build_dest(dest):
59 build_dest = join(build_root, dest)
60 if not isdir(build_dest):
61 ensure_dir(build_dest)
62 return build_dest, False
63
64 return build_dest, True
65
66 icu_build = join(build_root, "icu_build")
67 build_host, exists = make_build_dest("build_icu_host")
68
69 host_env = os.environ.copy()
70 # reduce the function set
71 host_env["CPPFLAGS"] = (
72 "-O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=1 -fno-short-enums "
73 "-DU_HAVE_NL_LANGINFO_CODESET=0 -D__STDC_INT64__ -DU_TIMEZONE=0 "
74 "-DUCONFIG_NO_LEGACY_CONVERSION=1 "
75 "-DUCONFIG_NO_TRANSLITERATION=0 ")
76
77 if not exists:
78 icu4c_host_platform = platform.system()
79 if icu4c_host_platform == "Darwin":
80 icu4c_host_platform = "MacOSX"
81 configure = sh.Command(
82 join(build_root, "source", "runConfigureICU"))
83 with current_directory(build_host):
84 shprint(
85 configure,
86 icu4c_host_platform,
87 "--prefix="+icu_build,
88 "--enable-extras=no",
89 "--enable-strict=no",
90 "--enable-static=no",
91 "--enable-tests=no",
92 "--enable-samples=no",
93 _env=host_env)
94 shprint(sh.make, "-j", str(cpu_count()), _env=host_env)
95 shprint(sh.make, "install", _env=host_env)
96 build_android, exists = make_build_dest("build_icu_android")
97 if not exists:
98 configure = sh.Command(join(build_root, "source", "configure"))
99
100 with current_directory(build_android):
101 shprint(
102 configure,
103 "--with-cross-build="+build_host,
104 "--enable-extras=no",
105 "--enable-strict=no",
106 "--enable-static=no",
107 "--enable-tests=no",
108 "--enable-samples=no",
109 "--host="+arch.command_prefix,
110 "--prefix="+icu_build,
111 _env=env)

Callers

nothing calls this directly

Calls 4

current_directoryFunction · 0.90
shprintFunction · 0.85
get_recipe_envMethod · 0.45
get_build_dirMethod · 0.45

Tested by

no test coverage detected