123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- #!/bin/bash
- set -e
- tmp=$(mktemp -d)
- pwd=$(pwd)
- trap cleanup EXIT
- cleanup() {
- set +e
- [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
- }
- chromium_svn_dir=$1
- chromium_tgt_dir=${tmp}/${chromium_svn_dir}
- [ ! -d $chromium_svn_dir ] && \
- echo "No such directories: $chromium_svn_dir" && \
- [ -f ${chromium_svn_dir}.tar.xz ] && \
- echo "Found $chromium_svn_dir.tar.xz" && \
- echo "Decompressing $chromium_svn_dir.tar.xz" && \
- tar -xf ${chromium_svn_dir}.tar.xz
- mkdir -p ${chromium_tgt_dir}
- name=chromium
- version="`cat $chromium_svn_dir/chrome/VERSION | cut -f2 -d= |while read i; do echo -n $i\. ; done`" && version=$(echo $version | sed s/\.$//)
- echo "Version: $version"
- xz="`which xz 2>/dev/null`"
- if [ -z $chromium_svn_dir ]
- then
- echo "Usage: `basename $0` [SVN_SOURCE_DIR]"
- exit 1
- fi
- if [ -f $xz ]
- then
- compress=$xz
-
- compress_opts='-9'
- echo "using xz"
- else
- exit 1
- compress=$lzma
- compress_opts="-7"
- echo "using lzma"
- fi
- echo
- echo "Moving source in staging area"
- cp -ra $chromium_svn_dir ${chromium_tgt_dir}/src
- echo "Removing ffmpeg binaries/sources"
- cd $chromium_tgt_dir/src/third_party/ffmpeg/
- rm -rf binaries/ chromium/binaries/
- rm -rf doc ffpresets mt-work tools tests
- find -type f -name "*.c" | grep -v xcode_hack.c | xargs rm -f
- echo "Removing o3d plugin sources (Not yet buildable)"
- cd $chromium_tgt_dir/src/
- rm -rf o3d/
- echo "Removing unnecessary sources"
- rm -rf third_party/WebKit/WebKitTools/Scripts/webkitpy/layout_tests/
- rm -rf webkit/data/layout_tests/
- rm -rf src/third_party/WebKit/LayoutTests/
- rm -rf chrome/test/data/
- rm -rf third_party/icu/icudt42.dll
- rm -rf third_party/icu/mac/
- rm -rf native_client/tests/
- cd $chromium_tgt_dir/src/third_party
- echo
- echo "Recompressing and excluding svn data"
- echo " this takes a while, sorry"
- echo " Compressing with $compress"
- cd $chromium_tgt_dir/
- cd ..
- tar --exclude=\.svn -cf - ${name}-${version} | $compress ${compress_opts} > ${pwd}/${name}-${version}-vine.tar.xz
- exit
|