boost: Refactor header-only install and add missing compiled libraries (#46281)
This commit is contained in:
parent
975f4fbf84
commit
78117877e0
@ -116,7 +116,9 @@ class Boost(Package):
|
|||||||
# support. The header-only library is installed when no variant is given.
|
# support. The header-only library is installed when no variant is given.
|
||||||
all_libs = [
|
all_libs = [
|
||||||
"atomic",
|
"atomic",
|
||||||
|
"charconv",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
"cobalt",
|
||||||
"container",
|
"container",
|
||||||
"context",
|
"context",
|
||||||
"contract",
|
"contract",
|
||||||
@ -146,6 +148,7 @@ class Boost(Package):
|
|||||||
"thread",
|
"thread",
|
||||||
"timer",
|
"timer",
|
||||||
"type_erasure",
|
"type_erasure",
|
||||||
|
"url",
|
||||||
"wave",
|
"wave",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -497,7 +500,7 @@ def bjam_python_line(self, spec):
|
|||||||
spec["python"].libs[0],
|
spec["python"].libs[0],
|
||||||
)
|
)
|
||||||
|
|
||||||
def determine_bootstrap_options(self, spec, with_libs, without_libs, options):
|
def determine_bootstrap_options(self, spec, with_libs, options):
|
||||||
boost_toolset_id = self.determine_toolset(spec)
|
boost_toolset_id = self.determine_toolset(spec)
|
||||||
|
|
||||||
# Arm compiler bootstraps with 'gcc' (but builds as 'clang')
|
# Arm compiler bootstraps with 'gcc' (but builds as 'clang')
|
||||||
@ -506,9 +509,9 @@ def determine_bootstrap_options(self, spec, with_libs, without_libs, options):
|
|||||||
else:
|
else:
|
||||||
options.append("--with-toolset=%s" % boost_toolset_id)
|
options.append("--with-toolset=%s" % boost_toolset_id)
|
||||||
if with_libs:
|
if with_libs:
|
||||||
options.append("--with-libraries=%s" % ",".join(with_libs))
|
options.append("--with-libraries=%s" % ",".join(sorted(with_libs)))
|
||||||
else:
|
else:
|
||||||
options.append("--without-libraries=%s" % ",".join(without_libs))
|
options.append("--with-libraries=headers")
|
||||||
|
|
||||||
if spec.satisfies("+python"):
|
if spec.satisfies("+python"):
|
||||||
options.append("--with-python=%s" % spec["python"].command.path)
|
options.append("--with-python=%s" % spec["python"].command.path)
|
||||||
@ -679,50 +682,39 @@ def install(self, spec, prefix):
|
|||||||
force_symlink("/usr/bin/libtool", join_path(newdir, "libtool"))
|
force_symlink("/usr/bin/libtool", join_path(newdir, "libtool"))
|
||||||
env["PATH"] = newdir + ":" + env["PATH"]
|
env["PATH"] = newdir + ":" + env["PATH"]
|
||||||
|
|
||||||
with_libs = list()
|
with_libs = {f"{lib}" for lib in Boost.all_libs if f"+{lib}" in spec}
|
||||||
without_libs = list()
|
|
||||||
for lib in Boost.all_libs:
|
|
||||||
if "+{0}".format(lib) in spec:
|
|
||||||
with_libs.append(lib)
|
|
||||||
else:
|
|
||||||
without_libs.append(lib)
|
|
||||||
|
|
||||||
remove_if_in_list = lambda lib, libs: libs.remove(lib) if lib in libs else None
|
|
||||||
|
|
||||||
# Remove libraries that the release version does not support
|
# Remove libraries that the release version does not support
|
||||||
|
if not spec.satisfies("@1.85.0:"):
|
||||||
|
with_libs.discard("charconv")
|
||||||
|
if not spec.satisfies("@1.84.0:"):
|
||||||
|
with_libs.discard("cobalt")
|
||||||
|
if not spec.satisfies("@1.81.0:"):
|
||||||
|
with_libs.discard("url")
|
||||||
if not spec.satisfies("@1.75.0:"):
|
if not spec.satisfies("@1.75.0:"):
|
||||||
remove_if_in_list("json", with_libs)
|
with_libs.discard("json")
|
||||||
remove_if_in_list("json", without_libs)
|
|
||||||
if spec.satisfies("@1.69.0:"):
|
if spec.satisfies("@1.69.0:"):
|
||||||
remove_if_in_list("signals", with_libs)
|
with_libs.discard("signals")
|
||||||
remove_if_in_list("signals", without_libs)
|
|
||||||
if not spec.satisfies("@1.54.0:"):
|
if not spec.satisfies("@1.54.0:"):
|
||||||
remove_if_in_list("log", with_libs)
|
with_libs.discard("log")
|
||||||
remove_if_in_list("log", without_libs)
|
|
||||||
if not spec.satisfies("@1.53.0:"):
|
if not spec.satisfies("@1.53.0:"):
|
||||||
remove_if_in_list("atomic", with_libs)
|
with_libs.discard("atomic")
|
||||||
remove_if_in_list("atomic", without_libs)
|
|
||||||
if not spec.satisfies("@1.48.0:"):
|
if not spec.satisfies("@1.48.0:"):
|
||||||
remove_if_in_list("locale", with_libs)
|
with_libs.discard("locale")
|
||||||
remove_if_in_list("locale", without_libs)
|
|
||||||
if not spec.satisfies("@1.47.0:"):
|
if not spec.satisfies("@1.47.0:"):
|
||||||
remove_if_in_list("chrono", with_libs)
|
with_libs.discard("chrono")
|
||||||
remove_if_in_list("chrono", without_libs)
|
|
||||||
if not spec.satisfies("@1.43.0:"):
|
if not spec.satisfies("@1.43.0:"):
|
||||||
remove_if_in_list("random", with_libs)
|
with_libs.discard("random")
|
||||||
remove_if_in_list("random", without_libs)
|
|
||||||
if not spec.satisfies("@1.39.0:"):
|
if not spec.satisfies("@1.39.0:"):
|
||||||
remove_if_in_list("exception", with_libs)
|
with_libs.discard("exception")
|
||||||
remove_if_in_list("exception", without_libs)
|
|
||||||
if spec.satisfies("+graph") and spec.satisfies("+mpi"):
|
if spec.satisfies("+graph") and spec.satisfies("+mpi"):
|
||||||
with_libs.append("graph_parallel")
|
with_libs.add("graph_parallel")
|
||||||
remove_if_in_list("graph_parallel", without_libs)
|
|
||||||
|
|
||||||
# to make Boost find the user-config.jam
|
# to make Boost find the user-config.jam
|
||||||
env["BOOST_BUILD_PATH"] = self.stage.source_path
|
env["BOOST_BUILD_PATH"] = self.stage.source_path
|
||||||
|
|
||||||
bootstrap_options = ["--prefix=%s" % prefix]
|
bootstrap_options = ["--prefix=%s" % prefix]
|
||||||
self.determine_bootstrap_options(spec, with_libs, without_libs, bootstrap_options)
|
self.determine_bootstrap_options(spec, with_libs, bootstrap_options)
|
||||||
|
|
||||||
if self.spec.satisfies("platform=windows"):
|
if self.spec.satisfies("platform=windows"):
|
||||||
bootstrap = Executable("cmd.exe")
|
bootstrap = Executable("cmd.exe")
|
||||||
|
Loading…
Reference in New Issue
Block a user