(
settings,
client,
image,
entry,
host_platform,
target_triple,
build_options,
dest_archive,
extra_archives=None,
tools_path="deps",
python_host_version=None,
)
| 227 | |
| 228 | |
| 229 | def simple_build( |
| 230 | settings, |
| 231 | client, |
| 232 | image, |
| 233 | entry, |
| 234 | host_platform, |
| 235 | target_triple, |
| 236 | build_options, |
| 237 | dest_archive, |
| 238 | extra_archives=None, |
| 239 | tools_path="deps", |
| 240 | python_host_version=None, |
| 241 | ): |
| 242 | archive = download_entry(entry, DOWNLOADS_PATH) |
| 243 | |
| 244 | with build_environment(client, image) as build_env: |
| 245 | if settings.get("needs_toolchain"): |
| 246 | build_env.install_toolchain( |
| 247 | BUILD, |
| 248 | host_platform, |
| 249 | target_triple, |
| 250 | binutils=install_binutils(host_platform), |
| 251 | clang=True, |
| 252 | musl="musl" in target_triple, |
| 253 | static="static" in build_options, |
| 254 | ) |
| 255 | |
| 256 | for a in extra_archives or []: |
| 257 | build_env.install_artifact_archive(BUILD, a, target_triple, build_options) |
| 258 | |
| 259 | if python_host_version: |
| 260 | majmin = ".".join(python_host_version.split(".")[0:2]) |
| 261 | build_env.install_toolchain_archive( |
| 262 | BUILD, |
| 263 | f"cpython-{majmin}", |
| 264 | host_platform, |
| 265 | version=python_host_version, |
| 266 | ) |
| 267 | |
| 268 | build_env.copy_file(archive) |
| 269 | build_env.copy_file(SUPPORT / ("build-%s.sh" % entry)) |
| 270 | |
| 271 | env = { |
| 272 | "%s_VERSION" % entry.upper().replace("-", "_").replace(".", "_"): DOWNLOADS[ |
| 273 | entry |
| 274 | ]["version"], |
| 275 | } |
| 276 | |
| 277 | if "static" in build_options: |
| 278 | env["STATIC"] = 1 |
| 279 | |
| 280 | add_target_env(env, host_platform, target_triple, build_env, build_options) |
| 281 | |
| 282 | # for OpenSSL, set the OPENSSL_TARGET environment variable |
| 283 | if entry.startswith("openssl-"): |
| 284 | settings = get_targets(TARGETS_CONFIG)[target_triple] |
| 285 | env["OPENSSL_TARGET"] = settings["openssl_target"] |
| 286 |
no test coverage detected