2022-08-02 18:37:17 +00:00
|
|
|
ARG GH_REPO=ghcr.io/btbn/ffmpeg-builds
|
|
|
|
FROM $GH_REPO/base:latest
|
2020-09-01 21:17:10 +00:00
|
|
|
|
2021-12-06 17:23:09 +00:00
|
|
|
RUN --mount=src=ct-ng-config,dst=/.config \
|
|
|
|
git clone --filter=blob:none https://github.com/crosstool-ng/crosstool-ng.git /ct-ng && cd /ct-ng && \
|
|
|
|
./bootstrap && \
|
|
|
|
./configure --enable-local && \
|
|
|
|
make -j$(nproc) && \
|
|
|
|
cp /.config .config && \
|
|
|
|
./ct-ng build && \
|
|
|
|
cd / && \
|
|
|
|
rm -rf ct-ng
|
2020-09-01 21:17:10 +00:00
|
|
|
|
2021-12-06 17:23:09 +00:00
|
|
|
# Prepare "cross" environment to heavily favour static builds
|
2020-09-01 21:17:10 +00:00
|
|
|
RUN \
|
2021-12-06 17:23:09 +00:00
|
|
|
find /opt/ct-ng \
|
|
|
|
-name "*.dll" \
|
|
|
|
-or -name "*.dll.a" \
|
|
|
|
-delete && \
|
2020-09-03 20:49:43 +00:00
|
|
|
mkdir /opt/ffbuild
|
2020-09-02 16:07:59 +00:00
|
|
|
|
2020-11-07 20:35:21 +00:00
|
|
|
RUN rustup target add x86_64-pc-windows-gnu
|
|
|
|
|
2020-09-03 20:49:43 +00:00
|
|
|
ADD toolchain.cmake /toolchain.cmake
|
2020-09-06 14:34:09 +00:00
|
|
|
ADD cross.meson /cross.meson
|
2020-09-03 20:49:43 +00:00
|
|
|
|
2022-10-31 20:47:07 +00:00
|
|
|
ENV FFBUILD_TOOLCHAIN=x86_64-w64-mingw32
|
2021-12-06 17:23:09 +00:00
|
|
|
ENV PATH="/opt/ct-ng/bin:${PATH}" \
|
2022-10-31 20:47:07 +00:00
|
|
|
FFBUILD_TARGET_FLAGS="--pkg-config=pkg-config --cross-prefix=${FFBUILD_TOOLCHAIN}- --arch=x86_64 --target-os=mingw32" \
|
|
|
|
FFBUILD_CROSS_PREFIX=${FFBUILD_TOOLCHAIN}- \
|
2021-04-04 02:08:20 +00:00
|
|
|
FFBUILD_RUST_TARGET=x86_64-pc-windows-gnu \
|
2020-09-03 20:49:43 +00:00
|
|
|
FFBUILD_PREFIX=/opt/ffbuild \
|
|
|
|
FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \
|
2021-07-13 21:51:33 +00:00
|
|
|
PKG_CONFIG=pkg-config \
|
2021-07-14 19:37:48 +00:00
|
|
|
PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig:/opt/ffbuild/share/pkgconfig \
|
2022-11-02 21:02:09 +00:00
|
|
|
CC="${FFBUILD_TOOLCHAIN}-gcc" \
|
|
|
|
CXX="${FFBUILD_TOOLCHAIN}-g++" \
|
|
|
|
LD="${FFBUILD_TOOLCHAIN}-ld" \
|
|
|
|
AR="${FFBUILD_TOOLCHAIN}-gcc-ar" \
|
|
|
|
RANLIB="${FFBUILD_TOOLCHAIN}-gcc-ranlib" \
|
|
|
|
NM="${FFBUILD_TOOLCHAIN}-gcc-nm" \
|
|
|
|
DLLTOOL="${FFBUILD_TOOLCHAIN}-dlltool" \
|
2022-12-05 17:57:54 +00:00
|
|
|
CFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection" \
|
|
|
|
CXXFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection" \
|
|
|
|
LDFLAGS="-static-libgcc -static-libstdc++ -L/opt/ffbuild/lib -O2 -pipe -fstack-protector-strong -fstack-clash-protection" \
|
2021-07-15 00:05:21 +00:00
|
|
|
STAGE_CFLAGS="-fno-semantic-interposition" \
|
|
|
|
STAGE_CXXFLAGS="-fno-semantic-interposition"
|