mirror of https://github.com/aminya/setup-cpp
feat: install doxygen via official Dmg files
This commit is contained in:
parent
f9b35199a3
commit
f2828c7aeb
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
|
@ -76,6 +76,7 @@
|
|||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@babel/cli": "^7.23.4",
|
||||
"@shockpkg/hdi-mac": "^3.1.1",
|
||||
"@swc/jest": "^0.2.31",
|
||||
"@types/cross-spawn": "^6.0.6",
|
||||
"@types/eslint": "^8.56.2",
|
||||
|
|
|
@ -26,6 +26,9 @@ importers:
|
|||
'@babel/cli':
|
||||
specifier: ^7.23.4
|
||||
version: 7.23.4(@babel/core@7.23.7)
|
||||
'@shockpkg/hdi-mac':
|
||||
specifier: ^3.1.1
|
||||
version: 3.1.1
|
||||
'@swc/jest':
|
||||
specifier: ^0.2.31
|
||||
version: 0.2.31(@swc/core@1.3.105)
|
||||
|
@ -2537,6 +2540,20 @@ packages:
|
|||
config-chain: 1.1.13
|
||||
dev: true
|
||||
|
||||
/@shockpkg/hdi-mac@3.1.1:
|
||||
resolution: {integrity: sha512-YqQjt7JCmHO7Ehza0xTcKOaW7EtbPEVNMvaK8XOC/BiORI/zfdUaq8VZ9BTicdCi+TszqPWCSSYI7MoG85DlxA==}
|
||||
engines: {node: '>=18.12.0'}
|
||||
dependencies:
|
||||
'@shockpkg/plist-dom': 4.0.4
|
||||
dev: true
|
||||
|
||||
/@shockpkg/plist-dom@4.0.4:
|
||||
resolution: {integrity: sha512-g13s4uJkBycBELk2tIFdOC6l4t70pldwVpBj53KtW5zEGXeLdj0BcjgWZulR+1Q4ImfZ28qenH4QeRBcVHeTHA==}
|
||||
engines: {node: '>=18.12.0'}
|
||||
dependencies:
|
||||
'@xmldom/xmldom': 0.8.10
|
||||
dev: true
|
||||
|
||||
/@sigstore/bundle@1.1.0:
|
||||
resolution: {integrity: sha512-PFutXEy0SmQxYI4texPw3dd2KewuNqv7OuK1ZFtY2fM754yhvG2KdgwIhRnoEE2uHdtdGNQ8s0lb94dW9sELog==}
|
||||
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
|
||||
|
@ -3106,6 +3123,11 @@ packages:
|
|||
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
|
||||
dev: true
|
||||
|
||||
/@xmldom/xmldom@0.8.10:
|
||||
resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
dev: true
|
||||
|
||||
/abbrev@1.1.1:
|
||||
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
|
||||
dev: true
|
||||
|
|
|
@ -18,6 +18,7 @@ import { pathExists } from "path-exists"
|
|||
import retry from "retry-as-promised"
|
||||
import { ubuntuVersion } from "../utils/env/ubuntu_version"
|
||||
import { macosVersion } from "../utils/env/macos_version"
|
||||
import { setupDmg } from "../utils/setup/setupDmg"
|
||||
|
||||
/** Get the platform data for cmake */
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
@ -43,6 +44,16 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch
|
|||
url: `https://www.doxygen.nl/files/${folderName}.windows.x64.bin.zip`,
|
||||
}
|
||||
}
|
||||
case "darwin": {
|
||||
const folderName = `Doxygen-${version}`
|
||||
return {
|
||||
binRelativeDir: "bin/",
|
||||
binFileName: addExeExt("doxygen"),
|
||||
extractedFolderName: folderName,
|
||||
extractFunction: setupDmg,
|
||||
url: `https://doxygen.nl/files/${folderName}.dmg`,
|
||||
}
|
||||
}
|
||||
default:
|
||||
throw new Error(`Unsupported platform '${platform}'`)
|
||||
}
|
||||
|
@ -64,7 +75,12 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
|
|||
return installationInfo
|
||||
}
|
||||
case "darwin": {
|
||||
const installationInfo = await setupBrewPack("doxygen", undefined)
|
||||
let installationInfo: InstallationInfo
|
||||
try {
|
||||
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
|
||||
} catch {
|
||||
installationInfo = await setupBrewPack("doxygen", undefined)
|
||||
}
|
||||
// only install graphviz if the macOS version is greater than 11
|
||||
if (macosVersion()[0] > 11) {
|
||||
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
|
||||
|
@ -87,7 +103,11 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
|
|||
try {
|
||||
// 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)
|
||||
await setupAptPack([{ name: "libclang-cpp9" }])
|
||||
try {
|
||||
await setupAptPack([{ name: "libclang-cpp9" }])
|
||||
} catch (err) {
|
||||
info(`Failed to download libclang-cpp9 that might be needed for running doxygen. ${err}`)
|
||||
}
|
||||
} catch (err) {
|
||||
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
|
||||
installationInfo = await setupAptPack([{ name: "doxygen" }])
|
||||
|
|
|
@ -26,7 +26,7 @@ export type PackageInfo = {
|
|||
binFileName: string
|
||||
/** The function to extract the downloaded archive. It can be `undefined`, if the binary itself is downloaded directly. */
|
||||
extractFunction?: {
|
||||
(file: string, dest: string): Promise<string> | Promise<void>
|
||||
(file: string, dest: string): Promise<unknown>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import { Mounter } from "@shockpkg/hdi-mac"
|
||||
import { execRoot } from "admina"
|
||||
|
||||
export async function setupDmg(path: string, destDir: string) {
|
||||
// mount the dmg
|
||||
const mounter = new Mounter()
|
||||
const { devices, eject } = await mounter.attach(path)
|
||||
|
||||
const device = devices[0]
|
||||
|
||||
// copy the dmg contents to the setup directory
|
||||
await execRoot("cp", ["-R", `${device.mountPoint}/`, destDir])
|
||||
|
||||
// eject the disk
|
||||
await eject()
|
||||
}
|
Loading…
Reference in New Issue