Files
jellyfin-ffmpeg/builder/scripts.d/10-mingw.sh
T

97 lines
2.1 KiB
Bash
Raw Normal View History

2022-11-11 18:15:45 +08:00
#!/bin/bash
2025-05-28 23:33:29 +08:00
SCRIPT_REPO="https://github.com/mingw-w64/mingw-w64.git"
2026-05-28 10:55:08 +08:00
SCRIPT_COMMIT="b2b5e53e9d9be406e60ebc152a9cf161b87d4e12"
2022-11-11 18:15:45 +08:00
ffbuild_enabled() {
[[ $TARGET == win* ]] || return -1
return 0
}
ffbuild_dockerlayer() {
2025-05-28 23:33:29 +08:00
to_df "COPY --link --from=${SELFLAYER} /opt/mingw/. /"
to_df "COPY --link --from=${SELFLAYER} /opt/mingw/. /opt/mingw"
2022-11-11 18:15:45 +08:00
}
ffbuild_dockerfinal() {
2025-05-28 23:33:29 +08:00
to_df "COPY --link --from=${PREVLAYER} /opt/mingw/. /"
2022-11-11 18:15:45 +08:00
}
ffbuild_dockerbuild() {
2023-06-03 16:05:06 +08:00
retry-tool sh -c "rm -rf mingw && git clone '$SCRIPT_REPO' mingw"
2022-11-11 18:15:45 +08:00
cd mingw
2023-06-03 16:05:06 +08:00
git checkout "$SCRIPT_COMMIT"
2022-11-11 18:15:45 +08:00
GCC_SYSROOT="$(${FFBUILD_CROSS_PREFIX}gcc -print-sysroot)"
2025-05-28 23:33:29 +08:00
unset CC CXX LD AR CPP LIBS CCAS
unset CFLAGS CXXFLAGS LDFLAGS CPPFLAGS CCASFLAGS
unset PKG_CONFIG_LIBDIR
###
### mingw-w64-headers
###
(
cd mingw-w64-headers
local myconf=(
--prefix="$GCC_SYSROOT/usr/$FFBUILD_TOOLCHAIN"
--host="$FFBUILD_TOOLCHAIN"
--with-default-win32-winnt="0x601"
--with-default-msvcrt="ucrt"
--enable-idl
--enable-sdk=all
--enable-secure-api
)
./configure "${myconf[@]}"
make -j$(nproc)
make install DESTDIR="/opt/mingw"
2022-11-11 18:15:45 +08:00
)
2025-05-28 23:33:29 +08:00
cp -a /opt/mingw/. /
2022-11-11 18:15:45 +08:00
2025-05-28 23:33:29 +08:00
###
### mingw-w64-crt
###
(
cd mingw-w64-crt
2022-11-11 18:15:45 +08:00
2025-05-28 23:33:29 +08:00
local myconf=(
--prefix="$GCC_SYSROOT/usr/$FFBUILD_TOOLCHAIN"
--host="$FFBUILD_TOOLCHAIN"
--with-default-msvcrt="ucrt"
--enable-wildcard
)
./configure "${myconf[@]}"
make -j$(nproc)
make install DESTDIR="/opt/mingw"
2022-11-11 18:15:45 +08:00
)
2025-05-28 23:33:29 +08:00
cp -a /opt/mingw/. /
###
### mingw-w64-libraries/winpthreads
###
(
cd mingw-w64-libraries/winpthreads
local myconf=(
--prefix="$GCC_SYSROOT/usr/$FFBUILD_TOOLCHAIN"
--host="$FFBUILD_TOOLCHAIN"
--with-pic
--disable-shared
--enable-static
)
./configure "${myconf[@]}"
make -j$(nproc)
make install DESTDIR="/opt/mingw"
)
2022-11-11 18:15:45 +08:00
}
ffbuild_configure() {
echo --disable-w32threads --enable-pthreads
}