source: projects/specs/branches/6/c/chromium14/pack_chromium14_source-vine.sh @ 4596

Revision 4596, 4.8 KB checked in by munepi, 13 years ago (diff)

updated chromium-13: updated source; NEW: added chromium14

  • Property svn:executable set to *
Line 
1#!/bin/bash
2#
3# forgive me for the state of this script
4
5set -e
6
7tmp=$(mktemp -d)
8pwd=$(pwd)
9
10trap cleanup EXIT
11cleanup() {
12    set +e
13    [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
14}
15
16chromium_svn_dir=$1
17chromium_tgt_dir=${tmp}/${chromium_svn_dir}
18
19[ ! -d $chromium_svn_dir ] && \
20    echo "No such directories: $chromium_svn_dir" && \
21    [ -f ${chromium_svn_dir}.tar.bz2 ] && \
22    echo "Found $chromium_svn_dir.tar.bz2" && \
23    echo "Decompressing $chromium_svn_dir.tar.bz2" && \
24    tar jxf ${chromium_svn_dir}.tar.bz2
25
26mkdir -p ${chromium_tgt_dir}
27
28name=chromium
29#version="`cat $chromium_svn_dir/src/chrome/VERSION | cut -f2 -d= |while read i; do echo -n $i\. ; done`"
30version="`cat $chromium_svn_dir/chrome/VERSION | cut -f2 -d= |while read i; do echo -n $i\. ; done`" && version=$(echo $version | sed s/\.$//)
31#revision="svn`cat $chromium_svn_dir/src/.svn/entries | grep -m1 -A1 'dir' | tr '\n\r' '-' | cut -f2 -d-`"
32
33echo "Version: $version"
34#echo "Revision: $revision"
35
36xz="`which xz 2>/dev/null`"
37lzma="`which lzma 2>/dev/null`"
38
39
40if [ -z $chromium_svn_dir ]
41then
42        echo "Usage:  `basename $0` [SVN_SOURCE_DIR]"
43        exit 1
44fi
45
46if [ -f $xz ]
47then
48        compress=$xz
49        #compress_opts='-9 -F lzma' #xz compresses MUCH faster, so why not make it compress more?  We have the RAM...
50        compress_opts='-9'
51        echo "using xz"
52else
53    exit 1
54        compress=$lzma
55        compress_opts="-7"
56        echo "using lzma"
57fi
58
59echo
60echo "Moving source in staging area"
61#cp -R $chromium_svn_dir $chromium_tgt_dir
62cp -ra $chromium_svn_dir ${chromium_tgt_dir}/src
63
64# remove big bad ffmpeg binaries.
65echo "Removing ffmpeg binaries/sources"
66cd $chromium_tgt_dir/src/third_party/ffmpeg/
67rm -rf binaries/
68rm -rf patched-ffmpeg-mt/*.c patched-ffmpeg-mt/*.h patched-ffmpeg-mt/doc patched-ffmpeg-mt/ffpresets patched-ffmpeg-mt/mt-work
69rm -rf patched-ffmpeg-mt/libavformat/*.c patched-ffmpeg-mt/libavcodec/*.c patched-ffmpeg-mt/tools patched-ffmpeg-mt/tests
70rm -rf patched-ffmpeg-mt/libavutil/*.c patched-ffmpeg-mt/libavfilter/*.c patched-ffmpeg-mt/libavdevice/*.c patched-ffmpeg-mt/libpostproc/*.c patched-ffmpeg-mt/libswscale/*.c
71echo "Removing courgette sources"
72cd $chromium_tgt_dir/src/
73rm -rf courgette/
74echo "Removing o3d plugin sources (Not yet buildable)"
75cd $chromium_tgt_dir/src/
76rm -rf o3d/
77echo "Removing unnecessary sources"
78rm -rf third_party/WebKit/WebKitTools/Scripts/webkitpy/layout_tests/
79rm -rf webkit/data/layout_tests/
80rm -rf third_party/hunspell/dictionaries/
81rm -rf src/third_party/WebKit/LayoutTests/
82rm -rf chrome/test/data/
83#rm -rf third_party/icu/icudt42.dll 
84#rm -rf third_party/icu/linux/ 
85#rm -rf third_party/icu/mac/ 
86#rm -rf third_party/icu/source/ 
87rm -rf native_client/tests/
88#rm -rf third_party/libvpx/
89#rm -rf third_party/speex/
90# Remove other directories (untested)
91cd $chromium_tgt_dir/src/third_party
92# First, just take out the sources for the items which have already been conditionalized so we're sure we're not using them.
93# We need to leave the .gyp files since this is how it finds the system libs.
94# bzip2
95rm -rf bzip2/*.c bzip2/*.h bzip2/LICENSE
96
97# libjpeg
98rm -rf libjpeg/*.c libjpeg/README*
99
100# libpng
101rm -rf libpng/*.c libpng/*.h libpng/README* libpng/LICENSE
102
103# libevent
104rm -rf libevent/*.c libevent/*.h libevent/*sh libevent/config* libevent/*.3 libevent/README libevent/compat libevent/linux libevent/mac libevent/sample libevent/test libevent/ChangeLog libevent/Makefile.* libevent/aclocal.m4 libevent/*.py libevent/mising libevent/mkinstalldirs
105
106# libxml
107rm -rf libxml/*c libxml/*.h libxml/*.in libxml/*sh libxml/*.m4 libxml/*.py libxml/*.xml libxml/missing libxml/mkinstalldirs libxml/*.1 libxml/build libxml/include libxml/linux libxml/mac libxml/win32 libxml/AUTHORS libxml/COPYING libxml/ChangeLog libxml/Copyright libxml/INSTALL libxml/NEWS libxml/README libxml/README.tests libxml/TODO* libxml/config* libxml/*.pl
108
109# libxslt
110rm -rf libxslt/build libxslt/libexslt libxslt/libxslt libxslt/linux libxslt/mac libxslt/win32 libxslt/AUTHORS libxslt/COPYING libxslt/ChangeLog libxslt/FEATURES libxslt/INSTALL libxslt/NEWS libxslt/README libxslt/TODO libxslt/*.h libxslt/*.m4 libxslt/compile libxslt/config* libxslt/depcomp libxslt/*sh libxslt/*.in libxslt/*.spec libxslt/missing
111
112# Next, nuke the whole directories for things not yet conditionalized:
113#rm -rf nss/ nspr/
114
115# expat is only built on windows
116rm -rf expat/files
117
118# Another copy of zlib? Unpossible!
119rm -rf src/third_party/WebKit/WebCore/platform/image-decoders/zlib/
120
121# #Remove v8 as that we build against the system one
122# rm -rf src/v8/include src/v8/src/
123
124
125echo
126echo "Recompressing and excluding svn data"
127echo "  this takes a while, sorry"
128echo "  Compressing with $compress"
129
130cd $chromium_tgt_dir/
131cd ..
132
133#tar --exclude=\.svn -cf - $name/ | $compress ${compress_opts} > "chromium"."$version""$revision".tar.lzma
134tar --exclude=\.svn -cf - ${name}-${version} | $compress ${compress_opts} > ${pwd}/${name}-${version}.tar.xz
135
136#rm -rf $chromium_tgt_dir
137
138exit
Note: See TracBrowser for help on using the repository browser.