fix: fix python, pip, and doxygen on fedora

This commit is contained in:
Amin Yahyaabadi 2022-07-10 17:53:17 -07:00
parent 1103890904
commit 4a49195853
7 changed files with 25 additions and 20 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/setup_cpp.mjs vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -14,6 +14,7 @@ import { join } from "path"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack" import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
/** 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
@ -60,18 +61,17 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
} }
case "linux": { case "linux": {
let installationInfo: InstallationInfo let installationInfo: InstallationInfo
if (version === "") { if (version === "" || isArch() || hasDnf()) {
if (isArch()) {
installationInfo = setupPacmanPack("doxygen", undefined)
} else if (hasDnf()) {
return setupDnfPack("doxygen", version)
} else {
installationInfo = setupAptPack("doxygen", undefined)
}
} else {
if (isArch()) { if (isArch()) {
installationInfo = setupPacmanPack("doxygen", version) installationInfo = setupPacmanPack("doxygen", version)
} else if (hasDnf()) {
return setupDnfPack("doxygen", version)
} else if (isUbuntu()) {
installationInfo = setupAptPack("doxygen", version)
} else { } else {
throw new Error(`Unsupported linux distributions`)
}
} else if (isUbuntu()) {
try { try {
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself // doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch) installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
@ -80,7 +80,8 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`) notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
installationInfo = setupAptPack("doxygen", undefined) installationInfo = setupAptPack("doxygen", undefined)
} }
} } else {
throw new Error(`Unsupported linux distributions`)
} }
await setupGraphviz(getVersion("graphviz", undefined), "", arch) await setupGraphviz(getVersion("graphviz", undefined), "", arch)
return installationInfo return installationInfo

View File

@ -11,6 +11,7 @@ import { InstallationInfo } from "../utils/setup/setupBin"
import { dirname, join } from "path" import { dirname, join } from "path"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack" import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
export async function setupPython(version: string, setupDir: string, arch: string) { export async function setupPython(version: string, setupDir: string, arch: string) {
if (!isGitHubCI()) { if (!isGitHubCI()) {
@ -60,9 +61,11 @@ export async function setupPythonViaSystem(
setupPacmanPack("python-pip") setupPacmanPack("python-pip")
} else if (hasDnf()) { } else if (hasDnf()) {
installInfo = setupDnfPack("python3", version) installInfo = setupDnfPack("python3", version)
} else { } else if (isUbuntu()) {
installInfo = setupAptPack("python3", version) installInfo = setupAptPack("python3", version)
setupAptPack("python3-pip") setupAptPack("python3-pip")
} else {
throw new Error(`Unsupported linux distributions`)
} }
return installInfo return installInfo
} }

View File

@ -12,6 +12,7 @@ import { InstallationInfo } from "./setupBin"
import { setupAptPack } from "./setupAptPack" import { setupAptPack } from "./setupAptPack"
import { setupPacmanPack } from "./setupPacmanPack" import { setupPacmanPack } from "./setupPacmanPack"
import { isArch } from "../env/isArch" import { isArch } from "../env/isArch"
import { isUbuntu } from "../env/isUbuntu"
let python: string | undefined let python: string | undefined
let binDir: string | undefined let binDir: string | undefined
@ -46,7 +47,7 @@ export async function setupPipPack(name: string, version?: string): Promise<Inst
// ensure that pip is installed on Linux (happens when python is found but pip not installed) // ensure that pip is installed on Linux (happens when python is found but pip not installed)
if (isArch()) { if (isArch()) {
setupPacmanPack("python-pip") setupPacmanPack("python-pip")
} else { } else if (isUbuntu()) {
setupAptPack("python3-pip") setupAptPack("python3-pip")
} }
} }