mirror of
https://github.com/levogevo/ffmpeg-builder.git
synced 2026-01-15 10:56:17 +00:00
improve add_project_versioning_to_ffmpeg and remove HEADLESS
This commit is contained in:
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@@ -15,7 +15,6 @@ pipeline {
|
||||
agent none
|
||||
environment {
|
||||
DEBUG = "1"
|
||||
HEADLESS = "1"
|
||||
}
|
||||
options { buildDiscarder logRotator(numToKeepStr: '4') }
|
||||
stages {
|
||||
|
||||
@@ -279,6 +279,13 @@ is_positive_integer() {
|
||||
return 0
|
||||
}
|
||||
|
||||
print_line_indent() {
|
||||
local line="$1"
|
||||
if [[ ${line} =~ ^( +) ]]; then
|
||||
echo -n "${BASH_REMATCH[1]}"
|
||||
fi
|
||||
}
|
||||
|
||||
replace_line() {
|
||||
local file="$1"
|
||||
local search="$2"
|
||||
@@ -286,8 +293,9 @@ replace_line() {
|
||||
local newFile="${TMP_DIR}/$(bash_basename "${file}")"
|
||||
|
||||
test -f "${newFile}" && rm "${newFile}"
|
||||
while read -r line; do
|
||||
while IFS= read -r line; do
|
||||
if line_contains "${line}" "${search}"; then
|
||||
print_line_indent "${line}" >>"${newFile}"
|
||||
echo -en "${newLine}" >>"${newFile}"
|
||||
continue
|
||||
fi
|
||||
@@ -349,9 +357,6 @@ spinner() {
|
||||
start)
|
||||
test -f "${spinPidFile}" && rm "${spinPidFile}"
|
||||
|
||||
# don't want to clutter logs if running headless
|
||||
test "${HEADLESS}" == '1' && return
|
||||
|
||||
_start_spinner &
|
||||
echo $! >"${spinPidFile}"
|
||||
;;
|
||||
|
||||
42
lib/build.sh
42
lib/build.sh
@@ -964,11 +964,6 @@ build_libvmaf() {
|
||||
fi
|
||||
}
|
||||
|
||||
build_libass() {
|
||||
meta_meson_build || return 1
|
||||
sanitize_sysroot_libs libass || return 1
|
||||
}
|
||||
|
||||
build_freetype() {
|
||||
meta_meson_build \
|
||||
-D tests=disabled || return 1
|
||||
@@ -1082,6 +1077,11 @@ build_libunibreak() {
|
||||
sanitize_sysroot_libs libunibreak || return 1
|
||||
}
|
||||
|
||||
build_libass() {
|
||||
meta_configure_build || return 1
|
||||
sanitize_sysroot_libs libass || return 1
|
||||
}
|
||||
|
||||
add_project_versioning_to_ffmpeg() {
|
||||
# embed this project's enables/versions
|
||||
# into ffmpeg with FFMPEG_BUILDER_INFO
|
||||
@@ -1104,34 +1104,10 @@ add_project_versioning_to_ffmpeg() {
|
||||
echo_fail "could not find ${fname} to add project versioning"
|
||||
fi
|
||||
|
||||
local searchFor='static void print_all_libs_info'
|
||||
local foundUsageStart=0
|
||||
local newOptFile="${TMP_DIR}/${fname}"
|
||||
test -f "${newOptFile}" && rm "${newOptFile}"
|
||||
while read -r line; do
|
||||
# if we found the line previously, add the versioning
|
||||
if [[ ${foundUsageStart} -eq 1 ]]; then
|
||||
if line_starts_with "${line}" '}'; then
|
||||
echo_info "found ${line} on ${lineNum}"
|
||||
for info in "${FFMPEG_BUILDER_INFO[@]}"; do
|
||||
local newline="av_log(NULL, AV_LOG_INFO, \"${info}\n\");"
|
||||
echo "${newline}" >>"${newOptFile}"
|
||||
lineNum=$((lineNum + 1))
|
||||
done
|
||||
newline="av_log(NULL, AV_LOG_INFO, \"\n\");"
|
||||
echo "${newline}" >>"${newOptFile}"
|
||||
foundUsageStart=0
|
||||
fi
|
||||
fi
|
||||
# find the line we are searching for
|
||||
if line_contains "${line}" "${searchFor}"; then
|
||||
foundUsageStart=1
|
||||
fi
|
||||
# start building the new file
|
||||
echo "${line}" >>"${newOptFile}"
|
||||
done <"${optFile}"
|
||||
|
||||
cp "${newOptFile}" "${optFile}" || return 1
|
||||
local printLibLine='print_all_libs_info(SHOW_VERSION, AV_LOG_INFO);'
|
||||
local newPrintLibLine="${printLibLine} "
|
||||
newPrintLibLine+="$(printf 'av_log(NULL, AV_LOG_INFO, "%s\\\\n"); ' "${FFMPEG_BUILDER_INFO[@]}")"
|
||||
replace_line "${optFile}" "${printLibLine}" "${newPrintLibLine}" || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ set_docker_run_flags() {
|
||||
-v "${REPO_DIR}:${REPO_DIR}"
|
||||
-w "${REPO_DIR}"
|
||||
-e "DEBUG=${DEBUG}"
|
||||
-e "HEADLESS=${HEADLESS}"
|
||||
-t
|
||||
)
|
||||
for opt in "${FB_COMP_OPTS[@]}"; do
|
||||
declare -n defOptVal="DEFAULT_${opt}"
|
||||
|
||||
Reference in New Issue
Block a user