build: stop depending on the flaky GNU tarball front hosts

download.savannah.gnu.org and ftpmirror.gnu.org (which share one front
host) intermittently time out from the GitHub runners, which has already
broken the freetype and libiconv steps. Route the affected dependencies
around that host:

- freetype is now fetched via git (gitlab.freedesktop.org, pinned tag
  VER-2-14-1) like the other git dependencies, instead of a savanna
  tarball that no longer has a working host.
- libiconv now tries several independent GNU mirrors, the first one that
  serves it winning.
- gettar() generalizes to accept a list of fallback URLs so any future
  tarball dependency can name its mirrors too.
This commit is contained in:
david
2026-10-06 09:13:07 +02:00
parent b6fbd997d6
commit ea42f65e46
4 changed files with 57 additions and 13 deletions
+16 -4
View File
@@ -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 \
+16 -4
View File
@@ -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
+22 -5
View File
@@ -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
+3
View File
@@ -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