diff --git a/ci/build-common.sh b/ci/build-common.sh index 57c905cbad..fb825bf218 100644 --- a/ci/build-common.sh +++ b/ci/build-common.sh @@ -4,3 +4,10 @@ common_args="--werror \ " export CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3" + +build_subrandr() { + git clone --depth=1 https://github.com/afishhh/subrandr.git + pushd subrandr + cargo xtask install --prefix "$@" + popd +} diff --git a/ci/build-mingw64.sh b/ci/build-mingw64.sh index 0f592b8a55..4a85e0ac2c 100755 --- a/ci/build-mingw64.sh +++ b/ci/build-mingw64.sh @@ -286,6 +286,11 @@ _luajit () { } _luajit_mark=lib/libluajit-5.1.a +_subrandr () { + build_subrandr "$prefix_dir" --target "$RUST_TARGET" -- -- -L"$prefix_dir"/lib +} +_subrandr_mark=lib/libsubrandr.dll.a + for x in iconv zlib shaderc spirv-cross nv-headers dav1d lcms2; do build_if_missing $x done @@ -296,6 +301,9 @@ fi for x in ffmpeg libplacebo freetype fribidi harfbuzz libass luajit; do build_if_missing $x done +if [[ "$TARGET" != "i686-"* ]]; then + build_if_missing subrandr +fi ## mpv @@ -330,7 +338,7 @@ if [ "$2" = pack ]; then pushd artifact/tmp dlls=( libgcc_*.dll lib{ssp,stdc++,winpthread}-[0-9]*.dll # compiler runtime - av*.dll sw*.dll postproc-[0-9]*.dll lib{ass,freetype,fribidi,harfbuzz,iconv,placebo}-[0-9]*.dll + av*.dll sw*.dll {postproc,subrandr}-[0-9]*.dll lib{ass,freetype,fribidi,harfbuzz,iconv,placebo}-[0-9]*.dll lib{shaderc_shared,spirv-cross-c-shared,dav1d,lcms2}.dll zlib1.dll ) if [[ -f vulkan-1.dll ]]; then diff --git a/ci/build-msys2.sh b/ci/build-msys2.sh index 4f705ba9d6..e51b985966 100755 --- a/ci/build-msys2.sh +++ b/ci/build-msys2.sh @@ -8,9 +8,18 @@ args=( -D{egl-angle-lib,egl-angle-win32,pdf-build,rubberband,win32-smtc}=enabled ) -[[ "$SYS" == "clang64" ]] && args+=( - -Db_sanitize=address,undefined -) +if [[ "$SYS" == "clang64" ]]; then + args+=( + -Db_sanitize=address,undefined + ) +else + # currently building with subrandr on clang64+asan + # causes a weird crash (https://github.com/msys2/MINGW-packages/issues/25267) + echo "::group::Building subrandr" + build_subrandr "/$SYS" + echo "::endgroup::" + args+=(-Dsubrandr=enabled) +fi [[ "$SYS" == "clangarm64" ]] && args+=( -Dpdf-build=disabled