mirror of https://github.com/aminya/setup-cpp
fix: add dk.archive.ubuntu.com/ubuntu/ xenia ppas for gcc
This commit is contained in:
parent
6b9b57b9a8
commit
dd4a80b89b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -34,18 +34,34 @@ export async function setupGcc(version: string, _setupDir: string, arch: string)
|
|||
}
|
||||
case "linux": {
|
||||
if (arch === "x64") {
|
||||
binDir = (await setupAptPack("g++", version, "ppa:ubuntu-toolchain-r/test")).binDir
|
||||
binDir = (
|
||||
await setupAptPack("g++", version, [
|
||||
"ppa:ubuntu-toolchain-r/test",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
|
||||
])
|
||||
).binDir
|
||||
} else {
|
||||
info(`Install g++-multilib because gcc for ${arch} was requested`)
|
||||
binDir = (await setupAptPack("g++-multilib", version, "ppa:ubuntu-toolchain-r/test")).binDir
|
||||
binDir = (
|
||||
await setupAptPack("g++-multilib", version, [
|
||||
"ppa:ubuntu-toolchain-r/test",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
|
||||
])
|
||||
).binDir
|
||||
}
|
||||
break
|
||||
}
|
||||
// TODO support bare-metal
|
||||
// TODO support bare-metal (need to support passing it as the input)
|
||||
// TODO support abi
|
||||
// case "none": {
|
||||
// if (arch === "arm" || arch === "arm64") {
|
||||
// return setupAptPack("gcc-arm-none-eabi", version, "ppa:ubuntu-toolchain-r/test")
|
||||
// return setupAptPack("gcc-arm-none-eabi", version, [
|
||||
// "ppa:ubuntu-toolchain-r/test",
|
||||
// "deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
|
||||
// "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
|
||||
// ])
|
||||
// } else {
|
||||
// throw new Error(`Unsupported platform for ${arch}`)
|
||||
// }
|
||||
|
|
|
@ -8,15 +8,18 @@ let didUpdate: boolean = false
|
|||
export async function setupAptPack(
|
||||
name: string,
|
||||
version?: string,
|
||||
repository: boolean | string = true
|
||||
repositories: boolean | string[] = true
|
||||
): Promise<InstallationInfo> {
|
||||
const apt = "apt-get"
|
||||
|
||||
if (typeof repository === "string") {
|
||||
await execaSudo("add-apt-repository", ["--update", "-y", repository])
|
||||
if (Array.isArray(repositories)) {
|
||||
for (const repo of repositories) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await execaSudo("add-apt-repository", ["--update", "-y", repo])
|
||||
}
|
||||
}
|
||||
|
||||
if (!didUpdate || repository === true) {
|
||||
if (!didUpdate || repositories === true) {
|
||||
await execaSudo(apt, ["update", "-y"])
|
||||
didUpdate = true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue