6 # remove everything unless it's remove has been disabled with "0"
7 # "v8=0" means "do not remove v8"
10 # drop bundled libs, from gentoo
13 echo "Removing bundled library $lib ..."
14 l=$(find "$lib" -mindepth 1 ! -iname '*.gyp*' -print -delete | wc -l)
16 echo >&2 "No files matched when removing bundled library $1"
21 # https://code.google.com/p/chromium/wiki/LinuxPackaging
22 # initial list from src/tools/export_tarball/export_tarball.py
23 remove_nonessential_dirs() {
26 chrome/common/extensions/docs \
28 chrome/tools/test/reference_build \
31 native_client/src/trusted/service_runtime/testdata \
32 src/chrome/test/data \
36 third_party/angle/samples/gles2_book \
37 third_party/hunspell_dictionaries \
38 third_party/hunspell/tests \
39 third_party/lighttpd \
40 third_party/sqlite/test \
42 third_party/xdg-utils/tests \
43 third_party/yasm/source/patched-yasm/modules/arch/x86/tests \
44 third_party/yasm/source/patched-yasm/modules/dbgfmts/dwarf2/tests \
45 third_party/yasm/source/patched-yasm/modules/objfmts/bin/tests \
46 third_party/yasm/source/patched-yasm/modules/objfmts/coff/tests \
47 third_party/yasm/source/patched-yasm/modules/objfmts/elf/tests \
48 third_party/yasm/source/patched-yasm/modules/objfmts/macho/tests \
49 third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests \
50 third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests \
51 third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests \
52 third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests \
53 third_party/WebKit/Source/JavaScriptCore/tests \
54 third_party/WebKit/LayoutTests \
56 webkit/data/layout_tests \
57 webkit/tools/test/reference_build \
68 # Strip tarball from some big directories not needed on the linux platform
70 # prefix with _ those that we can't remove (just yet) because of the gclient
71 # hooks (see build/all.gyp) or of some unneeded deps/includes
75 chrome/test/data/safe_browsing/old \
76 chrome/test/data/firefox2_nss_mac \
77 chrome/third_party/wtl/ \
84 third_party/ffmpeg/binaries \
85 third_party/fuzzymatch \
86 third_party/gles_book_examples \
87 third_party/hunspell/dictionaries \
90 third_party/lighttpd \
95 third_party/pyftpdlib \
96 third_party/simplejson \
98 _third_party/tcmalloc \
103 tools/wine_valgrind \
105 webkit/data/layout_tests \
111 # parts based on ubuntu debian/rules
112 # http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules
122 \) -exec rm -fv {} \;
125 # removes dir, if the bcond is not turned off
126 strip_system_dirs() {
130 bcond=$(eval echo \$$lib)
131 [ "${bcond:-1}" = 0 ] && continue
133 # skip already removed dirs
134 test -d $dir || continue
136 # here we ignore errors, as some dirs contain README.chromium after removal
137 find $dir -depth -mindepth 1 \! \( -name \*.gyp -o -name \*.gypi -o -name README.chromium -o -name \*.patch \) -print -delete || :
141 # There are directories we want to strip, but that are unnecessarily required by the build-system
142 # So we drop everything but the gyp/gypi files and README.chromium (to see what that dir contained)
143 almost_strip_dirs() {
146 find $dir -depth -mindepth 1 \! \( -name \*.gyp -o -name \*.gypi -o -name README.chromium \) -print -delete || :
150 remove_nonessential_dirs | tee -a REMOVED-nonessential_dirs.txt
151 remove_bin_only | tee -a REMOVED-bin_only.txt
153 strip_dirs | tee -a REMOVED-stripped.txt
157 third_party/gles2_book \
158 | tee -a REMOVED-stripped.txt
163 third_party/libevent \
164 third_party/libjpeg \
167 third_party/libxslt \
169 third_party/libwebp \
171 | tee -a REMOVED-stripped.txt
173 # third_party/libvpx/libvpx.h should be kept
174 #gyp_clean third_party/libvpx
175 # third_party/yasm/source/patched-yasm/modules/arch/x86/gen_x86_insn.py', needed by `out/Release/obj/gen/third_party/yasm/x86insns.c'. Stop.
176 #gyp_clean third_party/yasm
178 rm -vf third_party/expat/files/lib/expat.h
180 if [ "${v8:-1}" != "0" ]; then
181 # The implementation files include v8 headers with full path,
182 # like #include "v8/include/v8.h". Make sure the system headers
185 ln -s /usr/include v8/include
188 if [ "${nacl:-1}" != "0" ]; then
189 # NOTE: here is always x86_64
190 rm -rf native_client/toolchain/linux_x86_newlib
191 ln -s /usr/x86_64-nacl-newlib native_client/toolchain/linux_x86_newlib