mirror of
https://github.com/levogevo/ffmpeg-builder.git
synced 2026-01-15 19:06:17 +00:00
improvements to spinner
This commit is contained in:
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@@ -13,7 +13,10 @@ def withDockerCreds(body) {
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
environment { DEBUG = "1" }
|
||||
environment {
|
||||
DEBUG = "1"
|
||||
HEADLESS = "1"
|
||||
}
|
||||
options { buildDiscarder logRotator(numToKeepStr: '4') }
|
||||
stages {
|
||||
stage('build docker image') {
|
||||
|
||||
22
lib/build.sh
22
lib/build.sh
@@ -510,17 +510,10 @@ do_build() {
|
||||
echo_info -n "building ${build} "
|
||||
# build in background
|
||||
local timeBefore=${EPOCHSECONDS}
|
||||
LOGNAME="${build}" echo_if_fail "build_${build}" &
|
||||
local buildPid=$!
|
||||
# start spinner
|
||||
spinner &
|
||||
local spinPid=$!
|
||||
# get build return code
|
||||
wait ${buildPid}
|
||||
spinner start
|
||||
LOGNAME="${build}" echo_if_fail "build_${build}"
|
||||
local retval=$?
|
||||
# stop spinner
|
||||
kill ${spinPid}
|
||||
spinner reset
|
||||
spinner stop
|
||||
|
||||
popd >/dev/null || return 1
|
||||
test ${retval} -eq 0 || return ${retval}
|
||||
@@ -693,6 +686,7 @@ build_cpuinfo() {
|
||||
-DCPUINFO_BUILD_UNIT_TESTS=OFF \
|
||||
-DCPUINFO_BUILD_MOCK_TESTS=OFF \
|
||||
-DCPUINFO_BUILD_BENCHMARKS=OFF \
|
||||
-DCPUINFO_LOG_TO_STDIO=ON \
|
||||
-DUSE_SYSTEM_LIBS=ON || return 1
|
||||
sanitize_sysroot_libs libcpuinfo || return 1
|
||||
}
|
||||
@@ -727,6 +721,12 @@ build_libopus() {
|
||||
}
|
||||
|
||||
build_libwebp() {
|
||||
if is_android; then
|
||||
replace_line CMakeLists.txt \
|
||||
"if(ANDROID)" \
|
||||
"if(FALSE)\n"
|
||||
fi
|
||||
|
||||
meta_cmake_build || return 1
|
||||
sanitize_sysroot_libs libwebp libsharpyuv || return 1
|
||||
}
|
||||
@@ -916,7 +916,7 @@ build_libx264() {
|
||||
|
||||
build_libmp3lame() {
|
||||
# https://sourceforge.net/p/lame/mailman/message/36081038/
|
||||
if is_darwin; then
|
||||
if is_darwin || is_android; then
|
||||
remove_line \
|
||||
'include/libmp3lame.sym' \
|
||||
'lame_init_old' || return 1
|
||||
|
||||
@@ -20,6 +20,7 @@ set_docker_run_flags() {
|
||||
-v "${REPO_DIR}:${REPO_DIR}"
|
||||
-w "${REPO_DIR}"
|
||||
-e "DEBUG=${DEBUG}"
|
||||
-e "HEADLESS=${HEADLESS}"
|
||||
)
|
||||
for opt in "${FB_COMP_OPTS[@]}"; do
|
||||
declare -n defOptVal="DEFAULT_${opt}"
|
||||
|
||||
@@ -91,6 +91,10 @@ print_req_pkgs() {
|
||||
git gnuplot bison rsync ragel
|
||||
zip unzip gperf build-essential
|
||||
binutils ninja ndk-multilib-native-static
|
||||
libandroid-posix-semaphore
|
||||
libandroid-posix-semaphore-static
|
||||
libandroid-shmem
|
||||
libandroid-shmem-static
|
||||
)
|
||||
# shellcheck disable=SC2034
|
||||
local msys_ucrt_pkgs=(
|
||||
|
||||
32
lib/utils.sh
32
lib/utils.sh
@@ -324,18 +324,16 @@ bash_sort() {
|
||||
printf '%s\n' "${arr[@]}"
|
||||
}
|
||||
|
||||
spinner() {
|
||||
if [[ $1 == 'reset' ]]; then
|
||||
echo -ne ' \n'
|
||||
return 0
|
||||
fi
|
||||
|
||||
_start_spinner() {
|
||||
local spinChars=(
|
||||
"-"
|
||||
'\'
|
||||
"|"
|
||||
"/"
|
||||
)
|
||||
|
||||
sleep 1
|
||||
|
||||
while true; do
|
||||
for ((ind = 0; ind < "${#spinChars[@]}"; ind++)); do
|
||||
echo -ne "${spinChars[${ind}]}" '\b\b'
|
||||
@@ -344,6 +342,28 @@ spinner() {
|
||||
done
|
||||
}
|
||||
|
||||
spinner() {
|
||||
local action="$1"
|
||||
local spinPidFile="${TMP_DIR}/.spinner-pid"
|
||||
case "${action}" in
|
||||
start)
|
||||
test -f "${spinPidFile}" &&
|
||||
rm "${spinPidFile}"
|
||||
|
||||
# don't want to clutter logs if running headless
|
||||
test "${HEADLESS}" == '1' &&
|
||||
return
|
||||
|
||||
_start_spinner &
|
||||
echo $! >"${spinPidFile}"
|
||||
;;
|
||||
stop)
|
||||
test -f "${spinPidFile}" && kill "$(<"${spinPidFile}")"
|
||||
echo -ne ' \n'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_pkgconfig_version() {
|
||||
local pkg="$1"
|
||||
pkg-config --modversion "${pkg}"
|
||||
|
||||
Reference in New Issue
Block a user