FFmpeg-Builds/scripts.d/10-mingw.sh
2021-05-30 19:29:03 +02:00

68 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
MINGW_REPO="https://github.com/mirror/mingw-w64.git"
MINGW_COMMIT="f95546461fa7edfb2856c92f2c48f958ff0a9de4"
ffbuild_enabled() {
[[ $TARGET == win* ]] || return -1
return 0
}
ffbuild_dockerstage() {
to_df "RUN --mount=src=${SELF},dst=/stage.sh --mount=src=patches/mingw,dst=/patches run_stage /stage.sh"
}
ffbuild_dockerlayer() {
to_df "COPY --from=${SELFLAYER} /opt/mingw/. /"
to_df "COPY --from=${SELFLAYER} /opt/mingw/. /opt/mingw"
}
ffbuild_dockerfinal() {
to_df "COPY --from=${PREVLAYER} /opt/mingw/. /"
}
ffbuild_dockerbuild() {
git-mini-clone "$MINGW_REPO" "$MINGW_COMMIT" mingw
cd mingw
for patch in /patches/*.patch; do
echo "Applying $patch"
git am < "$patch"
done
cd mingw-w64-headers
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
unset PKG_CONFIG_LIBDIR
local myconf=(
--prefix="/usr/$FFBUILD_TOOLCHAIN"
--host="$FFBUILD_TOOLCHAIN"
--with-default-win32-winnt="0x601"
--enable-idl
)
./configure "${myconf[@]}"
make -j$(nproc)
make install DESTDIR="/opt/mingw"
cd ../mingw-w64-libraries/winpthreads
local myconf=(
--prefix="/usr/$FFBUILD_TOOLCHAIN"
--host="$FFBUILD_TOOLCHAIN"
--with-pic
--disable-shared
--enable-static
)
./configure "${myconf[@]}"
make -j$(nproc)
make install DESTDIR="/opt/mingw"
}
ffbuild_configure() {
echo --disable-w32threads --enable-pthreads
}