Skip to content

Commit 4a49195

Browse files
committed
fix: fix python, pip, and doxygen on fedora
1 parent 1103890 commit 4a49195

File tree

7 files changed

+25
-20
lines changed

7 files changed

+25
-20
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/setup_cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/doxygen/doxygen.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { join } from "path"
1414
import { isArch } from "../utils/env/isArch"
1515
import { hasDnf } from "../utils/env/hasDnf"
1616
import { setupDnfPack } from "../utils/setup/setupDnfPack"
17+
import { isUbuntu } from "../utils/env/isUbuntu"
1718

1819
/** Get the platform data for cmake */
1920
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -60,27 +61,27 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
6061
}
6162
case "linux": {
6263
let installationInfo: InstallationInfo
63-
if (version === "") {
64+
if (version === "" || isArch() || hasDnf()) {
6465
if (isArch()) {
65-
installationInfo = setupPacmanPack("doxygen", undefined)
66+
installationInfo = setupPacmanPack("doxygen", version)
6667
} else if (hasDnf()) {
6768
return setupDnfPack("doxygen", version)
69+
} else if (isUbuntu()) {
70+
installationInfo = setupAptPack("doxygen", version)
6871
} else {
72+
throw new Error(`Unsupported linux distributions`)
73+
}
74+
} else if (isUbuntu()) {
75+
try {
76+
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
77+
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
78+
setupAptPack("libclang-cpp9")
79+
} catch (err) {
80+
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
6981
installationInfo = setupAptPack("doxygen", undefined)
7082
}
7183
} else {
72-
if (isArch()) {
73-
installationInfo = setupPacmanPack("doxygen", version)
74-
} else {
75-
try {
76-
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
77-
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
78-
setupAptPack("libclang-cpp9")
79-
} catch (err) {
80-
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
81-
installationInfo = setupAptPack("doxygen", undefined)
82-
}
83-
}
84+
throw new Error(`Unsupported linux distributions`)
8485
}
8586
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
8687
return installationInfo

src/python/python.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { InstallationInfo } from "../utils/setup/setupBin"
1111
import { dirname, join } from "path"
1212
import { hasDnf } from "../utils/env/hasDnf"
1313
import { setupDnfPack } from "../utils/setup/setupDnfPack"
14+
import { isUbuntu } from "../utils/env/isUbuntu"
1415

1516
export async function setupPython(version: string, setupDir: string, arch: string) {
1617
if (!isGitHubCI()) {
@@ -60,9 +61,11 @@ export async function setupPythonViaSystem(
6061
setupPacmanPack("python-pip")
6162
} else if (hasDnf()) {
6263
installInfo = setupDnfPack("python3", version)
63-
} else {
64+
} else if (isUbuntu()) {
6465
installInfo = setupAptPack("python3", version)
6566
setupAptPack("python3-pip")
67+
} else {
68+
throw new Error(`Unsupported linux distributions`)
6669
}
6770
return installInfo
6871
}

src/utils/setup/setupPipPack.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { InstallationInfo } from "./setupBin"
1212
import { setupAptPack } from "./setupAptPack"
1313
import { setupPacmanPack } from "./setupPacmanPack"
1414
import { isArch } from "../env/isArch"
15+
import { isUbuntu } from "../env/isUbuntu"
1516

1617
let python: string | undefined
1718
let binDir: string | undefined
@@ -46,7 +47,7 @@ export async function setupPipPack(name: string, version?: string): Promise<Inst
4647
// ensure that pip is installed on Linux (happens when python is found but pip not installed)
4748
if (isArch()) {
4849
setupPacmanPack("python-pip")
49-
} else {
50+
} else if (isUbuntu()) {
5051
setupAptPack("python3-pip")
5152
}
5253
}

0 commit comments

Comments
 (0)