mirror of
https://github.com/levogevo/ffmpeg-builder.git
synced 2026-01-16 11:26:17 +00:00
Compare commits
4 Commits
ab145089f4
...
96689ac1d5
| Author | SHA1 | Date | |
|---|---|---|---|
| 96689ac1d5 | |||
| 9c6450ecaf | |||
| 49f9181f9d | |||
| e2366892ca |
91
lib/build.sh
91
lib/build.sh
@@ -41,7 +41,6 @@ set_compile_opts() {
|
|||||||
)
|
)
|
||||||
PKG_CONFIG_PATH="${LIBDIR}/pkgconfig"
|
PKG_CONFIG_PATH="${LIBDIR}/pkgconfig"
|
||||||
export PKG_CONFIG_PATH
|
export PKG_CONFIG_PATH
|
||||||
export PKG_CONFIG_DEBUG_SPEW=1
|
|
||||||
|
|
||||||
# add prefix include
|
# add prefix include
|
||||||
C_FLAGS+=("-I${PREFIX}/include")
|
C_FLAGS+=("-I${PREFIX}/include")
|
||||||
@@ -55,7 +54,9 @@ set_compile_opts() {
|
|||||||
LTO_SWITCH='ON'
|
LTO_SWITCH='ON'
|
||||||
LTO_FLAG='-flto'
|
LTO_FLAG='-flto'
|
||||||
C_FLAGS+=("${LTO_FLAG}")
|
C_FLAGS+=("${LTO_FLAG}")
|
||||||
|
if ! is_darwin; then
|
||||||
CONFIGURE_FLAGS+=('--enable-lto')
|
CONFIGURE_FLAGS+=('--enable-lto')
|
||||||
|
fi
|
||||||
MESON_FLAGS+=("-Db_lto=true")
|
MESON_FLAGS+=("-Db_lto=true")
|
||||||
RUSTFLAGS+=("-C lto=yes" "-C inline-threshold=1000" "-C codegen-units=1")
|
RUSTFLAGS+=("-C lto=yes" "-C inline-threshold=1000" "-C codegen-units=1")
|
||||||
CARGO_BUILD_TYPE=release
|
CARGO_BUILD_TYPE=release
|
||||||
@@ -177,25 +178,14 @@ set_compile_opts() {
|
|||||||
get_build_conf() {
|
get_build_conf() {
|
||||||
local getBuild="${1}"
|
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
|
# name version file-extension url dep1,dep2
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
local BUILDS_CONF='
|
local BUILDS_CONF='
|
||||||
ffmpeg 8.0 tar.gz https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${ver}.${ext}
|
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}
|
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}
|
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 3.1.1 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
|
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}
|
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}
|
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}
|
libvmaf 3.0.0 tar.gz https://github.com/Netflix/vmaf/archive/refs/tags/v${ver}.${ext}
|
||||||
@@ -203,8 +193,6 @@ libopus 1.5.2 tar.gz https://github.com/xiph/opus/releases/download
|
|||||||
libdav1d 1.5.1 tar.xz http://downloads.videolan.org/videolan/dav1d/${ver}/dav1d-${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/
|
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=()
|
local supported_builds=()
|
||||||
unset ver ext url deps extracted_dir
|
unset ver ext url deps extracted_dir
|
||||||
@@ -326,6 +314,11 @@ do_build() {
|
|||||||
get_build_conf "${build}" || return 1
|
get_build_conf "${build}" || return 1
|
||||||
echo_info "building ${build}"
|
echo_info "building ${build}"
|
||||||
pushd "$extracted_dir" >/dev/null || return 1
|
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}"
|
echo_if_fail build_"${build}"
|
||||||
retval=$?
|
retval=$?
|
||||||
popd >/dev/null || return 1
|
popd >/dev/null || return 1
|
||||||
@@ -387,7 +380,7 @@ sanitize_sysroot_libs() {
|
|||||||
local useLib="${libPath}.${USE_LIB_SUFF}"
|
local useLib="${libPath}.${USE_LIB_SUFF}"
|
||||||
local delLib="${libPath}.${DEL_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"
|
echo_fail "could not find ${useLib}, something is wrong"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -562,46 +555,6 @@ build_libvmaf() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
### AUTOTOOLS ###
|
### 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() {
|
add_project_versioning_to_ffmpeg() {
|
||||||
local optFile
|
local optFile
|
||||||
local fname='ffmpeg_opt.c'
|
local fname='ffmpeg_opt.c'
|
||||||
@@ -648,13 +601,29 @@ build_ffmpeg() {
|
|||||||
done
|
done
|
||||||
add_project_versioning_to_ffmpeg || return 1
|
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 \
|
||||||
"${CONFIGURE_FLAGS[@]}" \
|
"${ffmpegFlags[@]}" \
|
||||||
"${FFMPEG_EXTRA_FLAGS[@]}" \
|
|
||||||
--pkg-config='pkg-config' \
|
--pkg-config='pkg-config' \
|
||||||
--pkg-config-flags="${PKG_CFG_FLAGS}" \
|
--pkg-config-flags="${PKG_CFG_FLAGS}" \
|
||||||
--cpu="${CPU}" --arch="${ARCH}" \
|
--arch="${ARCH}" \
|
||||||
--enable-gpl --enable-version3 \
|
--cpu="${CPU}" \
|
||||||
|
--enable-gpl \
|
||||||
|
--enable-version3 \
|
||||||
--enable-nonfree \
|
--enable-nonfree \
|
||||||
--disable-htmlpages \
|
--disable-htmlpages \
|
||||||
--disable-podpages \
|
--disable-podpages \
|
||||||
|
|||||||
3
main.sh
3
main.sh
@@ -14,7 +14,8 @@ DL_DIR="${IGN_DIR}/downloads"
|
|||||||
BUILD_DIR="${IGN_DIR}/builds"
|
BUILD_DIR="${IGN_DIR}/builds"
|
||||||
CCACHE_DIR="${IGN_DIR}/ccache"
|
CCACHE_DIR="${IGN_DIR}/ccache"
|
||||||
DOCKER_DIR="${IGN_DIR}/docker"
|
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
|
# function names, descriptions, completions
|
||||||
unset FB_FUNC_NAMES FB_FUNC_DESCS FB_FUNC_COMPLETION
|
unset FB_FUNC_NAMES FB_FUNC_DESCS FB_FUNC_COMPLETION
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2265
|
||||||
commit 5def505f7f193d890be61e869831378f212a07bd
|
commit 5def505f7f193d890be61e869831378f212a07bd
|
||||||
Author: Salome Thirot <salome.thirot@arm.com>
|
Author: Salome Thirot <salome.thirot@arm.com>
|
||||||
Date: Fri May 2 11:20:54 2025 +0100
|
Date: Fri May 2 11:20:54 2025 +0100
|
||||||
Reference in New Issue
Block a user