-
Notifications
You must be signed in to change notification settings - Fork 3
/
compile-fdkaac.mjs
48 lines (43 loc) · 1.12 KB
/
compile-fdkaac.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import fs from "fs";
import { execSync } from "child_process";
import { PREFIX } from "./const.mjs";
import path from "path";
export const enableFdkAac = async (isWindows) => {
if (!fs.existsSync("fdkaac")) {
const response = execSync(
"curl -L https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.2.tar.gz/download?use_mirror=gigenet > fdkaac.tar.gz"
);
execSync("tar -xzf fdkaac.tar.gz", {
stdio: "inherit",
});
}
execSync(
[
path.posix.join(
process.cwd().replace(/\\/g, "/"),
"fdk-aac-2.0.2",
"configure"
),
`--prefix=${path.resolve("fdk-aac-2.0.2", PREFIX)}`,
"--enable-static",
"--disable-shared",
"--with-pic",
isWindows ? "--host=x86_64-w64-mingw32" : null,
]
.filter(Boolean)
.join(" "),
{
cwd: "fdk-aac-2.0.2",
stdio: "inherit",
}
);
execSync("make", {
cwd: "fdk-aac-2.0.2",
stdio: "inherit",
});
execSync("make install", {
cwd: "fdk-aac-2.0.2",
stdio: "inherit",
});
execSync(`cp -r ${PREFIX} ../`, { cwd: "fdk-aac-2.0.2", stdio: "inherit" });
};