media/mp4parse-rust/update-rust.sh
author Ralph Giles <giles@mozilla.com>
Tue, 13 Feb 2018 15:54:01 -0800
changeset 403880 a1104f76eb2222ef3884898967cdea0f60044059
parent 398178 856a6df2766c7e70483cd8580a6d2e0551ead4db
child 409535 959eb9adc89add6d13faa9c7431e2eee31c0213a
permissions -rwxr-xr-x
Bug 1437351 - Update mp4parse import script for v0.10.0. r=kinetik Port our build patch and request the v0.10.0 tag by default. MozReview-Commit-ID: 6TSCsgtZ8UT

#!/bin/sh -e
# Script to update mp4parse-rust sources to latest upstream

# Default version.
VER="v0.10.0"

# Accept version or commit from the command line.
if test -n "$1"; then
  VER=$1
fi

echo "Fetching sources..."
rm -rf _upstream
git clone https://github.com/mozilla/mp4parse-rust _upstream/mp4parse
git clone https://github.com/alfredoyang/mp4parse_fallible _upstream/mp4parse_fallible
pushd _upstream/mp4parse
git checkout ${VER}
echo "Verifying sources..."
cargo test
popd
rm -rf mp4parse
mkdir -p mp4parse/src
cp _upstream/mp4parse/mp4parse/Cargo.toml mp4parse/
cp _upstream/mp4parse/mp4parse/src/*.rs mp4parse/src/
mkdir -p mp4parse/tests
cp _upstream/mp4parse/mp4parse/tests/*.rs mp4parse/tests/
cp _upstream/mp4parse/mp4parse/tests/*.mp4 mp4parse/tests/
rm -rf mp4parse_capi
mkdir -p mp4parse_capi/src
cp _upstream/mp4parse/mp4parse_capi/Cargo.toml mp4parse_capi/
cp _upstream/mp4parse/mp4parse_capi/build.rs mp4parse_capi/
cp _upstream/mp4parse/mp4parse_capi/include/mp4parse.h ./
cp _upstream/mp4parse/mp4parse_capi/src/*.rs mp4parse_capi/src/
rm -rf mp4parse_fallible
mkdir -p mp4parse_fallible
cp _upstream/mp4parse_fallible/* mp4parse_fallible/

echo "Applying patches..."
patch -p4 < mp4parse-cargo.patch

echo "Cleaning up..."
rm -rf _upstream

echo "Updating gecko Cargo.lock..."
pushd ../../toolkit/library/rust/
cargo update --package mp4parse_capi
popd
pushd ../../toolkit/library/gtest/rust/
cargo update --package mp4parse_capi
popd

echo "Updated to ${VER}."