diff --git a/scripts/ffmpeg/build.sh b/scripts/ffmpeg/build.sh index e312a54..a8379e2 100755 --- a/scripts/ffmpeg/build.sh +++ b/scripts/ffmpeg/build.sh @@ -14,6 +14,10 @@ if [ "$FFMPEG_GPL_ENABLED" = true ] ; then EXTRA_BUILD_CONFIGURATION_FLAGS="$EXTRA_BUILD_CONFIGURATION_FLAGS --enable-gpl" fi +if [ "$FFMPEG_MBEDTLS_ENABLED" = true ] ; then +EXTRA_BUILD_CONFIGURATION_FLAGS="$EXTRA_BUILD_CONFIGURATION_FLAGS --enable-protocol=https --enable-version3" +fi + # Preparing flags for enabling requested libraries ADDITIONAL_COMPONENTS= for LIBARY_NAME in ${FFMPEG_EXTERNAL_LIBRARIES[@]} diff --git a/scripts/mbedtls/android.cmake b/scripts/mbedtls/android.cmake new file mode 100644 index 0000000..6e46fc4 --- /dev/null +++ b/scripts/mbedtls/android.cmake @@ -0,0 +1,9 @@ +# Enable NEON for all ARM processors +set(ANDROID_ARM_NEON TRUE) + +# By including this file all necessary variables that point to compiler, linker, etc. +# will be setup. Well, almost all. +# Two variables have to be set before this line though: +# ANDROID_PLATOFORM - the API level to compile against (number) +# ANDROID_ABI - the ABI of the target platform +include("$ENV{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake") \ No newline at end of file diff --git a/scripts/mbedtls/build.sh b/scripts/mbedtls/build.sh new file mode 100755 index 0000000..a0ac614 --- /dev/null +++ b/scripts/mbedtls/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +CMAKE_BUILD_DIR=mbedtls_build_${ANDROID_ABI} +# mbedtls authors park their source in a directory named mbedtls-${MBEDTLS_VERSION} +# instead of root directory +cd mbedtls-${MBEDTLS_VERSION} +rm -rf ${CMAKE_BUILD_DIR} +mkdir ${CMAKE_BUILD_DIR} +cd ${CMAKE_BUILD_DIR} + +${CMAKE_EXECUTABLE} .. \ + -DANDROID_PLATFORM=${ANDROID_PLATFORM} \ + -DANDROID_ABI=${ANDROID_ABI} \ + -DCMAKE_TOOLCHAIN_FILE=${SCRIPTS_DIR}/mbedtls/android.cmake \ + -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ + -DENABLE_TESTING=0 + +${MAKE_EXECUTABLE} -j${HOST_NPROC} +${MAKE_EXECUTABLE} install + +export FFMPEG_MBEDTLS_ENABLED=true \ No newline at end of file diff --git a/scripts/mbedtls/download.sh b/scripts/mbedtls/download.sh new file mode 100755 index 0000000..f2ca614 --- /dev/null +++ b/scripts/mbedtls/download.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +source ${SCRIPTS_DIR}/common-functions.sh + +export MBEDTLS_VERSION=2.28.0 +downloadTarArchive \ + "mbedtls" \ + "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v${MBEDTLS_VERSION}.tar.gz" \ + true \ No newline at end of file diff --git a/scripts/parse-arguments.sh b/scripts/parse-arguments.sh index f55f647..af8953d 100755 --- a/scripts/parse-arguments.sh +++ b/scripts/parse-arguments.sh @@ -12,6 +12,7 @@ SOURCE_TYPE=TAR SOURCE_VALUE=5.0.1 EXTERNAL_LIBRARIES=() FFMPEG_GPL_ENABLED=false +FFMPEG_MBEDTLS_ENABLED=false # All FREE libraries that are supported SUPPORTED_LIBRARIES_FREE=( @@ -25,6 +26,7 @@ SUPPORTED_LIBRARIES_FREE=( "libwebp" "libfreetype" "libfribidi" + "mbedtls" "libbluray" ) @@ -112,6 +114,9 @@ for argument in "$@"; do EXTERNAL_LIBRARIES+=("libx264") FFMPEG_GPL_ENABLED=true ;; + --enable-mbedtls | -mbedtls) + EXTERNAL_LIBRARIES+=("mbedtls") + ;; --enable-libbluray | -bluray) EXTERNAL_LIBRARIES+=("libbluray") ;;