Skip to content

Commit

Permalink
devops(ffmpeg): compile zlib dependency that is needed for ffmpeg (#3940
Browse files Browse the repository at this point in the history
)

This patch adds zlib compilation that is required for ffmpeg.
  • Loading branch information
aslushnikov authored Sep 21, 2020
1 parent 731560c commit 2693c16
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion browser_patches/ffmpeg/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1002
1003
3 changes: 3 additions & 0 deletions browser_patches/ffmpeg/CONFIG.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ZLIB_VERSION="v1.2.11"
ZLIB_CONFIG="--static"

LIBVPX_VERSION="v1.9.0"
LIBVPX_CONFIG="--enable-static \
--disable-shared \
Expand Down
10 changes: 10 additions & 0 deletions browser_patches/ffmpeg/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ elif ! [[ -d $(dirname "${output_path}") ]]; then
die "ERROR: folder for output path ${output_path} does not exist."
fi

function build_zlib {
cd "${HOME}"
git clone https://github.com/madler/zlib
cd zlib
git checkout "${ZLIB_VERSION}"
./configure --prefix="${PREFIX}" ${ZLIB_CONFIG}
make && make install
}

function build_libvpx {
cd "${HOME}"
git clone https://chromium.googlesource.com/webm/libvpx
Expand Down Expand Up @@ -74,6 +83,7 @@ source ./CONFIG.sh
apt-get update
apt-get install -y git make yasm pkg-config

build_zlib
build_libvpx
build_ffmpeg

Expand Down
10 changes: 10 additions & 0 deletions browser_patches/ffmpeg/build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ BUILDDIR="${PWD}/build"
PREFIX="${BUILDDIR}/osx_prefix"
OUTPUT_PATH="${PWD}/output/ffmpeg-mac"

function build_zlib {
cd "${BUILDDIR}"
git clone https://github.com/madler/zlib
cd zlib
git checkout "${ZLIB_VERSION}"
./configure --prefix="${PREFIX}" ${ZLIB_CONFIG}
make && make install
}

function build_libvpx {
cd "${BUILDDIR}"
git clone https://chromium.googlesource.com/webm/libvpx
Expand Down Expand Up @@ -79,6 +88,7 @@ set -x
rm -rf "${BUILDDIR}"
mkdir -p "${BUILDDIR}"

build_zlib
build_libvpx
build_ffmpeg

Expand Down
2 changes: 1 addition & 1 deletion browser_patches/ffmpeg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trap "cd $(pwd -P)" EXIT
cd "$(dirname $0)"

if [[ ("$1" == "-h") || ("$1" == "--help") ]]; then
echo "usage: $(basename $0) [--mac|--cross-compile-win32|--cross-compile-win64]"
echo "usage: $(basename $0) [--mac|--linux|--cross-compile-win32|--cross-compile-win64]"
echo
echo "Build ffmpeg for the given platform"
echo
Expand Down
18 changes: 18 additions & 0 deletions browser_patches/ffmpeg/crosscompile-from-linux-to-win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ elif ! [[ -d $(dirname "${output_path}") ]]; then
die "ERROR: folder for output path ${output_path} does not exist."
fi

function build_zlib {
cd "${HOME}"
git clone https://github.com/madler/zlib
cd zlib
git checkout "${ZLIB_VERSION}"
./configure --prefix="${PREFIX}" ${ZLIB_CONFIG}
make \
CC="${toolchain_prefix}gcc" \
CXX="${toolchain_prefix}g++" \
AR="${toolchain_prefix}ar" \
PREFIX="$PREFIX" \
RANLIB="${toolchain_prefix}ranlib" \
LD="${toolchain_prefix}ld" \
STRIP="${toolchain_prefix}strip"
make install
}

function build_libvpx {
cd "${HOME}"
git clone https://chromium.googlesource.com/webm/libvpx
Expand Down Expand Up @@ -109,6 +126,7 @@ source ./CONFIG.sh
apt-get update
apt-get install -y mingw-w64 git make yasm pkg-config

build_zlib
build_libvpx
build_ffmpeg

Expand Down

0 comments on commit 2693c16

Please sign in to comment.