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": {
|
case "linux": {
|
||||||
if (arch === "x64") {
|
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 {
|
} else {
|
||||||
info(`Install g++-multilib because gcc for ${arch} was requested`)
|
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
|
break
|
||||||
}
|
}
|
||||||
// TODO support bare-metal
|
// TODO support bare-metal (need to support passing it as the input)
|
||||||
// TODO support abi
|
// TODO support abi
|
||||||
// case "none": {
|
// case "none": {
|
||||||
// if (arch === "arm" || arch === "arm64") {
|
// 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 {
|
// } else {
|
||||||
// throw new Error(`Unsupported platform for ${arch}`)
|
// throw new Error(`Unsupported platform for ${arch}`)
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -8,15 +8,18 @@ let didUpdate: boolean = false
|
||||||
export async function setupAptPack(
|
export async function setupAptPack(
|
||||||
name: string,
|
name: string,
|
||||||
version?: string,
|
version?: string,
|
||||||
repository: boolean | string = true
|
repositories: boolean | string[] = true
|
||||||
): Promise<InstallationInfo> {
|
): Promise<InstallationInfo> {
|
||||||
const apt = "apt-get"
|
const apt = "apt-get"
|
||||||
|
|
||||||
if (typeof repository === "string") {
|
if (Array.isArray(repositories)) {
|
||||||
await execaSudo("add-apt-repository", ["--update", "-y", repository])
|
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"])
|
await execaSudo(apt, ["update", "-y"])
|
||||||
didUpdate = true
|
didUpdate = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue