FFmpeg-Builds/scripts.d/10-mingw.sh

63 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/bash
SCRIPT_REPO="https://git.code.sf.net/p/mingw-w64/mingw-w64.git"
SCRIPT_COMMIT="9df2e604ddf16765410724716a8d1887ffc61fa9"
ffbuild_enabled() {
[[ $TARGET == win* ]] || return -1
return 0
}
2021-04-06 01:41:36 +00:00
ffbuild_dockerlayer() {
2021-04-06 04:23:15 +00:00
to_df "COPY --from=${SELFLAYER} /opt/mingw/. /"
to_df "COPY --from=${SELFLAYER} /opt/mingw/. /opt/mingw"
2021-04-06 01:41:36 +00:00
}
ffbuild_dockerfinal() {
2021-04-06 04:23:15 +00:00
to_df "COPY --from=${PREVLAYER} /opt/mingw/. /"
2021-04-06 01:41:36 +00:00
}
ffbuild_dockerbuild() {
retry-tool sh -c "rm -rf mingw && git clone '$SCRIPT_REPO' mingw"
cd mingw
git checkout "$SCRIPT_COMMIT"
cd mingw-w64-headers
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
unset PKG_CONFIG_LIBDIR
GCC_SYSROOT="$(${FFBUILD_CROSS_PREFIX}gcc -print-sysroot)"
local myconf=(
--prefix="$GCC_SYSROOT/usr/$FFBUILD_TOOLCHAIN"
--host="$FFBUILD_TOOLCHAIN"
2020-10-11 14:40:40 +00:00
--with-default-win32-winnt="0x601"
--enable-idl
)
2021-04-04 21:20:31 +00:00
./configure "${myconf[@]}"
make -j$(nproc)
2021-04-06 04:23:15 +00:00
make install DESTDIR="/opt/mingw"
cd ../mingw-w64-libraries/winpthreads
local myconf=(
--prefix="$GCC_SYSROOT/usr/$FFBUILD_TOOLCHAIN"
--host="$FFBUILD_TOOLCHAIN"
--with-pic
--disable-shared
--enable-static
)
2021-04-04 21:20:31 +00:00
./configure "${myconf[@]}"
make -j$(nproc)
2021-04-06 04:23:15 +00:00
make install DESTDIR="/opt/mingw"
}
2020-11-10 14:39:22 +00:00
ffbuild_configure() {
echo --disable-w32threads --enable-pthreads
}