source: projects/specs/trunk/c/chromium/pack_chromium_source-vine.sh @ 8884

Revision 8884, 4.4 KB checked in by Takemikaduchi, 10 years ago (diff)

t1lib: rebuild
others: new upstream release

  • 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.xz ] && \
22    echo "Found $chromium_svn_dir.tar.xz" && \
23    echo "Decompressing $chromium_svn_dir.tar.xz" && \
24    tar -xf ${chromium_svn_dir}.tar.xz
25
26mkdir -p ${chromium_tgt_dir}
27
28name=chromium
29#version="`cat $chromium_svn_dir/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`"
37#xz="`which pxz 2>/dev/null`"
38#lzma="`which lzma 2>/dev/null`"
39
40
41if [ -z $chromium_svn_dir ]
42then
43        echo "Usage:  `basename $0` [SVN_SOURCE_DIR]"
44        exit 1
45fi
46
47if [ -f $xz ]
48then
49        compress=$xz
50        #compress_opts='-9 -F lzma' #xz compresses MUCH faster, so why not make it compress more?  We have the RAM...
51        compress_opts='-9'
52        echo "using xz"
53else
54    exit 1
55        compress=$lzma
56        compress_opts="-7"
57        echo "using lzma"
58fi
59
60echo
61echo "Moving source in staging area"
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/ chromium/binaries/
68rm -rf doc ffpresets mt-work tools tests
69find -type f -name "*.c" | grep -v xcode_hack.c | xargs rm -f
70#echo "Removing courgette sources"
71#cd $chromium_tgt_dir/src/
72#rm -rf courgette/
73echo "Removing o3d plugin sources (Not yet buildable)"
74cd $chromium_tgt_dir/src/
75rm -rf o3d/
76echo "Removing unnecessary sources"
77rm -rf third_party/WebKit/WebKitTools/Scripts/webkitpy/layout_tests/
78rm -rf webkit/data/layout_tests/
79#rm -rf third_party/hunspell/dictionaries/
80rm -rf src/third_party/WebKit/LayoutTests/
81rm -rf chrome/test/data/
82rm -rf third_party/icu/icudt42.dll 
83#rm -rf third_party/icu/linux/ 
84rm -rf third_party/icu/mac/ 
85#rm -rf third_party/icu/source/
86rm -rf native_client/tests/
87#rm -rf third_party/libvpx/
88#rm -rf third_party/speex/
89# Remove other directories (untested)
90cd $chromium_tgt_dir/src/third_party
91# First, just take out the sources for the items which have already been conditionalized so we're sure we're not using them.
92# We need to leave the .gyp files since this is how it finds the system libs.
93# bzip2
94#rm -rf bzip2/*.c bzip2/*.h bzip2/LICENSE
95
96# libjpeg
97#rm -rf libjpeg/*.c libjpeg/README*
98
99# libpng
100#rm -rf libpng/*.c libpng/*.h libpng/README* libpng/LICENSE
101
102# libevent
103#rm -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
104
105# libxml
106#rm -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
107
108# libxslt
109#rm -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
110
111# Next, nuke the whole directories for things not yet conditionalized:
112#rm -rf nss/ nspr/
113
114# expat is only built on windows
115#rm -rf expat/files
116
117# Another copy of zlib? Unpossible!
118#rm -rf src/third_party/WebKit/WebCore/platform/image-decoders/zlib/
119
120# #Remove v8 as that we build against the system one
121# rm -rf src/v8/include src/v8/src/
122
123
124echo
125echo "Recompressing and excluding svn data"
126echo "  this takes a while, sorry"
127echo "  Compressing with $compress"
128
129cd $chromium_tgt_dir/
130cd ..
131
132tar --exclude=\.svn -cf - ${name}-${version} | $compress ${compress_opts} > ${pwd}/${name}-${version}-vine.tar.xz
133
134#rm -rf $chromium_tgt_dir
135
136exit
Note: See TracBrowser for help on using the repository browser.