sbcl-bootstrap: add darwin binaries (#46617)

Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
This commit is contained in:
Asher Mancinelli 2024-09-27 16:56:01 -07:00 committed by GitHub
parent 5c8d22c597
commit 13a58476ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -36,25 +36,45 @@ class SbclBootstrap(Package):
# By checking objdump -T of the sbcl binary in each prebuilt tarball, I # By checking objdump -T of the sbcl binary in each prebuilt tarball, I
# found the latest reference to glibc for each version. # found the latest reference to glibc for each version.
sbcl_releases = { sbcl_releases = {
"2.3.11": { "2.4.0": {
"x86_64": "98784b04f68882b887984242eef73dbb092ec5c778dd536b2c60846715e03f3c", "darwin": {"arm64": "1d01fac2d9748f769c9246a0a11a2c011d7843337f8f06ca144f5a500e10c117"}
"min_glibc": "2.34",
}, },
"2.3.11": {
"linux": {
"x86_64": "98784b04f68882b887984242eef73dbb092ec5c778dd536b2c60846715e03f3c",
"min_glibc": "2.34",
}
},
# TODO(ashermancinelli): I don't have a machine to test this on, but the binaries are
# available.
# "2.2.9": {
# "darwin": {
# "x86_64": "0000000000000000000000000000000000000000000000000000000000000000"
# }
# },
"2.0.11": { "2.0.11": {
"x86_64": "b7e61bc6b8d238f8878e660bc0635e99c2ea1255bfd6153d702fe9a00f8138fd", "linux": {
"min_glibc": "2.28", "x86_64": "b7e61bc6b8d238f8878e660bc0635e99c2ea1255bfd6153d702fe9a00f8138fd",
"min_glibc": "2.28",
}
}, },
"1.4.16": { "1.4.16": {
"x86_64": "df3d905d37656a7eeeba72d703577afc94a21d756a4dde0949310200f82ce575", "linux": {
"min_glibc": "2.14", "x86_64": "df3d905d37656a7eeeba72d703577afc94a21d756a4dde0949310200f82ce575",
"min_glibc": "2.14",
}
}, },
"1.4.2": { "1.4.2": {
"aarch64": "ddac6499f36c18ecbce9822a53ef3914c0def5276a457446a456c62999b16d36", "linux": {
"min_glibc": "2.17", "aarch64": "ddac6499f36c18ecbce9822a53ef3914c0def5276a457446a456c62999b16d36",
"min_glibc": "2.17",
}
}, },
"1.3.21": { "1.3.21": {
"x86_64": "c1c3e17e1857fb1c22af575941be5cd1d5444b462397b1b3c9f3877aee2e814b", "linux": {
"min_glibc": "2.3", "x86_64": "c1c3e17e1857fb1c22af575941be5cd1d5444b462397b1b3c9f3877aee2e814b",
"min_glibc": "2.3",
}
}, },
} }
@ -62,26 +82,29 @@ class SbclBootstrap(Package):
target = platform.machine().lower() target = platform.machine().lower()
for ver in sbcl_releases: for ver in sbcl_releases:
if target in sbcl_releases[ver]: if os in sbcl_releases[ver]:
version(ver, sha256=sbcl_releases[ver][target]) if target in sbcl_releases[ver][os]:
if "min_glibc" in sbcl_releases[ver]: version(ver, sha256=sbcl_releases[ver][os][target])
conflicts( if "min_glibc" in sbcl_releases[ver][os]:
"glibc@:{0}".format(sbcl_releases[ver]["min_glibc"]), when="@{0}".format(ver) conflicts(
) "glibc@:{0}".format(sbcl_releases[ver][os]["min_glibc"]),
when="@{0}".format(ver),
)
supported_sysinfo_msg = "linux x86_64 is the only supported platform" supported_sysinfo_msg = (
for sysinfo in ["platform=darwin", "platform=windows", "target=ppc64le"]: "Not a supported platform. See https://www.sbcl.org/platform-table.html"
)
for sysinfo in ["platform=windows", "target=ppc64le"]:
conflicts(sysinfo, msg=supported_sysinfo_msg) conflicts(sysinfo, msg=supported_sysinfo_msg)
def url_for_version(self, version): def url_for_version(self, version):
if self.os != "linux":
return None
target = platform.machine().lower() target = platform.machine().lower()
sbcl_targets = {"aarch64": "arm64", "x86_64": "x86-64"} os = platform.system().lower()
sbcl_targets = {"arm64": "arm64", "aarch64": "arm64", "x86_64": "x86-64"}
if target not in sbcl_targets: if target not in sbcl_targets:
return None return None
sbcl_url = "https://sourceforge.net/projects/sbcl/files/sbcl/{version}/sbcl-{version}-{target}-linux-binary.tar.bz2" sbcl_url = "https://sourceforge.net/projects/sbcl/files/sbcl/{version}/sbcl-{version}-{target}-{os}-binary.tar.bz2"
return sbcl_url.format(version=version, target=sbcl_targets[target]) return sbcl_url.format(version=version, target=sbcl_targets[target], os=os)
def install(self, spec, prefix): def install(self, spec, prefix):
sh = which("sh") sh = which("sh")