Compare commits

...

4 Commits

3 changed files with 47 additions and 76 deletions

View File

@@ -41,7 +41,6 @@ set_compile_opts() {
)
PKG_CONFIG_PATH="${LIBDIR}/pkgconfig"
export PKG_CONFIG_PATH
export PKG_CONFIG_DEBUG_SPEW=1
# add prefix include
C_FLAGS+=("-I${PREFIX}/include")
@@ -55,7 +54,9 @@ set_compile_opts() {
LTO_SWITCH='ON'
LTO_FLAG='-flto'
C_FLAGS+=("${LTO_FLAG}")
CONFIGURE_FLAGS+=('--enable-lto')
if ! is_darwin; then
CONFIGURE_FLAGS+=('--enable-lto')
fi
MESON_FLAGS+=("-Db_lto=true")
RUSTFLAGS+=("-C lto=yes" "-C inline-threshold=1000" "-C codegen-units=1")
CARGO_BUILD_TYPE=release
@@ -115,7 +116,7 @@ set_compile_opts() {
FFMPEG_EXTRA_FLAGS+=('--enable-rpath')
# remove static libraries for shared builds
USE_LIB_SUFF="${SHARED_LIB_SUFF}"
DEL_LIB_SUFF="${STATIC_LIB_SUFF}"
DEL_LIB_SUFF="${STATIC_LIB_SUFF}"
fi
# architecture/cpu compile flags
@@ -177,34 +178,21 @@ set_compile_opts() {
get_build_conf() {
local getBuild="${1}"
local libcVer='X.X'
if test "${getBuild}" == 'libc' && has_cmd ldd; then
local srcTest="${TMP_DIR}/libc-ver"
echo '#include <gnu/libc-version.h>
#include <stdio.h>
#include <unistd.h>
int main() { puts(gnu_get_libc_version()); return 0; }' >"${srcTest}.c"
gcc "${srcTest}.c" -o "${srcTest}"
libcVer="$("${srcTest}")"
fi
# name version file-extension url dep1,dep2
# shellcheck disable=SC2016
local BUILDS_CONF='
ffmpeg 8.0 tar.gz https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${ver}.${ext}
hdr10plus_tool 1.7.1 tar.gz https://github.com/quietvoid/hdr10plus_tool/archive/refs/tags/${ver}.${ext}
dovi_tool 2.3.0 tar.gz https://github.com/quietvoid/dovi_tool/archive/refs/tags/${ver}.${ext}
libsvtav1 3.0.2 tar.gz https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${ver}/SVT-AV1-v${ver}.${ext}
libsvtav1_psy 3.0.2 tar.gz https://github.com/psy-ex/svt-av1-psy/archive/refs/tags/v${ver}.${ext} dovi_tool,hdr10plus_tool,cpuinfo
librav1e 0.8.1 tar.gz https://github.com/xiph/rav1e/archive/refs/tags/v${ver}.${ext}
libaom 3.12.1 tar.gz https://storage.googleapis.com/aom-releases/libaom-${ver}.${ext}
libvmaf 3.0.0 tar.gz https://github.com/Netflix/vmaf/archive/refs/tags/v${ver}.${ext}
libopus 1.5.2 tar.gz https://github.com/xiph/opus/releases/download/v${ver}/opus-${ver}.${ext}
libdav1d 1.5.1 tar.xz http://downloads.videolan.org/videolan/dav1d/${ver}/dav1d-${ver}.${ext}
cpuinfo latest git https://github.com/pytorch/cpuinfo/
ffmpeg 8.0 tar.gz https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${ver}.${ext}
hdr10plus_tool 1.7.1 tar.gz https://github.com/quietvoid/hdr10plus_tool/archive/refs/tags/${ver}.${ext}
dovi_tool 2.3.0 tar.gz https://github.com/quietvoid/dovi_tool/archive/refs/tags/${ver}.${ext}
libsvtav1 3.1.1 tar.gz https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${ver}/SVT-AV1-v${ver}.${ext}
libsvtav1_psy 3.0.2-A tar.gz https://github.com/BlueSwordM/svt-av1-psyex/archive/refs/tags/v${ver}.${ext} dovi_tool,hdr10plus_tool,cpuinfo
librav1e 0.8.1 tar.gz https://github.com/xiph/rav1e/archive/refs/tags/v${ver}.${ext}
libaom 3.12.1 tar.gz https://storage.googleapis.com/aom-releases/libaom-${ver}.${ext}
libvmaf 3.0.0 tar.gz https://github.com/Netflix/vmaf/archive/refs/tags/v${ver}.${ext}
libopus 1.5.2 tar.gz https://github.com/xiph/opus/releases/download/v${ver}/opus-${ver}.${ext}
libdav1d 1.5.1 tar.xz http://downloads.videolan.org/videolan/dav1d/${ver}/dav1d-${ver}.${ext}
cpuinfo latest git https://github.com/pytorch/cpuinfo/
'
BUILDS_CONF+="libc ${libcVer} tar.xz"
BUILDS_CONF+=' https://ftpmirror.gnu.org/glibc/glibc-${ver}.${ext}'
local supported_builds=()
unset ver ext url deps extracted_dir
@@ -326,6 +314,11 @@ do_build() {
get_build_conf "${build}" || return 1
echo_info "building ${build}"
pushd "$extracted_dir" >/dev/null || return 1
# check for any patches
for patch in "${PATCHES_DIR}/${build}"/*.patch; do
test -f "${patch}" || continue
patch -p1 -i "${patch}" || return 1
done
echo_if_fail build_"${build}"
retval=$?
popd >/dev/null || return 1
@@ -387,7 +380,7 @@ sanitize_sysroot_libs() {
local useLib="${libPath}.${USE_LIB_SUFF}"
local delLib="${libPath}.${DEL_LIB_SUFF}"
if [[ ! -f "${useLib}" ]]; then
if [[ ! -f ${useLib} ]]; then
echo_fail "could not find ${useLib}, something is wrong"
return 1
fi
@@ -439,13 +432,13 @@ build_librav1e() {
local newCfg="${TMP_DIR}/${fname}"
test -f "${cfg}" || return 1
local del='-lgcc_s'
test -f "${newCfg}" && rm "${newCfg}"
while read -r line; do
if line_contains "${line}" "${del}"; then
line="${line//${del} /}"
fi
echo "${line}" >> "${newCfg}"
echo "${line}" >>"${newCfg}"
done <"${cfg}"
# overwrite the pkgconfig
${SUDO_MODIFY} cp "${newCfg}" "${cfg}"
@@ -554,7 +547,7 @@ build_libvmaf() {
if line_contains "${line}" "${search}"; then
line+=" -lstdc++"
fi
echo "${line}" >> "${newCfg}"
echo "${line}" >>"${newCfg}"
done <"${cfg}"
# overwrite the pkgconfig
${SUDO_MODIFY} cp "${newCfg}" "${cfg}"
@@ -562,46 +555,6 @@ build_libvmaf() {
}
### AUTOTOOLS ###
# special function mainly for arm64 builds
# since most distros do not compile libc
# with -fPIC for some reason
build_libc() (
# only for arm64
test "${HOSTTYPE}" != "aarch64" && exit 0
# only for static builds
test "${STATIC}" == 'false' && exit 0
# only for glibc
has_cmd ldd || exit 0
# only build once
test -f "${LIBDIR}/libc.a" && exit 0
rm -rf build
mkdir build
cd build || exit 1
# manually set flags since these are
# not intended to be user-controlled
unset CFLAGS CXXFLAGS
export CFLAGS='-fPIC -O3 -U_FORTIFY_SOURCE'
export CXXFLAGS="${CFLAGS}"
libc_prefix="${PWD}/local-install"
libc_libdir="${libc_prefix}/lib"
./../configure \
--prefix="${libc_prefix}" \
--libdir="${libc_libdir}" \
--disable-werror || exit 1
make -j"${JOBS}" all || exit 1
# install only the -fPIC static libraries
for picLib in ./**_pic.a; do
echo_warn "${picLib}"
done
# exit 1
# cd "${libc_libdir}" || exit 1
# cp ./*.a "${LIBDIR}" || exit 1
exit 0
)
add_project_versioning_to_ffmpeg() {
local optFile
local fname='ffmpeg_opt.c'
@@ -648,13 +601,29 @@ build_ffmpeg() {
done
add_project_versioning_to_ffmpeg || return 1
# lto is broken on darwin for ffmpeg only
# https://trac.ffmpeg.org/ticket/11479
local ffmpegFlags=()
if is_darwin; then
for flag in "${CONFIGURE_FLAGS[@]}"; do
test "${flag}" == '--enable-lto' && continue
ffmpegFlags+=("${flag}")
done
for flag in "${FFMPEG_EXTRA_FLAGS[@]}"; do
ffmpegFlags+=("${flag// -flto/}")
done
else
ffmpegFlags=("${CONFIGURE_FLAGS[@]}" "${FFMPEG_EXTRA_FLAGS[@]}")
fi
./configure \
"${CONFIGURE_FLAGS[@]}" \
"${FFMPEG_EXTRA_FLAGS[@]}" \
"${ffmpegFlags[@]}" \
--pkg-config='pkg-config' \
--pkg-config-flags="${PKG_CFG_FLAGS}" \
--cpu="${CPU}" --arch="${ARCH}" \
--enable-gpl --enable-version3 \
--arch="${ARCH}" \
--cpu="${CPU}" \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--disable-htmlpages \
--disable-podpages \

View File

@@ -14,7 +14,8 @@ DL_DIR="${IGN_DIR}/downloads"
BUILD_DIR="${IGN_DIR}/builds"
CCACHE_DIR="${IGN_DIR}/ccache"
DOCKER_DIR="${IGN_DIR}/docker"
export REPO_DIR IGN_DIR TMP_DIR DL_DIR BUILD_DIR CCACHE_DIR DOCKER_DIR
PATCHES_DIR="${REPO_DIR}/patches"
export REPO_DIR IGN_DIR TMP_DIR DL_DIR BUILD_DIR CCACHE_DIR DOCKER_DIR PATCHES_DIR
# function names, descriptions, completions
unset FB_FUNC_NAMES FB_FUNC_DESCS FB_FUNC_COMPLETION

View File

@@ -1,3 +1,4 @@
# https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2265
commit 5def505f7f193d890be61e869831378f212a07bd
Author: Salome Thirot <salome.thirot@arm.com>
Date: Fri May 2 11:20:54 2025 +0100