Merge pull request #150 from aminya/libtinfo [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-11-21 00:00:51 -08:00 committed by GitHub
commit e41547fef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -28,7 +28,7 @@ async function setupLLVMWithoutActivation(version: string, setupDir: string, arc
let depsPromise: Promise<void> let depsPromise: Promise<void>
if (!installedDeps) { if (!installedDeps) {
depsPromise = setupLLVMDeps(arch) depsPromise = setupLLVMDeps(arch, version)
// eslint-disable-next-line require-atomic-updates // eslint-disable-next-line require-atomic-updates
installedDeps = true installedDeps = true
} else { } else {
@ -42,14 +42,19 @@ async function setupLLVMWithoutActivation(version: string, setupDir: string, arc
return installationInfo return installationInfo
} }
async function setupLLVMDeps(arch: string) { async function setupLLVMDeps(arch: string, version: string) {
if (process.platform === "linux") { if (process.platform === "linux") {
// install llvm build dependencies // install llvm build dependencies
const osVersion = await ubuntuVersion() const osVersion = await ubuntuVersion()
await setupGcc(getVersion("gcc", undefined, osVersion), "", arch) // using llvm requires ld, an up to date libstdc++, etc. So, install gcc first await setupGcc(getVersion("gcc", undefined, osVersion), "", arch) // using llvm requires ld, an up to date libstdc++, etc. So, install gcc first
if (isUbuntu()) { if (isUbuntu()) {
await setupAptPack("libtinfo-dev") const majorVersion = parseInt(version.split(".")[0], 10)
if (majorVersion <= 10) {
await setupAptPack("libtinfo5")
} else {
await setupAptPack("libtinfo-dev")
}
} }
// TODO: install libtinfo on other distros // TODO: install libtinfo on other distros
// setupPacmanPack("ncurses") // setupPacmanPack("ncurses")