Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: chromium/deprecated/make_src_tree.sh

Issue 9290059: Initial commit of all previous Chrome build scripts. (Closed) Base URL: http://git.chromium.org/chromium/third_party/ffmpeg.git@master
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # This script creates a patched FFmpeg tree suitable for using to build
8 # the FFmpeg needed by chromium. It takes an |output_dir| where the
9 # final source tree will reside, and |patches_dir| containing patches
10 # to apply to the pristine source.
11 #
12 # The pristine source is contained in:
13 #
14 # ffmpeg-mt.tar.gz
15 #
16 # After unpacking these files into the |output_dir|, all files inside
17 # the directory tree at |patch_dir| matching the pattern *.patch will be
18 # applied to the output directory in lexicographic order.
19
20 set -e
21
22 if [ $# -ne 3 ]; then
23 echo "Usage: $0 <tarball> <output directory> <directory with patches>"
24 exit 1
25 fi
26
27 tarball="${1}"
28 output_dir="${2}"
29 patches_dir="${3}"
30
31 if [ ! -d "$patches_dir" ]; then
32 echo "$patches_dir is not a directory."
33 exit 1
34 fi
35
36 if [ -e "$output_dir" ]; then
37 echo "$output_dir exists. Do you want to continue? [y/N]"
38 read confirm
39 if [ "$confirm" != "y" ]; then
40 exit 1;
41 fi
42 fi
43
44 # Unpack the pristine ffmpeg sources into the target directory.
45 mkdir -p "$output_dir"
46 tar -xzf "$tarball" --strip 1 -C "$output_dir"
47
48 # Get a list of all patches in |patches_dir|. Sort them in by the filename
49 # regardless of path.
50 reverse_paths() {
51 perl -lne "print join '/', reverse split '/'"
52 }
53 patches=`find "$patches_dir" -name '*.patch' -type f |
54 reverse_paths | sort | reverse_paths`
55
56 # Apply the patches.
57 for p in $patches; do
58 echo Apply patch `basename $p` to $output_dir
59 patch -p1 -d "$output_dir" < "$p"
60 done
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698