diff --git a/ci/build-libmpv-linux.sh b/ci/build-libmpv-linux.sh index 8eb6fa1..908c555 100644 --- a/ci/build-libmpv-linux.sh +++ b/ci/build-libmpv-linux.sh @@ -75,11 +75,21 @@ function makeplusinstall { fi } +# Download a release tarball, trying each URL in turn (a tarball usually +# exists on several independent mirrors; the first one that serves it wins). function gettar { local name="${1##*/}" [ -d "${name%%.*}" ] && return 0 - $wget "$1" - tar -xaf "$name" + local url + for url in "$@"; do + if $wget "$url" && tar -xaf "$name"; then + return 0 + fi + echo "Download of $name from $url failed, trying next mirror" + rm -f "$name" + done + echo "Error: could not download $name from any of: $*" + return 1 } # Clone a git dependency at a pinned tag (shallow, tag-checked-out). @@ -191,8 +201,10 @@ _ffmpeg () { _ffmpeg_mark=lib/libavcodec.a _freetype () { - gettar "https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VER}.tar.xz" - builddir freetype-${FREETYPE_VER} + # freetype moved to gitlab and publishes no release tarballs (the savanna + # tarball host is down), so clone the pinned tag like the other git deps. + gitpin https://gitlab.freedesktop.org/freetype/freetype.git freetype "$FREETYPE_TAG" + builddir freetype # zlib stays (system lib); every other third-party provider is disabled. # harfbuzz off: we link our own static harfbuzz into libmpv, not FT's hook. meson setup .. --buildtype release -Dprefix="$prefix_dir" -Dlibdir=lib \ diff --git a/ci/build-libmpv-macos.sh b/ci/build-libmpv-macos.sh index 9215104..17fda6e 100644 --- a/ci/build-libmpv-macos.sh +++ b/ci/build-libmpv-macos.sh @@ -122,11 +122,21 @@ function makeplusinstall { fi } +# Download a release tarball, trying each URL in turn (a tarball usually +# exists on several independent mirrors; the first one that serves it wins). function gettar { local name="${1##*/}" [ -d "${name%%.*}" ] && return 0 - $wget "$1" - tar -xaf "$name" + local url + for url in "$@"; do + if $wget "$url" && tar -xaf "$name"; then + return 0 + fi + echo "Download of $name from $url failed, trying next mirror" + rm -f "$name" + done + echo "Error: could not download $name from any of: $*" + return 1 } # Clone a git dependency at a pinned tag (shallow, tag-checked-out). @@ -199,8 +209,10 @@ _ffmpeg () { _ffmpeg_mark=lib/libavcodec.a _freetype () { - gettar "https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VER}.tar.xz" - builddir freetype-${FREETYPE_VER} + # freetype moved to gitlab and publishes no release tarballs (the savanna + # tarball host is down), so clone the pinned tag like the other git deps. + gitpin https://gitlab.freedesktop.org/freetype/freetype.git freetype "$FREETYPE_TAG" + builddir freetype # zlib stays (universal system lib); every other third-party provider is # disabled so no arm64-only brew package can leak into the x86_64 slice. # harfbuzz off: we link our own static harfbuzz into libmpv, not FT's diff --git a/ci/build-libmpv-mingw64.sh b/ci/build-libmpv-mingw64.sh index 64cd6cc..b9706cc 100644 --- a/ci/build-libmpv-mingw64.sh +++ b/ci/build-libmpv-mingw64.sh @@ -99,11 +99,21 @@ function makeplusinstall { fi } +# Download a release tarball, trying each URL in turn (a tarball usually +# exists on several independent mirrors; the first one that serves it wins). function gettar { local name="${1##*/}" [ -d "${name%%.*}" ] && return 0 - $wget "$1" - tar -xaf "$name" + local url + for url in "$@"; do + if $wget "$url" && tar -xaf "$name"; then + return 0 + fi + echo "Download of $name from $url failed, trying next mirror" + rm -f "$name" + done + echo "Error: could not download $name from any of: $*" + return 1 } # Clone a git dependency at a pinned tag (shallow, tag-checked-out). @@ -136,7 +146,12 @@ function build_if_missing { ## mpv's dependencies (all static) _iconv () { - gettar "https://ftpmirror.gnu.org/gnu/libiconv/libiconv-${ICONV_VER}.tar.gz" + # libiconv is a plain GNU archive; the savanna/ftpmirror front hosts are + # flaky, so try several independent GNU mirrors (gettar falls back). + gettar \ + "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libiconv/libiconv-${ICONV_VER}.tar.gz" \ + "https://mirrors.kernel.org/gnu/libiconv/libiconv-${ICONV_VER}.tar.gz" \ + "https://ftp.osuosl.org/pub/gnu/libiconv/libiconv-${ICONV_VER}.tar.gz" builddir libiconv-${ICONV_VER} ../configure --host=$TARGET $commonflags makeplusinstall @@ -198,8 +213,10 @@ _ffmpeg () { _ffmpeg_mark=lib/libavcodec.a _freetype () { - gettar "https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VER}.tar.xz" - builddir freetype-${FREETYPE_VER} + # freetype moved to gitlab and publishes no release tarballs (the savanna + # tarball host is down), so clone the pinned tag like the other git deps. + gitpin https://gitlab.freedesktop.org/freetype/freetype.git freetype "$FREETYPE_TAG" + builddir freetype meson setup .. --cross-file "$prefix_dir/crossfile" -Ddefault_library=static makeplusinstall popd diff --git a/ci/versions.env b/ci/versions.env index 00d2aa4..711359a 100644 --- a/ci/versions.env +++ b/ci/versions.env @@ -20,6 +20,9 @@ LIBPLACEBO_VER=v7.351.0 LIBASS_VER=0.17.4 LCMS2_VER=lcms2.17 FREETYPE_VER=2.14.1 +# Git tag name of the same release on gitlab.freedesktop.org (freetype moved +# to gitlab; no release tarballs are published there, so the build clones it). +FREETYPE_TAG=VER-2-14-1 FRIBIDI_VER=1.0.16 HARFBUZZ_VER=12.2.0