|
|
@ -1928,8 +1928,8 @@ clone_git_repository_with_commit_id() { |
|
|
|
|
|
|
|
|
|
|
|
RC=$? |
|
|
|
RC=$? |
|
|
|
|
|
|
|
|
|
|
|
if [ ${RC} -ne 0 ]; then |
|
|
|
if [[ ${RC} -ne 0 ]]; then |
|
|
|
echo -e "\nINFO: Failed to create local directory $2\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nERROR: Failed to create local directory $2\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${RC} |
|
|
|
echo ${RC} |
|
|
|
return |
|
|
|
return |
|
|
@ -1941,8 +1941,8 @@ clone_git_repository_with_commit_id() { |
|
|
|
|
|
|
|
|
|
|
|
RC=$? |
|
|
|
RC=$? |
|
|
|
|
|
|
|
|
|
|
|
if [ ${RC} -ne 0 ]; then |
|
|
|
if [[ ${RC} -ne 0 ]]; then |
|
|
|
echo -e "\nINFO: Failed to clone $1\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nERROR: Failed to clone $1\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${RC} |
|
|
|
echo ${RC} |
|
|
|
return |
|
|
|
return |
|
|
@ -1952,8 +1952,8 @@ clone_git_repository_with_commit_id() { |
|
|
|
|
|
|
|
|
|
|
|
RC=$? |
|
|
|
RC=$? |
|
|
|
|
|
|
|
|
|
|
|
if [ ${RC} -ne 0 ]; then |
|
|
|
if [[ ${RC} -ne 0 ]]; then |
|
|
|
echo -e "\nINFO: Failed to cd into $2\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nERROR: Failed to cd into $2\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${RC} |
|
|
|
echo ${RC} |
|
|
|
return |
|
|
|
return |
|
|
@ -1963,8 +1963,8 @@ clone_git_repository_with_commit_id() { |
|
|
|
|
|
|
|
|
|
|
|
RC=$? |
|
|
|
RC=$? |
|
|
|
|
|
|
|
|
|
|
|
if [ ${RC} -ne 0 ]; then |
|
|
|
if [[ ${RC} -ne 0 ]]; then |
|
|
|
echo -e "\nINFO: Failed to fetch commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nERROR: Failed to fetch commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${RC} |
|
|
|
echo ${RC} |
|
|
|
return |
|
|
|
return |
|
|
@ -1974,8 +1974,8 @@ clone_git_repository_with_commit_id() { |
|
|
|
|
|
|
|
|
|
|
|
RC=$? |
|
|
|
RC=$? |
|
|
|
|
|
|
|
|
|
|
|
if [ ${RC} -ne 0 ]; then |
|
|
|
if [[ ${RC} -ne 0 ]]; then |
|
|
|
echo -e "\nINFO: Failed to checkout commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nERROR: Failed to checkout commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${RC} |
|
|
|
echo ${RC} |
|
|
|
return |
|
|
|
return |
|
|
|
fi |
|
|
|
fi |
|
|
@ -1995,8 +1995,8 @@ clone_git_repository_with_tag() { |
|
|
|
|
|
|
|
|
|
|
|
RC=$? |
|
|
|
RC=$? |
|
|
|
|
|
|
|
|
|
|
|
if [ ${RC} -ne 0 ]; then |
|
|
|
if [[ ${RC} -ne 0 ]]; then |
|
|
|
echo -e "\nINFO: Failed to create local directory $3\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nERROR: Failed to create local directory $3\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$3" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$3" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${RC} |
|
|
|
echo ${RC} |
|
|
|
return |
|
|
|
return |
|
|
@ -2008,8 +2008,8 @@ clone_git_repository_with_tag() { |
|
|
|
|
|
|
|
|
|
|
|
RC=$? |
|
|
|
RC=$? |
|
|
|
|
|
|
|
|
|
|
|
if [ ${RC} -ne 0 ]; then |
|
|
|
if [[ ${RC} -ne 0 ]]; then |
|
|
|
echo -e "\nINFO: Failed to clone $1 -> $2\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nERROR: Failed to clone $1 -> $2\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$3" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -rf "$3" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${RC} |
|
|
|
echo ${RC} |
|
|
|
return |
|
|
|
return |
|
|
@ -2035,34 +2035,26 @@ is_gpl_licensed() { |
|
|
|
downloaded_library_sources() { |
|
|
|
downloaded_library_sources() { |
|
|
|
|
|
|
|
|
|
|
|
# DOWNLOAD FFMPEG SOURCE CODE FIRST |
|
|
|
# DOWNLOAD FFMPEG SOURCE CODE FIRST |
|
|
|
DOWNLOAD_RESULT=$(download_library_source "ffmpeg") |
|
|
|
if [[ $(download_library_source "ffmpeg") -ne 0 ]]; then |
|
|
|
if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then |
|
|
|
|
|
|
|
echo -e "failed\n" |
|
|
|
|
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# DOWNLOAD LIBRARY SOURCES |
|
|
|
for library in {1..50}; do |
|
|
|
for library in {1..50}; do |
|
|
|
if [[ ${!library} -eq 1 ]]; then |
|
|
|
if [[ ${!library} -eq 1 ]]; then |
|
|
|
library_name=$(get_library_name $((library - 1))) |
|
|
|
library_name=$(get_library_name $((library - 1))) |
|
|
|
|
|
|
|
|
|
|
|
echo -e "\nDEBUG: Downloading library ${library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nDEBUG: Downloading library ${library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
|
|
|
|
if [[ $(download_library_source "${library_name}") -ne 0 ]]; then |
|
|
|
DOWNLOAD_RESULT=$(download_library_source "${library_name}") |
|
|
|
|
|
|
|
if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then |
|
|
|
|
|
|
|
echo -e "failed\n" |
|
|
|
|
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# DOWNLOAD CUSTOM LIBRARY SOURCES |
|
|
|
for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do |
|
|
|
for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do |
|
|
|
library_name="CUSTOM_LIBRARY_${custom_library_index}_NAME" |
|
|
|
library_name="CUSTOM_LIBRARY_${custom_library_index}_NAME" |
|
|
|
|
|
|
|
|
|
|
|
echo -e "\nDEBUG: Downloading custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nDEBUG: Downloading custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
|
|
|
|
if [[ $(download_custom_library_source "${custom_library_index}") -ne 0 ]]; then |
|
|
|
DOWNLOAD_RESULT=$(download_custom_library_source "${custom_library_index}") |
|
|
|
|
|
|
|
if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then |
|
|
|
|
|
|
|
echo -e "failed\n" |
|
|
|
|
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
done |
|
|
|
done |
|
|
@ -2089,7 +2081,7 @@ download() { |
|
|
|
else |
|
|
|
else |
|
|
|
rm -f "${FFMPEG_KIT_TMPDIR}"/"$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
rm -f "${FFMPEG_KIT_TMPDIR}"/"$2" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
|
|
|
|
|
|
|
|
echo -e -n "\nINFO: Failed to download $1 to ${FFMPEG_KIT_TMPDIR}/$2, rc=${RC}. " 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e -n "\nERROR: Failed to download $1 to ${FFMPEG_KIT_TMPDIR}/$2, rc=${RC}. " 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
|
|
|
|
|
|
|
|
if [ "$3" == "exit" ]; then |
|
|
|
if [ "$3" == "exit" ]; then |
|
|
|
echo -e "DEBUG: Build will now exit.\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "DEBUG: Build will now exit.\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
@ -2135,7 +2127,7 @@ download_library_source() { |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ ${DOWNLOAD_RC} -ne 0 ]; then |
|
|
|
if [ ${DOWNLOAD_RC} -ne 0 ]; then |
|
|
|
echo -e "INFO: Downloading library $1 failed. Can not get library from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "ERROR: Downloading library $1 failed. Can not get library from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${DOWNLOAD_RC} |
|
|
|
echo ${DOWNLOAD_RC} |
|
|
|
else |
|
|
|
else |
|
|
|
echo -e "\nINFO: $1 library downloaded" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nINFO: $1 library downloaded" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
@ -2186,7 +2178,7 @@ download_custom_library_source() { |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ ${DOWNLOAD_RC} -ne 0 ]; then |
|
|
|
if [ ${DOWNLOAD_RC} -ne 0 ]; then |
|
|
|
echo -e "INFO: Downloading custom library ${LIB_NAME} failed. Can not get library from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "ERROR: Downloading custom library ${LIB_NAME} failed. Can not get library from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo ${DOWNLOAD_RC} |
|
|
|
echo ${DOWNLOAD_RC} |
|
|
|
else |
|
|
|
else |
|
|
|
echo -e "\nINFO: ${LIB_NAME} custom library downloaded" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nINFO: ${LIB_NAME} custom library downloaded" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
@ -2222,8 +2214,7 @@ download_gnu_config() { |
|
|
|
DOWNLOAD_RC=$(clone_git_repository_with_tag "${SOURCE_REPO_URL}" "${SOURCE_ID}" "${LIB_LOCAL_PATH}") |
|
|
|
DOWNLOAD_RC=$(clone_git_repository_with_tag "${SOURCE_REPO_URL}" "${SOURCE_ID}" "${LIB_LOCAL_PATH}") |
|
|
|
|
|
|
|
|
|
|
|
if [[ ${DOWNLOAD_RC} -ne 0 ]]; then |
|
|
|
if [[ ${DOWNLOAD_RC} -ne 0 ]]; then |
|
|
|
echo -e "INFO: Downloading gnu config failed. Can not get source from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "ERROR: Downloading gnu config failed. Can not get source from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "failed\n" |
|
|
|
|
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
else |
|
|
|
else |
|
|
|
echo -e "\nINFO: gnu config downloaded successfully\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
|
echo -e "\nINFO: gnu config downloaded successfully\n" 1>>"${BASEDIR}"/build.log 2>&1 |
|
|
@ -2423,3 +2414,8 @@ initialize_folder() { |
|
|
|
|
|
|
|
|
|
|
|
return 0 |
|
|
|
return 0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fail_operation() { |
|
|
|
|
|
|
|
echo -e "failed\n" |
|
|
|
|
|
|
|
echo -e "See build.log for the details\n" |
|
|
|
|
|
|
|
} |
|
|
|