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 breakpad/src/client/mac/tests \
57 breakpad/src/client/windows/tests \
58 breakpad/src/common/linux/tests \
59 breakpad/src/common/tests \
60 chrome/browser/resources/tracing/tests \
61 chrome/browser/ui/tests \
62 content/test/data/layout_tests/LayoutTests/http/tests \
63 content/test/data/layout_tests/LayoutTests/http/tests/websocket/tests \
64 content/test/data/layout_tests/LayoutTests/platform/chromium-win/http/tests \
65 gpu/command_buffer/tests \
67 native_client/tools/tests \
68 native_client_sdk/src/build_tools/tests \
69 ppapi/native_client/tests \
72 seccompsandbox/tests \
73 third_party/WebKit/Source/JavaScriptCore/API/tests \
74 third_party/WebKit/Source/JavaScriptCore/qt/tests \
75 third_party/WebKit/Source/WebKit/chromium/tests \
76 third_party/WebKit/Source/WebKit/gtk/tests \
77 third_party/WebKit/Source/WebKit/qt/tests \
78 third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/tests \
79 third_party/WebKit/Source/WebKit2/UIProcess/API/qt/tests \
80 third_party/angle/tests \
81 third_party/ffmpeg/tests \
82 third_party/harfbuzz/tests \
83 third_party/hyphen/tests \
84 third_party/mesa/MesaLib/src/gallium/tests \
85 third_party/mesa/MesaLib/src/gallium/tests/python/tests \
86 third_party/tcmalloc/chromium/src/tests \
87 third_party/tcmalloc/vendor/src/tests \
88 third_party/yasm/source/patched-yasm/libyasm/tests \
89 third_party/yasm/source/patched-yasm/modules/arch/lc3b/tests \
90 third_party/yasm/source/patched-yasm/modules/dbgfmts/stabs/tests \
91 third_party/yasm/source/patched-yasm/modules/parsers/gas/tests \
92 third_party/yasm/source/patched-yasm/modules/parsers/nasm/tests \
93 third_party/yasm/source/patched-yasm/modules/parsers/tasm/tests \
94 third_party/yasm/source/patched-yasm/modules/preprocs/nasm/tests \
95 third_party/yasm/source/patched-yasm/modules/preprocs/raw/tests \
96 third_party/yasm/source/patched-yasm/tools/python-yasm/tests \
97 tools/clang/plugins/tests \
98 tools/page_cycler/webpagereplay/tests \
99 tools/perf_expectations/tests \
102 webkit/data/layout_tests \
103 webkit/tools/test/reference_build \
114 # Strip tarball from some big directories not needed on the linux platform
116 # prefix with _ those that we can't remove (just yet) because of the gclient
117 # hooks (see build/all.gyp) or of some unneeded deps/includes
121 chrome/test/data/safe_browsing/old \
122 chrome/test/data/firefox2_nss_mac \
123 chrome/third_party/wtl/ \
129 third_party/bspatch \
130 third_party/ffmpeg/binaries \
131 third_party/fuzzymatch \
132 third_party/gles_book_examples \
133 third_party/hunspell/dictionaries \
134 third_party/icu/mac \
136 third_party/lighttpd \
140 third_party/pthread \
141 third_party/pyftpdlib \
142 third_party/simplejson \
144 _third_party/tcmalloc \
149 tools/wine_valgrind \
151 webkit/data/layout_tests \
157 # parts based on ubuntu debian/rules
158 # http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules
168 \) -exec rm -fv {} \;
171 # removes dir, if the bcond is not turned off
172 strip_system_dirs() {
176 bcond=$(eval echo \$$lib)
177 [ "${bcond:-1}" = 0 ] && continue
179 # skip already removed dirs
180 test -d $dir || continue
182 # here we ignore errors, as some dirs contain README.chromium after removal
183 find $dir -depth -mindepth 1 \! \( -name \*.gyp -o -name \*.gypi -o -name README.chromium -o -name \*.patch \) -print -delete || :
187 # There are directories we want to strip, but that are unnecessarily required by the build-system
188 # So we drop everything but the gyp/gypi files and README.chromium (to see what that dir contained)
189 almost_strip_dirs() {
192 find $dir -depth -mindepth 1 \! \( -name \*.gyp -o -name \*.gypi -o -name README.chromium \) -print -delete || :
196 remove_nonessential_dirs | tee -a REMOVED-nonessential_dirs.txt
197 remove_bin_only | tee -a REMOVED-bin_only.txt
199 strip_dirs | tee -a REMOVED-stripped.txt
203 third_party/gles2_book \
204 | tee -a REMOVED-stripped.txt
209 third_party/libevent \
210 third_party/libjpeg \
212 _third_party/libxml \
213 third_party/libxslt \
215 third_party/libwebp \
217 | tee -a REMOVED-stripped.txt
219 # third_party/libvpx/libvpx.h should be kept
220 #gyp_clean third_party/libvpx
221 # 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.
222 #gyp_clean third_party/yasm
224 rm -vf third_party/expat/files/lib/expat.h
226 if [ "${v8:-1}" != "0" ]; then
227 # The implementation files include v8 headers with full path,
228 # like #include "v8/include/v8.h". Make sure the system headers
231 ln -s /usr/include v8/include
234 if [ "${nacl:-1}" != "0" ]; then
235 # NOTE: here is always x86_64
236 rm -rf native_client/toolchain/linux_x86_newlib