mirror of
https://github.com/kirbylink/mpv-natives
synced 2026-11-25 11:12:25 +01:00
Merge pull request #6 from kirbylink/build/robust-dep-downloads
build: stop depending on the flaky GNU tarball front hosts
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user