summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 21:47:29 +0000
committermmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 21:47:29 +0000
commit51823a97334c611dfc6ca392b2068fd3437a2478 (patch)
tree048987c300247841771dc5a0630050b02717693d
parent0ea4ccce7a665605a4ba19c2bee3e8566f8cb0ae (diff)
downloadchromium_src-51823a97334c611dfc6ca392b2068fd3437a2478.zip
chromium_src-51823a97334c611dfc6ca392b2068fd3437a2478.tar.gz
chromium_src-51823a97334c611dfc6ca392b2068fd3437a2478.tar.bz2
Rewrite ffmpeg_binaries target to use GYP built-ins and branding conditions.
BUG=16657 Review URL: http://codereview.chromium.org/149554 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20548 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xthird_party/ffmpeg/copy_binaries.sh39
-rwxr-xr-xthird_party/ffmpeg/ffmpeg.gyp84
2 files changed, 27 insertions, 96 deletions
diff --git a/third_party/ffmpeg/copy_binaries.sh b/third_party/ffmpeg/copy_binaries.sh
deleted file mode 100755
index 5c7f412..0000000
--- a/third_party/ffmpeg/copy_binaries.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-#
-# This is meant to replicate the behavior of cp, except that it will not fail
-# if the source files are not present. Something like
-# "cp ${SOURCES} ${DEST} || true" would also have worked except that
-# gyp does not allow for specifying || in the action, and the windows
-# cygwin envrionment does not include "true" making a script like this the
-# least ugly solution.
-
-SOURCES=""
-DESTINATION=""
-
-# Shift off every argument but the last and consider them the sources.
-# It would have probably been easier to put the destination first, but
-# this is not too hard and it replicates the argument ordering of cp.
-while (( "$#" != 1 )); do
- SOURCES="$SOURCES $1"
- shift
-done
-
-DESTINATION=$1
-
-# Early out if there was not enough parameters to discern a destination.
-# Also fail the command because this means we are being invoked incorrectly.
-if test -z "$DESTINATION"; then
- echo "ERROR: Destination empty."
- exit 1
-fi
-
-# Only try to copy the source file if it exists. It is not an error
-# if the input does not exist; we just silently ignore the input.
-for i in $SOURCES; do
- if test -f $i; then
- cp -v -f $i $DESTINATION
- fi
-done
-
-# Make sure we always succeed.
-exit 0
diff --git a/third_party/ffmpeg/ffmpeg.gyp b/third_party/ffmpeg/ffmpeg.gyp
index c6ad1a8..258a1ae 100755
--- a/third_party/ffmpeg/ffmpeg.gyp
+++ b/third_party/ffmpeg/ffmpeg.gyp
@@ -170,83 +170,53 @@
],
},
{
- # We prefer the Chrome binaries over the Chromium ones, which will get
- # overwritten due to the order that the binaries are copied.
'target_name': 'ffmpeg_binaries',
'type': 'none',
'msvs_guid': '4E4070E1-EFD9-4EF1-8634-3960956F6F10',
+ 'variables': {
+ 'conditions': [
+ [ 'branding=="Chrome"', {
+ 'branding_dir': 'chrome',
+ }, { # else branding!="Chrome"
+ 'branding_dir': 'chromium',
+ }],
+ ],
+ },
'conditions': [
['OS=="win"', {
'variables': {
'source_files': [
- 'binaries/chromium/avcodec-52.dll',
- 'binaries/chromium/avformat-52.dll',
- 'binaries/chromium/avutil-50.dll',
- 'binaries/chromium/pthreadGC2.dll',
- 'binaries/chrome/avcodec-52.dll',
- 'binaries/chrome/avformat-52.dll',
- 'binaries/chrome/avutil-50.dll',
- 'binaries/chrome/pthreadGC2.dll',
- ],
- 'output_files': [
- '<(PRODUCT_DIR)/avcodec-52.dll',
- '<(PRODUCT_DIR)/avformat-52.dll',
- '<(PRODUCT_DIR)/avutil-50.dll',
- '<(PRODUCT_DIR)/pthreadGC2.dll',
+ 'binaries/<(branding_dir)/avcodec-52.dll',
+ 'binaries/<(branding_dir)/avformat-52.dll',
+ 'binaries/<(branding_dir)/avutil-50.dll',
+ 'binaries/<(branding_dir)/pthreadGC2.dll',
],
},
'dependencies': ['../../build/win/system.gyp:cygwin'],
}], ['OS=="linux"', {
'variables': {
'source_files': [
- 'binaries/chromium/libavcodec.so.52',
- 'binaries/chromium/libavformat.so.52',
- 'binaries/chromium/libavutil.so.50',
- 'binaries/chrome/libavcodec.so.52',
- 'binaries/chrome/libavformat.so.52',
- 'binaries/chrome/libavutil.so.50',
- ],
- 'output_files': [
- '<(PRODUCT_DIR)/libavcodec.so.52',
- '<(PRODUCT_DIR)/libavformat.so.52',
- '<(PRODUCT_DIR)/libavutil.so.50',
+ 'binaries/<(branding_dir)/libavcodec.so.52',
+ 'binaries/<(branding_dir)/libavformat.so.52',
+ 'binaries/<(branding_dir)/libavutil.so.50',
],
},
}], ['OS=="mac"', {
- 'variables': {
- 'source_files': [
- 'binaries/chromium/libavcodec.52.dylib',
- 'binaries/chromium/libavformat.52.dylib',
- 'binaries/chromium/libavutil.50.dylib',
- 'binaries/chrome/libavcodec.52.dylib',
- 'binaries/chrome/libavformat.52.dylib',
- 'binaries/chrome/libavutil.50.dylib',
- ],
- 'output_files': [
- '<(PRODUCT_DIR)/libavcodec.52.dylib',
- '<(PRODUCT_DIR)/libavformat.52.dylib',
- '<(PRODUCT_DIR)/libavutil.50.dylib',
- ],
- },
+ 'variables': {
+ 'source_files': [
+ 'binaries/<(branding_dir)/libavcodec.52.dylib',
+ 'binaries/<(branding_dir)/libavformat.52.dylib',
+ 'binaries/<(branding_dir)/libavutil.50.dylib',
+ ],
+ },
}],
],
- 'sources': [
- ],
- 'actions': [
+ 'copies': [
{
- 'action_name': 'copy_binaries',
- 'inputs': [
- 'copy_binaries.sh',
- ],
- 'outputs': [
- '<@(output_files)',
- ],
- 'action': [
- './copy_binaries.sh',
+ 'destination': '<(PRODUCT_DIR)/',
+ 'files': [
'<@(source_files)',
- '<(PRODUCT_DIR)/'
- ],
- 'message': 'Copying FFmpeg binaries...',
+ ]
},
],
},