commit
7772936e6d
@ -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 |
#!/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 |
|
||||||
|
|
||||||
# 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-errata1-avif |
AOM_VERSION=v1.0.0-errata1-avif |
||||||
AOM_HASH=4eb1e7795b9700d532af38a2d9489458a8038233 |
|
||||||
|
|
||||||
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 |
#!/usr/bin/env bash |
||||||
|
|
||||||
# Script to download Dav1d's source code |
source ${SCRIPTS_DIR}/common-functions.sh |
||||||
|
|
||||||
# Exports SOURCES_DIR_libdav1d - path where actual sources are stored |
|
||||||
|
|
||||||
DAV1D_VERSION=0.6.0 |
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 |
#!/usr/bin/env bash |
||||||
|
|
||||||
# Script to download Lame's source code |
source ${SCRIPTS_DIR}/common-functions.sh |
||||||
|
|
||||||
# Exports SOURCES_DIR_libmp3lame - path where actual sources are stored |
|
||||||
|
|
||||||
LAME_VERSION=3.100 |
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" |
||||||
|
Loading…
Reference in new issue