Skip to content

Commit f46510b

Browse files
committed
should compile
1 parent 656f373 commit f46510b

File tree

5 files changed

+31
-17
lines changed

5 files changed

+31
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y
2222
- run: rm /opt/homebrew/opt/libx11/lib/libX11.6.dylib
2323
- run: node clean.mjs
24-
- run: node compile-ffmpeg.mjs
24+
- run: node compile-ffmpeg.mjs arm
2525
- run: node generate-bindings.mjs
2626
- run: node zip.mjs
2727
- run: node test-ffmpeg.mjs

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN apk add curl
1818
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
1919
RUN source "$HOME/.cargo/env"
2020
RUN apk add yasm nasm curl git make ca-certificates pkgconfig bash cmake make cmake build-base llvm-static llvm-dev clang-static clang-dev perl zlib zlib-dev meson ninja autoconf automake libtool patchelf
21-
RUN cd app && CFLAGS="$CFLAGS -static-libgcc" CXXFLAGS="$CXXFLAGS -static-libgcc -static-libstdc++" LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++" node compile-ffmpeg.mjs musl
21+
RUN cd app && CFLAGS="$CFLAGS -static-libgcc" CXXFLAGS="$CXXFLAGS -static-libgcc -static-libstdc++" LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++" node compile-ffmpeg.mjs musl arm
2222
RUN source "$HOME/.cargo/env" && cd app && node generate-bindings.mjs musl
2323
RUN source "$HOME/.cargo/env" && cd app && node zip.mjs
2424
RUN source "$HOME/.cargo/env" && cd app && node test-ffmpeg.mjs

Dockerfile-aws

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ RUN amazon-linux-extras list
2121
RUN amazon-linux-extras install epel python3.8 -y
2222
RUN python3.8 -m pip install meson
2323
RUN python3.8 -m pip install ninja
24-
RUN yum install yasm nasm unzip curl gcc gcc-c++ tar git make ca-certificates pkgconfig bash cmake make cmake build-base llvm-static llvm-dev clang-static clang-dev perl zlib zlib-devel clang-libs clang ninja autoconf automake libtool patchelf -y
25-
RUN cd app && CFLAGS="$CFLAGS -static-libgcc" CXXFLAGS="$CXXFLAGS -static-libgcc -static-libstdc++" LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++" node compile-ffmpeg.mjs || tail -n 30 ffmpeg/ffbuild/config.log
24+
RUN yum install yasm nasm unzip curl gcc gcc-c++ tar git make ca-certificates pkgconfig bash make cmake3 build-base llvm-static llvm-dev clang-static clang-dev perl zlib zlib-devel clang-libs clang ninja autoconf automake libtool patchelf -y
25+
RUN cd app && CFLAGS="$CFLAGS -static-libgcc" CXXFLAGS="$CXXFLAGS -static-libgcc -static-libstdc++" LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++" node compile-ffmpeg.mjs arm || tail -n 30 ffmpeg/ffbuild/config.log
2626
RUN source "$HOME/.cargo/env" && cd app && node generate-bindings.mjs
2727
RUN source "$HOME/.cargo/env" && cd app && node zip.mjs
2828
RUN source "$HOME/.cargo/env" && cd app && node test-ffmpeg.mjs

compile-ffmpeg.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,16 @@ if (!existsSync(PREFIX)) {
121121
}
122122

123123
execSync("git config --global advice.detachedHead false");
124-
const isWindows = process.argv[2] === "windows";
125-
const isMusl = process.argv[2] === "musl";
124+
const isWindows = process.argv.includes("windows");
125+
const isMusl = process.argv.includes("musl");
126+
const isArm = process.argv.includes("arm");
126127

127128
await enableFdkAac(isWindows);
128129
enableAv1(isWindows);
129130
enableZimg(isWindows);
130131
enableVpx(isWindows);
131132
enableX264(isMusl, isWindows);
132-
enableX265(isMusl, isWindows);
133+
enableX265(isMusl, isWindows, isArm);
133134
enableLibMp3Lame(isWindows);
134135
enableOpus(isWindows);
135136

compile-x265.mjs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { execSync } from "child_process";
44
import { PREFIX } from "./const.mjs";
55
import { compileFunction } from "vm";
66

7-
export const enableX265 = (isMusl, isWindows) => {
7+
export const enableX265 = (isMusl, isWindows, isArm) => {
88
if (isWindows) {
99
execSync("cp x265-windows/lib/libx265.a remotion/lib/libx265.a");
1010
execSync(
@@ -22,23 +22,36 @@ export const enableX265 = (isMusl, isWindows) => {
2222
].filter(Boolean);
2323

2424
if (!fs.existsSync("x265")) {
25-
execSync(
26-
"git clone https://bitbucket.org/multicoreware/x265_git.git x265",
27-
{
25+
if (isArm && isMusl) {
26+
execSync("git clone https://github.com/videolan/x265 x265", {
2827
stdio: "inherit",
29-
}
30-
);
28+
});
29+
} else {
30+
execSync(
31+
"git clone https://bitbucket.org/multicoreware/x265_git.git x265",
32+
{
33+
stdio: "inherit",
34+
}
35+
);
36+
}
3137
}
3238

3339
execSync("git fetch", {
3440
cwd: "x265",
3541
stdio: "inherit",
3642
});
3743

38-
execSync("git checkout 8f11c33acc267ba3f1d2bde60a6aa906e494cbde", {
39-
cwd: "x265",
40-
stdio: "inherit",
41-
});
44+
if (isArm && isMusl) {
45+
execSync("git checkout 8f11c33acc267ba3f1d2bde60a6aa906e494cbde", {
46+
cwd: "x265",
47+
stdio: "inherit",
48+
});
49+
} else {
50+
execSync("git checkout stable", {
51+
cwd: "x265",
52+
stdio: "inherit",
53+
});
54+
}
4255

4356
const staticallyLinkCLibrary = isMusl || isWindows;
4457

0 commit comments

Comments
 (0)