2021-06-22 15:51:29 +00:00
|
|
|
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")
|
|
|
|
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "all_srcs",
|
2021-12-30 16:37:31 +00:00
|
|
|
srcs = glob(
|
|
|
|
include = ["**"],
|
|
|
|
exclude = ["*.bazel"],
|
|
|
|
),
|
2021-06-22 15:51:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
configure_make(
|
|
|
|
name = "python3",
|
|
|
|
configure_options = [
|
|
|
|
"CFLAGS='-Dredacted=\"redacted\"'",
|
2023-10-14 19:49:27 +00:00
|
|
|
"--with-openssl=$$EXT_BUILD_DEPS/openssl",
|
|
|
|
"--with-zlib=$$EXT_BUILD_DEPS/zlib",
|
2021-06-22 15:51:29 +00:00
|
|
|
"--enable-optimizations",
|
|
|
|
],
|
|
|
|
env = select({
|
|
|
|
"@platforms//os:macos": {"AR": ""},
|
|
|
|
"//conditions:default": {},
|
|
|
|
}),
|
|
|
|
features = select({
|
|
|
|
"@platforms//os:macos": ["-headerpad"],
|
|
|
|
"//conditions:default": {},
|
|
|
|
}),
|
|
|
|
# rules_foreign_cc defaults the install_prefix to "python". This conflicts with the "python" executable that is generated.
|
|
|
|
install_prefix = "py_install",
|
|
|
|
lib_source = ":all_srcs",
|
|
|
|
out_binaries = [
|
2021-12-30 16:37:31 +00:00
|
|
|
"python3.10",
|
2021-06-22 15:51:29 +00:00
|
|
|
],
|
|
|
|
out_data_dirs = ["lib"],
|
|
|
|
deps = [
|
|
|
|
"@openssl",
|
|
|
|
"@zlib",
|
|
|
|
],
|
|
|
|
)
|