mirror of https://github.com/aminya/setup-cpp
Merge pull request #16 from aminya/linux-deps [skip ci]
This commit is contained in:
commit
92d98f746a
|
@ -172,8 +172,7 @@ FROM debian:bullseye
|
|||
# add setup_cpp
|
||||
WORKDIR "/"
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -y --no-install-recommends apt-utils
|
||||
RUN apt-get install -y --no-install-recommends ca-certificates wget unzip
|
||||
RUN apt-get install -y --no-install-recommends wget
|
||||
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.5.5/setup_cpp_linux"
|
||||
RUN chmod +x ./setup_cpp_linux
|
||||
|
||||
|
|
|
@ -4,8 +4,7 @@ FROM debian:bullseye
|
|||
# add setup_cpp
|
||||
WORKDIR "/"
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -y --no-install-recommends apt-utils
|
||||
RUN apt-get install -y --no-install-recommends ca-certificates wget unzip
|
||||
RUN apt-get install -y --no-install-recommends wget
|
||||
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.5.5/setup_cpp_linux"
|
||||
RUN chmod +x ./setup_cpp_linux
|
||||
|
||||
|
|
|
@ -5,10 +5,6 @@ FROM node:16-slim
|
|||
ADD "./dist/" "/"
|
||||
WORKDIR "/"
|
||||
|
||||
# install unzip for the slim image (a standard debian already has it)
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -y --no-install-recommends unzip
|
||||
|
||||
# run installation
|
||||
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true --vcpkg true
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -9,6 +9,7 @@ import { setupMacOSSDK } from "../macos-sdk/macos-sdk"
|
|||
import { addBinExtension } from "../utils/extension/extension"
|
||||
import { addEnv } from "../utils/env/addEnv"
|
||||
import { setOutput } from "@actions/core"
|
||||
import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||
|
||||
//================================================
|
||||
// Version
|
||||
|
@ -246,6 +247,11 @@ export async function setupLLVM(
|
|||
}
|
||||
|
||||
export async function activateLLVM(directory: string, versionGiven: string) {
|
||||
if (process.platform === "linux") {
|
||||
// install llvm build dependencies
|
||||
await setupAptPack("build-essential") // TODO(question) llvm needs ld. But does it need all the build-essential?
|
||||
}
|
||||
|
||||
const version = semverCoerceIfInvalid(versionGiven)
|
||||
|
||||
const lib = path.join(directory, "lib")
|
||||
|
|
|
@ -3,6 +3,7 @@ import { InstallationInfo } from "./setupBin"
|
|||
import { execaSudo } from "../env/sudo"
|
||||
|
||||
let didUpdate: boolean = false
|
||||
let didInit: boolean = false
|
||||
|
||||
/** A function that installs a package using apt */
|
||||
export async function setupAptPack(
|
||||
|
@ -12,16 +13,36 @@ export async function setupAptPack(
|
|||
): Promise<InstallationInfo> {
|
||||
const apt = "apt-get"
|
||||
|
||||
process.env.DEBIAN_FRONTEND = "noninteractive"
|
||||
|
||||
if (!didUpdate) {
|
||||
await execaSudo(apt, ["update", "-y"])
|
||||
didUpdate = true
|
||||
}
|
||||
|
||||
if (!didInit) {
|
||||
// install apt utils and certificates (usually missing from docker containers)
|
||||
// set time - zone
|
||||
// TZ = Canada / Pacific
|
||||
// ln - snf / usr / share / zoneinfo / $TZ / etc / localtime && echo $TZ > /etc/timezone
|
||||
await execaSudo(apt, [
|
||||
"install",
|
||||
"--fix-broken",
|
||||
"-y",
|
||||
"software-properties-common",
|
||||
"apt-utils",
|
||||
"ca-certificates",
|
||||
"gnupg",
|
||||
])
|
||||
didInit = true
|
||||
}
|
||||
|
||||
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 || repositories === true) {
|
||||
await execaSudo(apt, ["update", "-y"])
|
||||
didUpdate = true
|
||||
}
|
||||
|
||||
if (version !== undefined && version !== "") {
|
||||
|
|
|
@ -12,18 +12,20 @@ let hasVCPKG = false
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export async function setupVcpkg(_version: string, setupDir: string, _arch: string): Promise<InstallationInfo> {
|
||||
if (!hasVCPKG || which.sync("vcpkg", { nothrow: true }) === null) {
|
||||
if (!existsSync(join(setupDir, addShellExtension("bootstrap-vcpkg")))) {
|
||||
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: dirname(setupDir) })
|
||||
} else {
|
||||
warning(`Vcpkg folder already exists at ${setupDir}`)
|
||||
}
|
||||
|
||||
if (process.platform === "linux") {
|
||||
// vcpkg download and extraction dependencies
|
||||
await setupAptPack("curl")
|
||||
await setupAptPack("zip")
|
||||
await setupAptPack("unzip")
|
||||
await setupAptPack("tar")
|
||||
await setupAptPack("git")
|
||||
await setupAptPack("pkg-config")
|
||||
}
|
||||
|
||||
if (!existsSync(join(setupDir, addShellExtension("bootstrap-vcpkg")))) {
|
||||
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: dirname(setupDir) })
|
||||
} else {
|
||||
warning(`Vcpkg folder already exists at ${setupDir}`)
|
||||
}
|
||||
|
||||
execa.sync(addShellExtension(addShellHere("bootstrap-vcpkg")), { cwd: setupDir, shell: true })
|
||||
|
|
Loading…
Reference in New Issue