mirror of
https://github.com/BtbN/FFmpeg-Builds.git
synced 2025-04-29 14:14:35 +02:00
70 lines
1.6 KiB
Bash
Executable File
70 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
SCRIPT_REPO="https://git.code.sf.net/p/mingw-w64/mingw-w64.git"
|
|
SCRIPT_COMMIT="7939d61c6c63cf841fea515aabe5a12394980198"
|
|
|
|
ffbuild_enabled() {
|
|
[[ $TARGET == win* ]] || return -1
|
|
return 0
|
|
}
|
|
|
|
ffbuild_dockerlayer() {
|
|
[[ $TARGET == winarm* ]] && return 0
|
|
to_df "COPY --link --from=${SELFLAYER} /opt/mingw/. /"
|
|
to_df "COPY --link --from=${SELFLAYER} /opt/mingw/. /opt/mingw"
|
|
}
|
|
|
|
ffbuild_dockerfinal() {
|
|
[[ $TARGET == winarm* ]] && return 0
|
|
to_df "COPY --from=${PREVLAYER} /opt/mingw/. /"
|
|
}
|
|
|
|
ffbuild_dockerdl() {
|
|
echo "retry-tool sh -c \"rm -rf mingw && git clone '$SCRIPT_REPO' mingw\" && cd mingw && git checkout \"$SCRIPT_COMMIT\""
|
|
}
|
|
|
|
ffbuild_dockerbuild() {
|
|
[[ $TARGET == winarm* ]] && return 0
|
|
|
|
cd mingw-w64-headers
|
|
|
|
unset CFLAGS
|
|
unset CXXFLAGS
|
|
unset LDFLAGS
|
|
unset PKG_CONFIG_LIBDIR
|
|
|
|
if [[ -z "$COMPILER_SYSROOT" ]]; then
|
|
COMPILER_SYSROOT="$(${CC} -print-sysroot)/usr/${FFBUILD_TOOLCHAIN}"
|
|
fi
|
|
|
|
local myconf=(
|
|
--prefix="$COMPILER_SYSROOT"
|
|
--host="$FFBUILD_TOOLCHAIN"
|
|
--with-default-win32-winnt="0x601"
|
|
--with-default-msvcrt=ucrt
|
|
--enable-idl
|
|
)
|
|
|
|
./configure "${myconf[@]}"
|
|
make -j$(nproc)
|
|
make install DESTDIR="/opt/mingw"
|
|
|
|
cd ../mingw-w64-libraries/winpthreads
|
|
|
|
local myconf=(
|
|
--prefix="$COMPILER_SYSROOT"
|
|
--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
|
|
}
|