Skip to content

Commit

Permalink
devops: bundle ffmpeg license file with our archives (#5301)
Browse files Browse the repository at this point in the history
References #5278
  • Loading branch information
aslushnikov committed Feb 4, 2021
1 parent fe2c529 commit d851bce
Show file tree
Hide file tree
Showing 3 changed files with 511 additions and 5 deletions.
2 changes: 1 addition & 1 deletion browser_patches/ffmpeg/BUILD_NUMBER
@@ -1 +1 @@
1004
1005
12 changes: 8 additions & 4 deletions browser_patches/ffmpeg/build.sh
Expand Up @@ -33,8 +33,11 @@ if [[ -z "$1" ]]; then
exit 1
fi

LICENSE_FILE="COPYING.LGPLv2.1"

rm -rf ./output
mkdir -p output
cp ffmpeg-license/"${LICENSE_FILE}" output

dockerflags="";
# Use |-it| to run docker to support Ctrl-C if we run the script inside interactive terminal.
Expand All @@ -43,16 +46,17 @@ if [[ -t 0 ]]; then
dockerflags="-it"
fi


if [[ "$1" == "--mac" ]]; then
bash ./build-mac.sh
cd output && zip ffmpeg.zip ffmpeg-mac
cd output && zip ffmpeg.zip ffmpeg-mac "${LICENSE_FILE}"
elif [[ "$1" == "--linux" ]]; then
if ! command -v docker >/dev/null; then
echo "ERROR: docker is required for the script"
exit 1
fi
time docker run --init --rm -v"${PWD}":/host ${dockerflags} ubuntu:18.04 bash /host/build-linux.sh /host/output/ffmpeg-linux
cd output && zip ffmpeg.zip ffmpeg-linux
cd output && zip ffmpeg.zip ffmpeg-linux "${LICENSE_FILE}"
elif [[ "$1" == --cross-compile-win* ]]; then
if ! command -v docker >/dev/null; then
echo "ERROR: docker is required for the script"
Expand All @@ -61,10 +65,10 @@ elif [[ "$1" == --cross-compile-win* ]]; then

if [[ "$1" == "--cross-compile-win32" ]]; then
time docker run --init --rm -v"${PWD}":/host ${dockerflags} ubuntu:18.04 bash /host/crosscompile-from-linux-to-win.sh --win32 /host/output/ffmpeg-win32.exe
cd output && zip ffmpeg.zip ffmpeg-win32.exe
cd output && zip ffmpeg.zip ffmpeg-win32.exe "${LICENSE_FILE}"
elif [[ "$1" == "--cross-compile-win64" ]]; then
time docker run --init --rm -v"${PWD}":/host ${dockerflags} ubuntu:18.04 bash /host/crosscompile-from-linux-to-win.sh --win64 /host/output/ffmpeg-win64.exe
cd output && zip ffmpeg.zip ffmpeg-win64.exe
cd output && zip ffmpeg.zip ffmpeg-win64.exe "${LICENSE_FILE}"
else
echo "ERROR: unsupported platform - $1"
exit 1
Expand Down

0 comments on commit d851bce

Please sign in to comment.