8 # drop bundled libs, from gentoo
11 echo "Removing bundled library $lib ..."
12 l=$(find "$lib" -mindepth 1 ! -iname '*.gyp*' -print -delete | wc -l)
14 echo >&2 "No files matched when removing bundled library $1"
19 # https://code.google.com/p/chromium/wiki/LinuxPackaging
20 # initial list from src/tools/export_tarball/export_tarball.py
21 remove_nonessential_dirs() {
24 chrome/common/extensions/docs \
26 chrome/tools/test/reference_build \
29 native_client/src/trusted/service_runtime/testdata \
30 src/chrome/test/data \
34 third_party/angle/samples/gles2_book \
35 third_party/hunspell_dictionaries \
36 third_party/hunspell/tests \
37 third_party/lighttpd \
38 third_party/sqlite/test \
40 third_party/xdg-utils/tests \
41 third_party/yasm/source/patched-yasm/modules/arch/x86/tests \
42 third_party/yasm/source/patched-yasm/modules/dbgfmts/dwarf2/tests \
43 third_party/yasm/source/patched-yasm/modules/objfmts/bin/tests \
44 third_party/yasm/source/patched-yasm/modules/objfmts/coff/tests \
45 third_party/yasm/source/patched-yasm/modules/objfmts/elf/tests \
46 third_party/yasm/source/patched-yasm/modules/objfmts/macho/tests \
47 third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests \
48 third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests \
49 third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests \
50 third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests \
51 third_party/WebKit/Source/JavaScriptCore/tests \
52 third_party/WebKit/LayoutTests \
54 webkit/data/layout_tests \
55 webkit/tools/test/reference_build \
66 # Strip tarball from some big directories not needed on the linux platform
68 # prefix with _ those that we can't remove (just yet) because of the gclient
69 # hooks (see build/all.gyp) or of some unneeded deps/includes
73 chrome/test/data/safe_browsing/old \
74 chrome/test/data/firefox2_nss_mac \
75 chrome/third_party/wtl/ \
82 third_party/ffmpeg/binaries \
83 third_party/fuzzymatch \
84 third_party/gles_book_examples \
85 third_party/hunspell/dictionaries \
88 third_party/lighttpd \
93 third_party/pyftpdlib \
94 third_party/simplejson \
96 _third_party/tcmalloc \
101 tools/wine_valgrind \
103 webkit/data/layout_tests \
109 # parts based on ubuntu debian/rules
110 # http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules
120 \) -exec rm -fv {} \;
123 # removes dir, if the bcond is not turned off
124 strip_system_dirs() {
128 bcond=$(eval echo \$$lib)
129 [ "$bcond" = 0 ] && continue
131 # skip already removed dirs
132 test -d $dir || continue
134 # here we ignore errors, as some dirs contain README.chromium after removal
135 find $dir -depth -mindepth 1 \! \( -name \*.gyp -o -name \*.gypi -o -name README.chromium -o -name \*.patch \) -print -delete || :
139 # There are directories we want to strip, but that are unnecessarily required by the build-system
140 # So we drop everything but the gyp/gypi files and README.chromium (to see what that dir contained)
141 almost_strip_dirs() {
144 echo >&2 "almost strip dir: $dir"
145 find $dir -depth -mindepth 1 \! \( -name \*.gyp -o -name \*.gypi -o -name README.chromium \) -print -delete || :
149 remove_nonessential_dirs | tee -a REMOVED-nonessential_dirs.txt
150 remove_bin_only | tee -a REMOVED-bin_only.txt
152 strip_dirs | tee -a REMOVED-stripped.txt
156 third_party/gles2_book \
157 | tee -a REMOVED-stripped.txt
162 third_party/libevent \
163 third_party/libjpeg \
166 third_party/libxslt \
168 third_party/libwebp \
170 | tee -a REMOVED-stripped.txt
172 # third_party/libvpx/libvpx.h should be kept
173 #gyp_clean third_party/libvpx
174 # 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.
175 #gyp_clean third_party/yasm
177 rm -vf third_party/expat/files/lib/expat.h
179 if [ "$v8" = 1 ]; then
180 # The implementation files include v8 headers with full path,
181 # like #include "v8/include/v8.h". Make sure the system headers
184 ln -s /usr/include v8/include
187 if [ "$nacl" = 1 ]; then
188 # NOTE: here is always x86_64
189 rm -rf native_client/toolchain/linux_x86_newlib
190 ln -s /usr/x86_64-nacl-newlib native_client/toolchain/linux_x86_newlib