# Conflicts: # .travis.yml # scripts/ffmpeg/build.shmedia-file
commit
c4812d93b1
@ -0,0 +1,33 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
# Function that downloads an archive with the source code by the given url, |
||||
# extracts its files and exports a variable SOURCES_DIR_${LIBRARY_NAME} |
||||
function downloadTarArchive() { |
||||
# The full name of the library |
||||
LIBRARY_NAME=$1 |
||||
# The url of the source code archive |
||||
DOWNLOAD_URL=$2 |
||||
# Optional. If 'true' then the function creates an extra directory for archive extraction. |
||||
NEED_EXTRA_DIRECTORY=$3 |
||||
|
||||
ARCHIVE_NAME=${DOWNLOAD_URL##*/} |
||||
# File name without extension |
||||
LIBRARY_SOURCES="${ARCHIVE_NAME%.tar.*}" |
||||
|
||||
echo "Ensuring sources of ${LIBRARY_NAME} in ${LIBRARY_SOURCES}" |
||||
|
||||
if [[ ! -d "$LIBRARY_SOURCES" ]]; then |
||||
curl -O ${DOWNLOAD_URL} |
||||
|
||||
EXTRACTION_DIR="." |
||||
if [ "$NEED_EXTRA_DIRECTORY" = true ] ; then |
||||
EXTRACTION_DIR=${LIBRARY_SOURCES} |
||||
mkdir ${EXTRACTION_DIR} |
||||
fi |
||||
|
||||
tar xf ${ARCHIVE_NAME} -C ${EXTRACTION_DIR} |
||||
rm ${ARCHIVE_NAME} |
||||
fi |
||||
|
||||
export SOURCES_DIR_${LIBRARY_NAME}=$(pwd)/${LIBRARY_SOURCES} |
||||
} |
@ -1,24 +1,10 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
# Script to download AV1 Codec Library's source code |
||||
source ${SCRIPTS_DIR}/common-functions.sh |
||||
|
||||
# Exports SOURCES_DIR_libaom - path where actual sources are stored |
||||
AOM_VERSION=v1.0.0-errata1-avif |
||||
|
||||
# This 2 variables have to be changed at once. |
||||
# The first one is produced by 'git describe' command while being in the commit represented by the second one. |
||||
AOM_VERSION=v1.0.0-2780-ge1ec46ae2 |
||||
AOM_HASH=e1ec46ae24bb406057c3c256e69cd359b342a8d3 |
||||
|
||||
echo "Using libaom $AOM_VERSION" |
||||
AOM_SOURCES=libaom-${AOM_VERSION} |
||||
|
||||
if [[ ! -d "$AOM_SOURCES" ]]; then |
||||
TARGET_FILE_NAME=${AOM_VERSION}.tar.gz |
||||
|
||||
curl https://aomedia.googlesource.com/aom/+archive/${AOM_HASH}.tar.gz --output ${TARGET_FILE_NAME} |
||||
mkdir $AOM_SOURCES |
||||
tar xf ${TARGET_FILE_NAME} -C $AOM_SOURCES |
||||
rm ${TARGET_FILE_NAME} |
||||
fi |
||||
|
||||
export SOURCES_DIR_libaom=$(pwd)/${AOM_SOURCES} |
||||
downloadTarArchive \ |
||||
"libaom" \ |
||||
"https://aomedia.googlesource.com/aom/+archive/${AOM_VERSION}.tar.gz" \ |
||||
true |
||||
|
@ -1,19 +1,9 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
# Script to download Dav1d's source code |
||||
|
||||
# Exports SOURCES_DIR_libdav1d - path where actual sources are stored |
||||
source ${SCRIPTS_DIR}/common-functions.sh |
||||
|
||||
DAV1D_VERSION=0.6.0 |
||||
echo "Using libdav1d $DAV1D_VERSION" |
||||
DAV1D_SOURCES=dav1d-${DAV1D_VERSION} |
||||
|
||||
if [[ ! -d "$DAV1D_SOURCES" ]]; then |
||||
TARGET_FILE_NAME=dav1d-${DAV1D_VERSION}.tar.gz |
||||
|
||||
curl https://code.videolan.org/videolan/dav1d/-/archive/${DAV1D_VERSION}/dav1d-${DAV1D_VERSION}.tar.gz --output ${TARGET_FILE_NAME} |
||||
tar xf ${TARGET_FILE_NAME} -C . |
||||
rm ${TARGET_FILE_NAME} |
||||
fi |
||||
|
||||
export SOURCES_DIR_libdav1d=$(pwd)/${DAV1D_SOURCES} |
||||
downloadTarArchive \ |
||||
"libdav1d" \ |
||||
"https://code.videolan.org/videolan/dav1d/-/archive/${DAV1D_VERSION}/dav1d-${DAV1D_VERSION}.tar.gz" |
||||
|
@ -1,19 +1,9 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
# Script to download Lame's source code |
||||
|
||||
# Exports SOURCES_DIR_libmp3lame - path where actual sources are stored |
||||
source ${SCRIPTS_DIR}/common-functions.sh |
||||
|
||||
LAME_VERSION=3.100 |
||||
echo "Using libmp3lame $LAME_VERSION" |
||||
LAME_SOURCES=lame-${LAME_VERSION} |
||||
|
||||
if [[ ! -d "$LAME_SOURCES" ]]; then |
||||
TARGET_FILE_NAME=lame-${LAME_VERSION}.tar.gz |
||||
|
||||
curl http://downloads.videolan.org/pub/contrib/lame/${TARGET_FILE_NAME} --output ${TARGET_FILE_NAME} |
||||
tar xf ${TARGET_FILE_NAME} -C . |
||||
rm ${TARGET_FILE_NAME} |
||||
fi |
||||
|
||||
export SOURCES_DIR_libmp3lame=$(pwd)/${LAME_SOURCES} |
||||
downloadTarArchive \ |
||||
"libmp3lame" \ |
||||
"http://downloads.videolan.org/pub/contrib/lame/lame-${LAME_VERSION}.tar.gz" |
||||
|
@ -0,0 +1,26 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
./configure \ |
||||
--prefix=${INSTALL_DIR} \ |
||||
--host=${TARGET} \ |
||||
--disable-shared \ |
||||
--enable-static \ |
||||
--disable-fast-install \ |
||||
--with-pic \ |
||||
--with-sysroot=${SYSROOT_PATH} \ |
||||
--enable-asm \ |
||||
--enable-check-asm \ |
||||
--disable-rtcd \ |
||||
--disable-doc \ |
||||
--disable-extra-programs \ |
||||
CC=${FAM_CC} \ |
||||
CCLD=${FAM_LD} \ |
||||
CCAS=${FAM_AS} \ |
||||
RANLIB=${FAM_RANLIB} \ |
||||
AR=${FAM_AR} |
||||
|
||||
export FFMPEG_EXTRA_LD_FLAGS="${FFMPEG_EXTRA_LD_FLAGS} -lm" |
||||
|
||||
${MAKE_EXECUTABLE} clean |
||||
${MAKE_EXECUTABLE} -j${HOST_NPROC} |
||||
${MAKE_EXECUTABLE} install |
@ -0,0 +1,9 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
source ${SCRIPTS_DIR}/common-functions.sh |
||||
|
||||
OPUS_VERSION=1.3.1 |
||||
|
||||
downloadTarArchive \ |
||||
"libopus" \ |
||||
"https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz" |
@ -0,0 +1,24 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
ADDITIONAL_FLAGS= |
||||
if [[ $ANDROID_ABI = "x86" ]] || [[ $ANDROID_ABI = "x86_64" ]]; then |
||||
ADDITIONAL_FLAGS=--enable-sse |
||||
fi |
||||
|
||||
./configure \ |
||||
--prefix=${INSTALL_DIR} \ |
||||
--host=${TARGET} \ |
||||
--with-sysroot=${SYSROOT_PATH} \ |
||||
--disable-shared \ |
||||
--enable-static \ |
||||
--with-pic \ |
||||
CC=${FAM_CC} \ |
||||
AR=${FAM_AR} \ |
||||
RANLIB=${FAM_RANLIB} \ |
||||
${ADDITIONAL_FLAGS} || exit 1 |
||||
|
||||
export FFMPEG_EXTRA_LD_FLAGS="${FFMPEG_EXTRA_LD_FLAGS} -lm" |
||||
|
||||
${MAKE_EXECUTABLE} clean |
||||
${MAKE_EXECUTABLE} -j${HOST_NPROC} |
||||
${MAKE_EXECUTABLE} install |
@ -0,0 +1,9 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
source ${SCRIPTS_DIR}/common-functions.sh |
||||
|
||||
SPEEX_VERSION=1.2.0 |
||||
|
||||
downloadTarArchive \ |
||||
"libspeex" \ |
||||
"https://ftp.osuosl.org/pub/xiph/releases/speex/speex-${SPEEX_VERSION}.tar.gz" |
@ -0,0 +1,21 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
# TODO Consider adding a dependency - libsndfile |
||||
|
||||
./configure \ |
||||
--prefix=${INSTALL_DIR} \ |
||||
--host=${TARGET} \ |
||||
--with-sysroot=${SYSROOT_PATH} \ |
||||
--disable-shared \ |
||||
--enable-static \ |
||||
--with-pic \ |
||||
--disable-sndfile \ |
||||
CC=${FAM_CC} \ |
||||
AR=${FAM_AR} \ |
||||
RANLIB=${FAM_RANLIB} || exit 1 |
||||
|
||||
export FFMPEG_EXTRA_LD_FLAGS="${FFMPEG_EXTRA_LD_FLAGS} -lm" |
||||
|
||||
${MAKE_EXECUTABLE} clean |
||||
${MAKE_EXECUTABLE} -j${HOST_NPROC} |
||||
${MAKE_EXECUTABLE} install |
@ -0,0 +1,9 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
source ${SCRIPTS_DIR}/common-functions.sh |
||||
|
||||
TWOLAME_VERSION=0.4.0 |
||||
|
||||
downloadTarArchive \ |
||||
"libtwolame" \ |
||||
"https://netix.dl.sourceforge.net/project/twolame/twolame/${TWOLAME_VERSION}/twolame-${TWOLAME_VERSION}.tar.gz" |
@ -0,0 +1,29 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
# The Wavpack may reqire libiconv for proper work |
||||
# Consider building it and passing via --with-iconv |
||||
|
||||
if [[ $ANDROID_ABI = "arm64-v8a" ]]; then |
||||
ADDITIONAL_FLAGS=--disable-asm |
||||
fi |
||||
|
||||
./configure \ |
||||
--prefix=${INSTALL_DIR} \ |
||||
--host=${TARGET} \ |
||||
--with-sysroot=${SYSROOT_PATH} \ |
||||
--disable-shared \ |
||||
--enable-static \ |
||||
--with-pic \ |
||||
--disable-apps \ |
||||
--disable-tests \ |
||||
--disable-man \ |
||||
CC=${FAM_CC} \ |
||||
AR=${FAM_AR} \ |
||||
RANLIB=${FAM_RANLIB} \ |
||||
${ADDITIONAL_FLAGS} || exit 1 |
||||
|
||||
export FFMPEG_EXTRA_LD_FLAGS="${FFMPEG_EXTRA_LD_FLAGS} -lm" |
||||
|
||||
${MAKE_EXECUTABLE} clean |
||||
${MAKE_EXECUTABLE} -j${HOST_NPROC} |
||||
${MAKE_EXECUTABLE} install |
@ -0,0 +1,9 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
source ${SCRIPTS_DIR}/common-functions.sh |
||||
|
||||
WAVPACK_VERSION=5.3.0 |
||||
|
||||
downloadTarArchive \ |
||||
"libwavpack" \ |
||||
"http://www.wavpack.com/wavpack-${WAVPACK_VERSION}.tar.bz2" |
@ -0,0 +1,70 @@ |
||||
FROM ubuntu:20.04 |
||||
|
||||
# Arguments that can be overridden in 'docker build' command: |
||||
# Versions of Android SDK and NDK. The CMake is installed via NDK. |
||||
ARG VERSION_SDK=6200805 |
||||
ARG VERSION_NDK=21.0.6113669 |
||||
ARG VERSION_CMAKE=3.10.2.4988404 |
||||
|
||||
# Packages to install via apt-get |
||||
ARG VERSION_PYTHON3=3.8.2-0ubuntu2 |
||||
ARG VERSION_PYTHON3_PIP=20.0.2-5ubuntu1 |
||||
ARG VERSION_PYTHON3_SETUPTOOLS=45.2.0-1 |
||||
ARG VERSION_PYTHON3_WHEEL=0.34.2-1 |
||||
ARG VERSION_NINJA_BUILD=1.10.0-1build1 |
||||
ARG VERSION_BUILD_ESSENTIAL=12.8ubuntu1 |
||||
ARG VERSION_OPENJDK_8_JDK_HEADLESS=8u252-b09-1ubuntu1 |
||||
ARG VERSION_CURL=7.68.0-1ubuntu2 |
||||
ARG VERSION_UNZIP=6.0-25ubuntu1 |
||||
ARG VERSION_BASH=5.0-6ubuntu1 |
||||
ARG VERSION_NASM=2.14.02-1 |
||||
ARG VERSION_PKG_CONFIG=0.29.1-0ubuntu4 |
||||
ARG VERSION_MAKE=4.2.1-1.2 |
||||
|
||||
# Package to install via pip3 |
||||
ARG VERSION_MESON=0.53.2 |
||||
|
||||
# The HOME variable isn't available for ENV directive (during building an image). |
||||
# So we define one manually. For alpine and ubuntu it should be '/root' |
||||
ARG HOME_TWIN=/root |
||||
|
||||
# Creating mandatory environment variables |
||||
ENV ANDROID_SDK_HOME=${HOME_TWIN}/android-sdk |
||||
ENV ANDROID_NDK_HOME=${ANDROID_SDK_HOME}/ndk/${VERSION_NDK} |
||||
|
||||
# Installing basic software |
||||
RUN apt-get update && apt-get install -y --no-install-recommends \ |
||||
python3=$VERSION_PYTHON3 \ |
||||
python3-pip=$VERSION_PYTHON3_PIP \ |
||||
python3-setuptools=$VERSION_PYTHON3_SETUPTOOLS \ |
||||
python3-wheel=$VERSION_PYTHON3_WHEEL \ |
||||
ninja-build=$VERSION_NINJA_BUILD \ |
||||
build-essential=$VERSION_BUILD_ESSENTIAL \ |
||||
openjdk-8-jdk-headless=$VERSION_OPENJDK_8_JDK_HEADLESS \ |
||||
curl=$VERSION_CURL \ |
||||
unzip=$VERSION_UNZIP \ |
||||
bash=$VERSION_BASH \ |
||||
nasm=$VERSION_NASM \ |
||||
pkg-config=$VERSION_PKG_CONFIG \ |
||||
make=$VERSION_MAKE \ |
||||
&& apt-get clean \ |
||||
&& rm -rf /var/lib/apt/lists/* |
||||
|
||||
# Meson has to be installed in a different way |
||||
RUN pip3 install meson==$VERSION_MESON |
||||
|
||||
# Download the Android SDK |
||||
RUN curl https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_SDK}_latest.zip --output ${HOME_TWIN}/android-sdk.zip |
||||
# Unzip it and remove the archive |
||||
RUN mkdir -p ${HOME_TWIN}/android-sdk && \ |
||||
unzip -qq ${HOME_TWIN}/android-sdk.zip -d ${HOME_TWIN}/android-sdk && \ |
||||
rm ${HOME_TWIN}/android-sdk.zip |
||||
|
||||
# Installing components through the Android SDK |
||||
RUN installAndroidComponent() { yes | ${ANDROID_SDK_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_HOME} "$1" > /dev/null; } && \ |
||||
installAndroidComponent "ndk;${VERSION_NDK}" && \ |
||||
installAndroidComponent "cmake;${VERSION_CMAKE}" |
||||
|
||||
# The command to be executed when a container is running |
||||
# Passing additional arguments to the script is done via FAM_ARGS environment variable |
||||
CMD cd /mnt/ffmpeg-android-maker && ./ffmpeg-android-maker.sh ${FAM_ARGS} |
Loading…
Reference in new issue