diff --git a/Jenkinsfile b/Jenkinsfile index dcb854f..459f4ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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') { diff --git a/lib/build.sh b/lib/build.sh index e109afc..51e93d5 100644 --- a/lib/build.sh +++ b/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 diff --git a/lib/docker.sh b/lib/docker.sh index 5a9bda1..3a60f38 100644 --- a/lib/docker.sh +++ b/lib/docker.sh @@ -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}" diff --git a/lib/install_deps.sh b/lib/install_deps.sh index cd5561f..78f134e 100644 --- a/lib/install_deps.sh +++ b/lib/install_deps.sh @@ -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=( diff --git a/lib/utils.sh b/lib/utils.sh index 12eac72..10b9740 100644 --- a/lib/utils.sh +++ b/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}"