mirror of https://github.com/aminya/setup-cpp
feat: support installing system packages using dnf package manager
This commit is contained in:
parent
50a814c62d
commit
e8d2cb09a2
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
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
|
@ -3,6 +3,8 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export function setupCcache(version: string, _setupDir: string, _arch: string) {
|
export function setupCcache(version: string, _setupDir: string, _arch: string) {
|
||||||
|
@ -16,6 +18,8 @@ export function setupCcache(version: string, _setupDir: string, _arch: string) {
|
||||||
case "linux": {
|
case "linux": {
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
return setupPacmanPack("ccache", version)
|
return setupPacmanPack("ccache", version)
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
return setupDnfPack("ccache", version)
|
||||||
}
|
}
|
||||||
return setupAptPack("ccache", version)
|
return setupAptPack("ccache", version)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export async function setupCppcheck(version: string | undefined, _setupDir: string, _arch: string) {
|
export async function setupCppcheck(version: string | undefined, _setupDir: string, _arch: string) {
|
||||||
|
@ -19,6 +21,8 @@ export async function setupCppcheck(version: string | undefined, _setupDir: stri
|
||||||
case "linux": {
|
case "linux": {
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
return setupPacmanPack("cppcheck", version)
|
return setupPacmanPack("cppcheck", version)
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
return setupDnfPack("ccache", version)
|
||||||
}
|
}
|
||||||
return setupAptPack("cppcheck", version)
|
return setupAptPack("cppcheck", version)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@ import { getVersion } from "../default_versions"
|
||||||
import { existsSync } from "fs"
|
import { existsSync } from "fs"
|
||||||
import { join } from "path"
|
import { join } from "path"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
/** Get the platform data for cmake */
|
/** Get the platform data for cmake */
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
@ -61,6 +63,8 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
|
||||||
if (version === "") {
|
if (version === "") {
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
installationInfo = setupPacmanPack("doxygen", undefined)
|
installationInfo = setupPacmanPack("doxygen", undefined)
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
return setupDnfPack("doxygen", version)
|
||||||
} else {
|
} else {
|
||||||
installationInfo = setupAptPack("doxygen", undefined)
|
installationInfo = setupAptPack("doxygen", undefined)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@ import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin
|
||||||
import { extract7Zip } from "../utils/setup/extract"
|
import { extract7Zip } from "../utils/setup/extract"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
import { isUbuntu } from "../utils/env/isUbuntu"
|
import { isUbuntu } from "../utils/env/isUbuntu"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
interface MingwInfo {
|
interface MingwInfo {
|
||||||
releaseName: string
|
releaseName: string
|
||||||
|
@ -84,6 +86,8 @@ export async function setupGcc(version: string, setupDir: string, arch: string)
|
||||||
if (arch === "x64") {
|
if (arch === "x64") {
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
installationInfo = setupPacmanPack("gcc", version)
|
installationInfo = setupPacmanPack("gcc", version)
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
installationInfo = setupDnfPack("gcc", version)
|
||||||
} else {
|
} else {
|
||||||
setupAptPack("gcc", version, ["ppa:ubuntu-toolchain-r/test"])
|
setupAptPack("gcc", version, ["ppa:ubuntu-toolchain-r/test"])
|
||||||
installationInfo = setupAptPack("g++", version, [])
|
installationInfo = setupAptPack("g++", version, [])
|
||||||
|
|
|
@ -5,6 +5,8 @@ import { InstallationInfo } from "../utils/setup/setupBin"
|
||||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export async function setupGraphviz(version: string, _setupDir: string, _arch: string) {
|
export async function setupGraphviz(version: string, _setupDir: string, _arch: string) {
|
||||||
|
@ -19,6 +21,8 @@ export async function setupGraphviz(version: string, _setupDir: string, _arch: s
|
||||||
case "linux": {
|
case "linux": {
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
return setupPacmanPack("graphviz", version)
|
return setupPacmanPack("graphviz", version)
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
return setupDnfPack("graphviz", version)
|
||||||
}
|
}
|
||||||
return setupAptPack("graphviz", version)
|
return setupAptPack("graphviz", version)
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||||
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||||
import { PackageInfo, setupBin } from "../utils/setup/setupBin"
|
import { PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
function getKcovPackageInfo(version: string): PackageInfo {
|
function getKcovPackageInfo(version: string): PackageInfo {
|
||||||
const version_number = parseInt(version.replace(/^v/, ""), 10)
|
const version_number = parseInt(version.replace(/^v/, ""), 10)
|
||||||
|
@ -47,6 +49,9 @@ async function buildKcov(file: string, dest: string) {
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
setupPacmanPack("libdwarf")
|
setupPacmanPack("libdwarf")
|
||||||
setupPacmanPack("libcurl-openssl")
|
setupPacmanPack("libcurl-openssl")
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
setupDnfPack("libdwarf-devel")
|
||||||
|
setupDnfPack("libcurl-devel")
|
||||||
} else {
|
} else {
|
||||||
setupAptPack("libdw-dev")
|
setupAptPack("libdw-dev")
|
||||||
setupAptPack("libcurl4-openssl-dev")
|
setupAptPack("libcurl4-openssl-dev")
|
||||||
|
@ -61,14 +66,14 @@ async function buildKcov(file: string, dest: string) {
|
||||||
export async function setupKcov(version: string, setupDir: string, arch: string) {
|
export async function setupKcov(version: string, setupDir: string, arch: string) {
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case "linux": {
|
case "linux": {
|
||||||
|
const installationInfo = await setupBin("kcov", version, getKcovPackageInfo, setupDir, arch)
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
// TODO install kcov ? setupPacmanPack("kcov")
|
|
||||||
const installationInfo = await setupBin("kcov", version, getKcovPackageInfo, setupDir, arch)
|
|
||||||
setupPacmanPack("binutils")
|
setupPacmanPack("binutils")
|
||||||
return installationInfo
|
} else if (hasDnf()) {
|
||||||
}
|
setupDnfPack("binutils")
|
||||||
const installationInfo = await setupBin("kcov", version, getKcovPackageInfo, setupDir, arch)
|
} else {
|
||||||
setupAptPack("libbinutils")
|
setupAptPack("libbinutils")
|
||||||
|
}
|
||||||
return installationInfo
|
return installationInfo
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|
|
@ -4,6 +4,8 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export async function setupMake(version: string, _setupDir: string, _arch: string) {
|
export async function setupMake(version: string, _setupDir: string, _arch: string) {
|
||||||
|
@ -19,6 +21,8 @@ export async function setupMake(version: string, _setupDir: string, _arch: strin
|
||||||
case "linux": {
|
case "linux": {
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
return setupPacmanPack("make", version)
|
return setupPacmanPack("make", version)
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
return setupDnfPack("make", version)
|
||||||
}
|
}
|
||||||
return setupAptPack("make", version)
|
return setupAptPack("make", version)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ import { isArch } from "../utils/env/isArch"
|
||||||
import which from "which"
|
import which from "which"
|
||||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||||
import { dirname, join } from "path"
|
import { dirname, join } from "path"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
export async function setupPython(version: string, setupDir: string, arch: string) {
|
export async function setupPython(version: string, setupDir: string, arch: string) {
|
||||||
if (!isGitHubCI()) {
|
if (!isGitHubCI()) {
|
||||||
|
@ -52,13 +54,16 @@ export async function setupPythonViaSystem(
|
||||||
return setupBrewPack("python3", version)
|
return setupBrewPack("python3", version)
|
||||||
}
|
}
|
||||||
case "linux": {
|
case "linux": {
|
||||||
|
let installInfo: InstallationInfo
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
const installInfo = setupPacmanPack("python", version)
|
installInfo = setupPacmanPack("python", version)
|
||||||
setupPacmanPack("python-pip")
|
setupPacmanPack("python-pip")
|
||||||
return installInfo
|
} else if (hasDnf()) {
|
||||||
}
|
installInfo = setupDnfPack("python3", version)
|
||||||
const installInfo = setupAptPack("python3", version)
|
} else {
|
||||||
|
installInfo = setupAptPack("python3", version)
|
||||||
setupAptPack("python3-pip")
|
setupAptPack("python3-pip")
|
||||||
|
}
|
||||||
return installInfo
|
return installInfo
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|
|
@ -3,6 +3,8 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export function setupSevenZip(version: string, _setupDir: string, _arch: string) {
|
export function setupSevenZip(version: string, _setupDir: string, _arch: string) {
|
||||||
|
@ -16,6 +18,8 @@ export function setupSevenZip(version: string, _setupDir: string, _arch: string)
|
||||||
case "linux": {
|
case "linux": {
|
||||||
if (isArch()) {
|
if (isArch()) {
|
||||||
return setupPacmanPack("p7zip", version)
|
return setupPacmanPack("p7zip", version)
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
return setupDnfPack("p7zip", version)
|
||||||
}
|
}
|
||||||
return setupAptPack("p7zip-full", version)
|
return setupAptPack("p7zip-full", version)
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||||
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||||
import { isArch } from "../utils/env/isArch"
|
import { isArch } from "../utils/env/isArch"
|
||||||
|
import { hasDnf } from "../utils/env/hasDnf"
|
||||||
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||||
|
|
||||||
let hasVCPKG = false
|
let hasVCPKG = false
|
||||||
|
|
||||||
|
@ -26,6 +28,13 @@ export async function setupVcpkg(_version: string, setupDir: string, _arch: stri
|
||||||
setupPacmanPack("tar")
|
setupPacmanPack("tar")
|
||||||
setupPacmanPack("git")
|
setupPacmanPack("git")
|
||||||
setupPacmanPack("pkg-config")
|
setupPacmanPack("pkg-config")
|
||||||
|
} else if (hasDnf()) {
|
||||||
|
setupDnfPack("curl")
|
||||||
|
setupDnfPack("zip")
|
||||||
|
setupDnfPack("unzip")
|
||||||
|
setupDnfPack("tar")
|
||||||
|
setupDnfPack("git")
|
||||||
|
setupDnfPack("pkg-config")
|
||||||
} else {
|
} else {
|
||||||
setupAptPack("curl")
|
setupAptPack("curl")
|
||||||
setupAptPack("zip")
|
setupAptPack("zip")
|
||||||
|
|
Loading…
Reference in New Issue