]>
Commit | Line | Data |
---|---|---|
fe547a32 | 1 | #!/bin/sh |
8f5f6775 | 2 | set -xe |
fe547a32 | 3 | |
0593259b ER |
4 | export LC_ALL=C |
5 | ||
fe547a32 | 6 | # import options |
cd09b941 ER |
7 | # remove everything unless it's remove has been disabled with "0" |
8 | # "v8=0" means "do not remove v8" | |
fe547a32 ER |
9 | eval "$@" |
10 | ||
05d9087c | 11 | # Strip tarball from some big directories not needed on the linux platform |
f888c710 | 12 | # https://code.google.com/p/chromium/wiki/LinuxPackaging |
99f39995 | 13 | # initial list from src/tools/export_tarball/export_tarball.py |
55dddbd9 | 14 | # also removed non-linux files: find -name win -o -name mac -o name android |
9304218b | 15 | # find -type d -name 'android' -o -name 'chromeos' -o -name 'cros' |
07b01cb7 ER |
16 | # find -type d -name *doc* |
17 | ||
05d9087c ER |
18 | # suffix with _ those that we can't remove (just yet) because of the gclient |
19 | # hooks (see build/all.gyp) or of some unneeded deps/includes | |
f888c710 ER |
20 | remove_nonessential_dirs() { |
21 | local dir | |
22 | for dir in \ | |
07b01cb7 ER |
23 | native_client/documentation \ |
24 | third_party/webdriver/pylib/docs \ | |
25 | third_party/mesa/MesaLib/src/gallium/docs \ | |
26 | third_party/mesa/MesaLib/docs \ | |
27 | third_party/tcmalloc/vendor/doc \ | |
28 | third_party/leveldatabase/src/doc \ | |
29 | third_party/re2/doc \ | |
30 | third_party/WebKit/Source/WebKit/qt/docs \ | |
31 | third_party/WebKit/Source/WebKit/gtk/docs \ | |
32 | third_party/WebKit/Source/JavaScriptCore/docs \ | |
33 | third_party/ffmpeg/doc \ | |
34 | third_party/hyphen/doc \ | |
35 | third_party/sqlite/src/doc \ | |
36 | ppapi/c/documentation \ | |
37 | ppapi/cpp/documentation \ | |
38 | gpu/command_buffer/docs \ | |
39 | chrome/browser/extensions/docs \ | |
40 | \ | |
18ffc809 | 41 | android_webview \ |
07b01cb7 | 42 | third_party/mesa/MesaLib/docs \ |
9304218b ER |
43 | ash/resources/default_100_percent/cros_ \ |
44 | ash/resources/default_200_percent/cros_ \ | |
45 | ash/system/chromeos \ | |
55dddbd9 | 46 | base/android \ |
9304218b | 47 | base/chromeos \ |
55dddbd9 ER |
48 | base/mac_ \ |
49 | base/win_ \ | |
3333a973 | 50 | breakpad/src/client/mac \ |
9304218b | 51 | breakpad/src/common/android \ |
3333a973 ER |
52 | breakpad/src/common/mac \ |
53 | breakpad/src/tools/mac \ | |
9304218b | 54 | build/android \ |
3333a973 ER |
55 | build/mac \ |
56 | build/win \ | |
55dddbd9 ER |
57 | chrome/android \ |
58 | chrome/app/android \ | |
9304218b ER |
59 | chrome/app/resources/terms/chromeos \ |
60 | chrome/app/theme/default_100_percent/cros_ \ | |
3333a973 ER |
61 | chrome/app/theme/default_100_percent/mac \ |
62 | chrome/app/theme/default_100_percent/win \ | |
9304218b | 63 | chrome/app/theme/default_200_percent/cros_ \ |
3333a973 ER |
64 | chrome/app/theme/default_200_percent/mac \ |
65 | chrome/app/theme/default_200_percent/win \ | |
66 | chrome/app/theme/touch_100_percent/win \ | |
67 | chrome/app/theme/touch_140_percent/win \ | |
68 | chrome/app/theme/touch_180_percent/win \ | |
55dddbd9 | 69 | chrome/browser/android \ |
9304218b ER |
70 | chrome/browser/chromeos/cros \ |
71 | chrome/browser/chromeos_ \ | |
18ffc809 | 72 | chrome/browser/component/web_contents_delegate_android_ \ |
55dddbd9 | 73 | chrome/browser/history/android \ |
3333a973 | 74 | chrome/browser/mac \ |
18ffc809 | 75 | chrome/browser/resources/about_welcome_android \ |
9304218b | 76 | chrome/browser/resources/chromeos_ \ |
18ffc809 | 77 | chrome/browser/resources/ntp_android \ |
9304218b ER |
78 | chrome/browser/resources/options/chromeos_ \ |
79 | chrome/browser/resources/shared/css/chromeos \ | |
80 | chrome/browser/resources/shared/js/chromeos_ \ | |
9304218b | 81 | chrome/browser/ui/android \ |
9304218b ER |
82 | chrome/browser/ui/webui/chromeos \ |
83 | chrome/browser/ui/webui/ntp/android \ | |
84 | chrome/browser/ui/webui/options/chromeos \ | |
54623fc8 | 85 | chrome/common/extensions/docs \ |
3333a973 ER |
86 | chrome/common/mac \ |
87 | chrome/installer/mac \ | |
88 | chrome/installer/mac/third_party/xz/config/mac \ | |
05d9087c | 89 | chrome/third_party/wtl/ \ |
9304218b | 90 | chrome/tools/build/chromeos \ |
3333a973 ER |
91 | chrome/tools/build/mac \ |
92 | chrome/tools/build/win \ | |
54623fc8 | 93 | chrome_frame \ |
9304218b | 94 | chromeos \ |
3333a973 ER |
95 | cloud_print/service/win \ |
96 | cloud_print/virtual_driver/win \ | |
55dddbd9 ER |
97 | content/app/android \ |
98 | content/browser/android \ | |
99 | content/common/android \ | |
100 | content/common/mac_ \ | |
101 | content/public/android \ | |
102 | content/public/browser/android \ | |
103 | content/renderer/android \ | |
104 | content/shell/android \ | |
3333a973 | 105 | content/shell/mac \ |
54623fc8 | 106 | data \ |
05d9087c ER |
107 | gears \ |
108 | google_update \ | |
05d9087c | 109 | gpu/demos \ |
9304218b | 110 | media/audio/android \ |
3333a973 ER |
111 | media/audio/mac \ |
112 | media/audio/win \ | |
9304218b | 113 | media/base/android \ |
3333a973 ER |
114 | media/video/capture/mac \ |
115 | media/video/capture/win \ | |
9304218b | 116 | media/webm/chromeos \ |
3333a973 | 117 | native_client/build/mac \ |
55dddbd9 | 118 | native_client/src/include/win_ \ |
3333a973 ER |
119 | native_client/src/shared/imc/win \ |
120 | native_client/src/shared/platform/win \ | |
121 | native_client/src/trusted/debug_stub/win \ | |
122 | native_client/src/trusted/desc/win \ | |
123 | native_client/src/trusted/nonnacl_util/win \ | |
124 | native_client/src/trusted/platform_qualify/win \ | |
55dddbd9 | 125 | native_client/src/trusted/service_runtime/win_ \ |
18ffc809 | 126 | native_client/tools/trusted_cross_toolchains \ |
54623fc8 | 127 | native_client_sdk \ |
3333a973 | 128 | native_client_sdk/src/libraries/win \ |
9304218b | 129 | net/android \ |
05d9087c | 130 | o3d \ |
54623fc8 ER |
131 | o3d/documentation \ |
132 | o3d/samples \ | |
3333a973 ER |
133 | ppapi/native_client/src/trusted/plugin/win \ |
134 | remoting/host/installer/mac \ | |
e15125f5 | 135 | remoting/host/installer/win \ |
3333a973 | 136 | remoting/host/mac \ |
e15125f5 | 137 | remoting/host/setup/win \ |
3333a973 ER |
138 | remoting/host/win \ |
139 | rlz/mac \ | |
140 | rlz/win \ | |
55dddbd9 | 141 | sandbox/win_ \ |
3333a973 ER |
142 | sdch/mac \ |
143 | skia/config/win \ | |
55dddbd9 | 144 | third_party/WebKit/Source/Platform/chromium/public/android \ |
3333a973 ER |
145 | third_party/WebKit/Source/Platform/chromium/public/mac \ |
146 | third_party/WebKit/Source/Platform/chromium/public/win \ | |
147 | third_party/WebKit/Source/WTF/wtf/mac \ | |
148 | third_party/WebKit/Source/WTF/wtf/threads/win \ | |
149 | third_party/WebKit/Source/WTF/wtf/win \ | |
150 | third_party/WebKit/Source/WebCore/WebCore.gyp/mac \ | |
151 | third_party/WebKit/Source/WebCore/accessibility/mac \ | |
152 | third_party/WebKit/Source/WebCore/accessibility/win \ | |
55dddbd9 | 153 | third_party/WebKit/Source/WebCore/editing/android \ |
3333a973 | 154 | third_party/WebKit/Source/WebCore/editing/mac \ |
55dddbd9 | 155 | third_party/WebKit/Source/WebCore/history/android \ |
3333a973 ER |
156 | third_party/WebKit/Source/WebCore/history/mac \ |
157 | third_party/WebKit/Source/WebCore/loader/mac \ | |
158 | third_party/WebKit/Source/WebCore/loader/win \ | |
55dddbd9 | 159 | third_party/WebKit/Source/WebCore/page/android \ |
3333a973 ER |
160 | third_party/WebKit/Source/WebCore/page/mac \ |
161 | third_party/WebKit/Source/WebCore/page/scrolling/mac \ | |
162 | third_party/WebKit/Source/WebCore/page/win \ | |
55dddbd9 | 163 | third_party/WebKit/Source/WebCore/platform/android \ |
3333a973 ER |
164 | third_party/WebKit/Source/WebCore/platform/audio/mac \ |
165 | third_party/WebKit/Source/WebCore/platform/cf/win \ | |
166 | third_party/WebKit/Source/WebCore/platform/graphics/ca/mac \ | |
167 | third_party/WebKit/Source/WebCore/platform/graphics/ca/win \ | |
168 | third_party/WebKit/Source/WebCore/platform/graphics/gpu/mac \ | |
169 | third_party/WebKit/Source/WebCore/platform/graphics/mac \ | |
170 | third_party/WebKit/Source/WebCore/platform/graphics/surfaces/mac \ | |
e15125f5 | 171 | third_party/WebKit/Source/WebCore/platform/graphics/surfaces/win \ |
3333a973 ER |
172 | third_party/WebKit/Source/WebCore/platform/graphics/win \ |
173 | third_party/WebKit/Source/WebCore/platform/mac \ | |
55dddbd9 | 174 | third_party/WebKit/Source/WebCore/platform/network/android \ |
3333a973 ER |
175 | third_party/WebKit/Source/WebCore/platform/network/mac \ |
176 | third_party/WebKit/Source/WebCore/platform/network/win \ | |
55dddbd9 | 177 | third_party/WebKit/Source/WebCore/platform/text/android \ |
3333a973 ER |
178 | third_party/WebKit/Source/WebCore/platform/text/mac \ |
179 | third_party/WebKit/Source/WebCore/platform/text/win \ | |
180 | third_party/WebKit/Source/WebCore/platform/win \ | |
181 | third_party/WebKit/Source/WebCore/platform/wx/wxcode/mac \ | |
182 | third_party/WebKit/Source/WebCore/platform/wx/wxcode/win \ | |
183 | third_party/WebKit/Source/WebCore/plugins/mac \ | |
184 | third_party/WebKit/Source/WebCore/plugins/win \ | |
55dddbd9 ER |
185 | third_party/WebKit/Source/WebKit/chromium/public/android \ |
186 | third_party/WebKit/Source/WebKit/chromium/public/mac_ \ | |
187 | third_party/WebKit/Source/WebKit/chromium/public/platform/android \ | |
3333a973 ER |
188 | third_party/WebKit/Source/WebKit/chromium/public/platform/mac \ |
189 | third_party/WebKit/Source/WebKit/chromium/public/platform/win \ | |
190 | third_party/WebKit/Source/WebKit/chromium/public/win \ | |
55dddbd9 | 191 | third_party/WebKit/Source/WebKit/chromium/src/android \ |
3333a973 ER |
192 | third_party/WebKit/Source/WebKit/chromium/src/mac \ |
193 | third_party/WebKit/Source/WebKit/chromium/src/win \ | |
194 | third_party/WebKit/Source/WebKit/mac \ | |
195 | third_party/WebKit/Source/WebKit/win \ | |
196 | third_party/WebKit/Source/WebKit2/Platform/CoreIPC/mac \ | |
197 | third_party/WebKit/Source/WebKit2/Platform/CoreIPC/win \ | |
198 | third_party/WebKit/Source/WebKit2/Platform/mac \ | |
199 | third_party/WebKit/Source/WebKit2/Platform/win \ | |
200 | third_party/WebKit/Source/WebKit2/PluginProcess/mac \ | |
201 | third_party/WebKit/Source/WebKit2/Shared/API/c/mac \ | |
202 | third_party/WebKit/Source/WebKit2/Shared/API/c/win \ | |
203 | third_party/WebKit/Source/WebKit2/Shared/Plugins/Netscape/mac \ | |
204 | third_party/WebKit/Source/WebKit2/Shared/Plugins/Netscape/win \ | |
205 | third_party/WebKit/Source/WebKit2/Shared/Plugins/mac \ | |
206 | third_party/WebKit/Source/WebKit2/Shared/cg/win \ | |
207 | third_party/WebKit/Source/WebKit2/Shared/mac \ | |
208 | third_party/WebKit/Source/WebKit2/Shared/win \ | |
209 | third_party/WebKit/Source/WebKit2/UIProcess/API/C/mac \ | |
210 | third_party/WebKit/Source/WebKit2/UIProcess/API/C/win \ | |
211 | third_party/WebKit/Source/WebKit2/UIProcess/API/mac \ | |
212 | third_party/WebKit/Source/WebKit2/UIProcess/Launcher/mac \ | |
213 | third_party/WebKit/Source/WebKit2/UIProcess/Launcher/win \ | |
214 | third_party/WebKit/Source/WebKit2/UIProcess/Plugins/mac \ | |
215 | third_party/WebKit/Source/WebKit2/UIProcess/Plugins/win \ | |
216 | third_party/WebKit/Source/WebKit2/UIProcess/mac \ | |
217 | third_party/WebKit/Source/WebKit2/UIProcess/win \ | |
218 | third_party/WebKit/Source/WebKit2/WebProcess/Authentication/mac \ | |
219 | third_party/WebKit/Source/WebKit2/WebProcess/Cookies/mac \ | |
220 | third_party/WebKit/Source/WebKit2/WebProcess/Downloads/cf/win \ | |
221 | third_party/WebKit/Source/WebKit2/WebProcess/Downloads/mac \ | |
222 | third_party/WebKit/Source/WebKit2/WebProcess/FullScreen/mac \ | |
223 | third_party/WebKit/Source/WebKit2/WebProcess/FullScreen/win \ | |
224 | third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/API/c/win \ | |
225 | third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/mac \ | |
226 | third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/win \ | |
227 | third_party/WebKit/Source/WebKit2/WebProcess/Plugins/Netscape/mac \ | |
228 | third_party/WebKit/Source/WebKit2/WebProcess/Plugins/Netscape/win \ | |
229 | third_party/WebKit/Source/WebKit2/WebProcess/WebCoreSupport/mac \ | |
230 | third_party/WebKit/Source/WebKit2/WebProcess/WebCoreSupport/win \ | |
231 | third_party/WebKit/Source/WebKit2/WebProcess/WebPage/ca/mac \ | |
232 | third_party/WebKit/Source/WebKit2/WebProcess/WebPage/ca/win \ | |
233 | third_party/WebKit/Source/WebKit2/WebProcess/WebPage/mac \ | |
234 | third_party/WebKit/Source/WebKit2/WebProcess/WebPage/win \ | |
235 | third_party/WebKit/Source/WebKit2/WebProcess/mac \ | |
236 | third_party/WebKit/Source/WebKit2/WebProcess/win \ | |
237 | third_party/WebKit/Source/WebKit2/mac \ | |
238 | third_party/WebKit/Source/WebKit2/win \ | |
3333a973 ER |
239 | third_party/WebKit/Tools/DumpRenderTree/mac \ |
240 | third_party/WebKit/Tools/DumpRenderTree/win \ | |
54623fc8 | 241 | third_party/angle/samples/gles2_book \ |
05d9087c ER |
242 | third_party/boost \ |
243 | third_party/bsdiff \ | |
244 | third_party/bspatch \ | |
55dddbd9 | 245 | third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android \ |
55dddbd9 ER |
246 | third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android \ |
247 | third_party/cld/encodings/compact_lang_det/win_ \ | |
18ffc809 | 248 | third_party/cros_system_api_ \ |
05d9087c | 249 | third_party/ffmpeg/binaries \ |
3333a973 ER |
250 | third_party/ffmpeg/chromium/binaries/Chromium/win \ |
251 | third_party/ffmpeg/chromium/config/Chrome/mac \ | |
e15125f5 | 252 | third_party/ffmpeg/chromium/config/Chrome/win \ |
3333a973 | 253 | third_party/ffmpeg/chromium/config/Chromium/mac \ |
e15125f5 | 254 | third_party/ffmpeg/chromium/config/Chromium/win \ |
3333a973 | 255 | third_party/ffmpeg/chromium/include/win \ |
05d9087c | 256 | third_party/fuzzymatch \ |
8352ba82 | 257 | third_party/gles2_book \ |
05d9087c ER |
258 | third_party/gles_book_examples \ |
259 | third_party/gold \ | |
05d9087c | 260 | third_party/hunspell/dictionaries \ |
54623fc8 | 261 | third_party/hunspell_dictionaries \ |
55dddbd9 | 262 | third_party/icu/android \ |
05d9087c ER |
263 | third_party/icu/mac \ |
264 | third_party/lcov \ | |
3333a973 ER |
265 | third_party/leveldatabase/src/port/win \ |
266 | third_party/libjpeg_turbo/mac \ | |
267 | third_party/libjpeg_turbo/win \ | |
55dddbd9 | 268 | third_party/libva/va/android \ |
3333a973 ER |
269 | third_party/libvpx/source/config/mac \ |
270 | third_party/libvpx/source/config/win \ | |
271 | third_party/libxml/mac \ | |
54623fc8 | 272 | third_party/lighttpd \ |
9304218b | 273 | third_party/mozc/chrome/chromeos_ \ |
05d9087c ER |
274 | third_party/nspr \ |
275 | third_party/nss \ | |
276 | third_party/ocmock \ | |
55dddbd9 | 277 | third_party/openssl/config/android \ |
05d9087c ER |
278 | third_party/pthread \ |
279 | third_party/pyftpdlib \ | |
05d9087c | 280 | third_party/scons \ |
05d9087c | 281 | third_party/simplejson \ |
55dddbd9 | 282 | third_party/skia/include/utils/android \ |
3333a973 ER |
283 | third_party/skia/include/utils/mac \ |
284 | third_party/skia/include/utils/win \ | |
55dddbd9 ER |
285 | third_party/skia/include/views/android \ |
286 | third_party/skia/src/gpu/gl/android \ | |
3333a973 ER |
287 | third_party/skia/src/gpu/gl/mac \ |
288 | third_party/skia/src/gpu/gl/win \ | |
289 | third_party/skia/src/utils/mac \ | |
290 | third_party/skia/src/utils/win \ | |
291 | third_party/skia/src/views/mac \ | |
292 | third_party/skia/src/views/win \ | |
293 | third_party/snappy/mac \ | |
05d9087c | 294 | third_party/tcmalloc_ \ |
54623fc8 | 295 | third_party/vc_80 \ |
55dddbd9 | 296 | third_party/webrtc/modules/audio_device/android \ |
3333a973 ER |
297 | third_party/webrtc/modules/audio_device/main/source/mac \ |
298 | third_party/webrtc/modules/audio_device/main/source/win \ | |
e15125f5 | 299 | third_party/webrtc/modules/audio_device/win \ |
55dddbd9 | 300 | third_party/webrtc/modules/video_capture/main/source/android \ |
55dddbd9 | 301 | third_party/webrtc/modules/video_render/main/source/android \ |
3333a973 | 302 | third_party/webrtc/modules/video_render/main/source/mac \ |
55dddbd9 | 303 | third_party/webrtc/system_wrappers/source/android \ |
55dddbd9 | 304 | third_party/yasm/source/config/android \ |
3333a973 ER |
305 | third_party/yasm/source/config/mac \ |
306 | third_party/yasm/source/config/win \ | |
9304218b | 307 | tools/android \ |
3333a973 | 308 | tools/mac \ |
54623fc8 | 309 | tools/site_compare \ |
05d9087c ER |
310 | tools/stats_viewer \ |
311 | tools/symsrc \ | |
05d9087c | 312 | tools/valgrind \ |
3333a973 | 313 | tools/win \ |
05d9087c | 314 | tools/wine_valgrind \ |
9304218b | 315 | ui/android \ |
e15125f5 | 316 | ui/base/ime/win \ |
55dddbd9 | 317 | ui/base/win_ \ |
9304218b | 318 | ui/gfx/android \ |
3333a973 | 319 | ui/gfx/mac \ |
9304218b ER |
320 | ui/resources/default_100_percent/cros_ \ |
321 | ui/resources/default_200_percent/cros_ \ | |
3333a973 | 322 | ui/views/win \ |
9304218b | 323 | webkit/chromeos \ |
55dddbd9 | 324 | webkit/media/android \ |
8352ba82 | 325 | win8 \ |
f888c710 ER |
326 | ; do |
327 | rm -vfr "$dir" | |
328 | done | |
329 | } | |
330 | ||
8352ba82 ER |
331 | # There are directories we want to strip, but that are unnecessarily required by the build-system |
332 | # So we drop everything but the gyp/gypi files | |
333 | almost_strip_dirs() { | |
334 | local dir | |
335 | for dir in \ | |
bcc7de3a | 336 | breakpad \ |
8352ba82 | 337 | courgette \ |
18ffc809 | 338 | third_party/cros_dbus_cplusplus \ |
8352ba82 ER |
339 | ; do |
340 | find $dir -depth -mindepth 1 \! \( -name '*.gyp' -o -name '*.gypi' \) -print -delete || : | |
341 | done | |
bcc7de3a ER |
342 | |
343 | find tools -type f \ | |
344 | '!' -iname '*.gyp*' \ | |
345 | '!' -path 'tools/build/*' \ | |
346 | '!' -path 'tools/clang/scripts/plugin_flags.sh' \ | |
347 | '!' -path 'tools/generate_stubs/*' \ | |
348 | '!' -path 'tools/grit/*' \ | |
349 | '!' -path 'tools/gritsettings/*' \ | |
350 | '!' -path 'tools/gyp/*' \ | |
351 | '!' -path 'tools/json_comment_eater.py' \ | |
352 | '!' -path 'tools/json_schema_compiler/*' \ | |
353 | '!' -path 'tools/protoc_wrapper/*' \ | |
354 | '!' -path 'tools/uuidgen.py' \ | |
355 | '!' -path 'tools/zip2msi.py' \ | |
356 | -print -delete | |
8352ba82 ER |
357 | } |
358 | ||
e21194da ER |
359 | # clean third party |
360 | # list based from archlinux PKGBUILD | |
361 | # https://aur.archlinux.org/packages/ch/chromium-dev/PKGBUILD | |
362 | clean_third_party() { | |
e21194da | 363 | find third_party -type f \! -iname '*.gyp*' \ |
15f29c79 ER |
364 | \! -path 'third_party/WebKit/*' \ |
365 | \! -path 'third_party/adobe/flash/*' \ | |
e21194da ER |
366 | \! -path 'third_party/angle/*' \ |
367 | \! -path 'third_party/cacheinvalidation/*' \ | |
368 | \! -path 'third_party/cld/*' \ | |
15f29c79 | 369 | \! -path 'third_party/cros_system_api/*' \ |
e21194da ER |
370 | \! -path 'third_party/ffmpeg/*' \ |
371 | \! -path 'third_party/flac/flac.h' \ | |
372 | \! -path 'third_party/flot/*' \ | |
e21194da | 373 | \! -path 'third_party/harfbuzz-ng/*' \ |
15f29c79 | 374 | \! -path 'third_party/harfbuzz/*' \ |
e21194da ER |
375 | \! -path 'third_party/hunspell/*' \ |
376 | \! -path 'third_party/hyphen/*' \ | |
377 | \! -path 'third_party/iccjpeg/*' \ | |
e21194da ER |
378 | \! -path 'third_party/khronos/*' \ |
379 | \! -path 'third_party/leveldatabase/*' \ | |
15f29c79 | 380 | \! -path 'third_party/libXNVCtrl/*' \ |
e21194da ER |
381 | \! -path 'third_party/libjingle/*' \ |
382 | \! -path 'third_party/libphonenumber/*' \ | |
e21194da ER |
383 | \! -path 'third_party/libusb/libusb.h' \ |
384 | \! -path 'third_party/libva/*' \ | |
385 | \! -path 'third_party/libvpx/libvpx.h' \ | |
386 | \! -path 'third_party/libxml/chromium/*' \ | |
e21194da | 387 | \! -path 'third_party/libyuv/*' \ |
e21194da ER |
388 | \! -path 'third_party/lss/*' \ |
389 | \! -path 'third_party/mesa/*' \ | |
390 | \! -path 'third_party/modp_b64/*' \ | |
e21194da ER |
391 | \! -path 'third_party/mt19937ar/*' \ |
392 | \! -path 'third_party/npapi/*' \ | |
15f29c79 | 393 | \! -path 'third_party/opus/opus.h*' \ |
e21194da | 394 | \! -path 'third_party/ots/*' \ |
e21194da | 395 | \! -path 'third_party/protobuf/*' \ |
e21194da ER |
396 | \! -path 'third_party/qcms/*' \ |
397 | \! -path 'third_party/re2/*' \ | |
e21194da ER |
398 | \! -path 'third_party/sfntly/*' \ |
399 | \! -path 'third_party/skia/*' \ | |
400 | \! -path 'third_party/smhasher/*' \ | |
401 | \! -path 'third_party/speex/speex.h' \ | |
402 | \! -path 'third_party/sqlite/*' \ | |
403 | \! -path 'third_party/tcmalloc/*' \ | |
e21194da ER |
404 | \! -path 'third_party/trace-viewer/*' \ |
405 | \! -path 'third_party/undoview/*' \ | |
e21194da ER |
406 | \! -path 'third_party/v8-i18n/*' \ |
407 | \! -path 'third_party/v8/*' \ | |
e21194da ER |
408 | \! -path 'third_party/webrtc/*' \ |
409 | \! -path 'third_party/widevine/*' \ | |
e21194da ER |
410 | -print -delete |
411 | ||
e21194da ER |
412 | rm -vf third_party/expat/files/lib/expat.h |
413 | } | |
414 | ||
99f39995 ER |
415 | # parts based on ubuntu debian/rules |
416 | # http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules | |
99f39995 | 417 | remove_bin_only() { |
55dddbd9 | 418 | find -type f \( \ |
99f39995 ER |
419 | -iname \*.exe -o \ |
420 | -iname \*.dll -o \ | |
421 | -iname \*.pdb -o \ | |
422 | -name \*.o -o \ | |
423 | -name \*.a -o \ | |
424 | -name \*.dylib \ | |
425 | \) -exec rm -fv {} \; | |
426 | } | |
427 | ||
428 | # removes dir, if the bcond is not turned off | |
429 | strip_system_dirs() { | |
430 | local dir lib bcond | |
431 | for dir in "$@"; do | |
432 | lib=${dir##*/} | |
433 | bcond=$(eval echo \$$lib) | |
cd09b941 | 434 | [ "${bcond:-1}" = 0 ] && continue |
99f39995 ER |
435 | |
436 | # skip already removed dirs | |
437 | test -d $dir || continue | |
438 | ||
0e308272 | 439 | find $dir -depth -mindepth 1 \! \( -name '*.gyp' -o -name '*.gypi' -o -path $dir/$lib.h \) -print -delete |
99f39995 ER |
440 | done |
441 | } | |
442 | ||
da3dfa9f ER |
443 | # remove test data and files |
444 | # some scanned with find -name tests -o -name test -o -name test_data | |
445 | # and find -iname *test* | |
446 | remove_tests() { | |
447 | local dir | |
448 | ||
449 | # full remove | |
450 | for dir in \ | |
451 | ash/test \ | |
452 | base/test \ | |
453 | breakpad/src/client/windows/tests \ | |
454 | breakpad/src/common/linux/tests \ | |
455 | breakpad/src/common/tests \ | |
456 | chrome/browser/chromeos/bluetooth/test \ | |
457 | chrome/browser/component_updater/test \ | |
458 | chrome/browser/printing/cloud_print/test \ | |
459 | chrome/browser/resources/gaia_auth/test \ | |
460 | chrome/browser/resources/tracing/tests \ | |
461 | chrome/browser/sync/test \ | |
462 | chrome/browser/ui/tests \ | |
463 | chrome/installer/test \ | |
464 | chrome/test/chromeos \ | |
465 | chrome/test/data/firefox2_nss_mac \ | |
466 | chrome/test/data/safe_browsing/old \ | |
467 | chrome/test/logging/win \ | |
468 | chrome/test/pyautolib/chromeos \ | |
469 | chrome/test/webdriver/test \ | |
470 | chrome/tools/test \ | |
471 | chrome_frame/test \ | |
472 | chrome_frame/tools/test \ | |
473 | content/browser/worker_host/test \ | |
474 | content/public/test \ | |
475 | content/test \ | |
476 | courgette/testdata \ | |
477 | gpu/command_buffer/tests \ | |
478 | media/test \ | |
479 | media/tools/layout_tests/test_data \ | |
480 | native_client/src/trusted/service_runtime/testdata \ | |
481 | native_client/src/trusted/validator/x86/testing \ | |
482 | native_client/tests \ | |
483 | native_client/tools/tests \ | |
484 | native_client_sdk/src/build_tools/tests \ | |
485 | native_client_sdk/src/libraries/c_salt/test \ | |
486 | net/test \ | |
487 | o3d/tests \ | |
488 | ppapi/native_client/tests \ | |
489 | ppapi/tests \ | |
490 | printing/test \ | |
491 | rlz/test \ | |
492 | sandbox/linux/seccomp-legacy/tests \ | |
493 | sandbox/linux/tests \ | |
494 | sandbox/tests \ | |
495 | sandbox/win/tests \ | |
496 | seccompsandbox/tests \ | |
497 | sync/internal_api/public/test \ | |
498 | sync/internal_api/test \ | |
499 | sync/test \ | |
500 | testing/android \ | |
501 | testing/gmock/scripts/test \ | |
502 | testing/gmock/test \ | |
503 | testing/gtest/scripts/test \ | |
504 | testing/gtest/test \ | |
505 | third_party/WebKit/LayoutTests \ | |
506 | third_party/WebKit/Source/JavaScriptCore/API/tests \ | |
507 | third_party/WebKit/Source/JavaScriptCore/qt/tests \ | |
508 | third_party/WebKit/Source/JavaScriptCore/tests \ | |
509 | third_party/WebKit/Source/ThirdParty/gtest/scripts/test \ | |
510 | third_party/WebKit/Source/ThirdParty/gtest/test \ | |
511 | third_party/WebKit/Source/ThirdParty/gyp/test \ | |
512 | third_party/WebKit/Source/ThirdParty/qunit/test \ | |
513 | third_party/WebKit/Source/WebCore/bindings/scripts/test \ | |
514 | third_party/WebKit/Source/WebCore/testing_ \ | |
515 | third_party/WebKit/Source/WebKit/chromium/tests \ | |
516 | third_party/WebKit/Source/WebKit/efl/tests \ | |
517 | third_party/WebKit/Source/WebKit/gtk/tests \ | |
518 | third_party/WebKit/Source/WebKit/qt/tests \ | |
519 | third_party/WebKit/Source/WebKit2/UIProcess/API/efl/tests \ | |
520 | third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/tests \ | |
521 | third_party/WebKit/Source/WebKit2/UIProcess/API/qt/tests \ | |
522 | third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/mac \ | |
523 | third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/win \ | |
524 | third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/mac \ | |
525 | third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/win \ | |
526 | third_party/WebKit/Tools/Scripts/webkitpy/test \ | |
527 | third_party/WebKit/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac \ | |
528 | third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit/win \ | |
529 | third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/mac \ | |
530 | third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/win \ | |
531 | third_party/WebKit/Tools/TestWebKitAPI/Tests/mac \ | |
532 | third_party/WebKit/Tools/TestWebKitAPI/mac \ | |
533 | third_party/WebKit/Tools/TestWebKitAPI/win \ | |
534 | third_party/angle/tests \ | |
535 | third_party/cacheinvalidation/files/src/google/cacheinvalidation/test \ | |
536 | third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing \ | |
537 | third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing/android \ | |
538 | third_party/ffmpeg/tests \ | |
539 | third_party/harfbuzz/tests \ | |
540 | third_party/hunspell/tests \ | |
541 | third_party/hyphen/tests \ | |
542 | third_party/libexif/sources/test \ | |
543 | third_party/libjingle/source/talk/app/webrtc/test \ | |
544 | third_party/libphonenumber/src/resources/test \ | |
545 | third_party/libphonenumber/src/test \ | |
546 | third_party/libsrtp/srtp/crypto/test \ | |
547 | third_party/libsrtp/srtp/test \ | |
548 | third_party/mesa/MesaLib/src/gallium/tests \ | |
549 | third_party/openssl/openssl/crypto/des/t/test \ | |
550 | third_party/openssl/openssl/test \ | |
551 | third_party/ots/test \ | |
552 | third_party/protobuf/src/google/protobuf/testing \ | |
553 | third_party/re2/re2/testing \ | |
554 | third_party/safe_browsing/testing \ | |
555 | third_party/sfntly/cpp/src/test \ | |
556 | third_party/sqlite/src/test \ | |
557 | third_party/sqlite/test \ | |
558 | third_party/talloc/libreplace/test \ | |
559 | third_party/tcmalloc/chromium/src/tests \ | |
560 | third_party/tcmalloc/vendor/src/tests \ | |
561 | third_party/tlslite/test \ | |
562 | third_party/trace-viewer/test_data \ | |
563 | third_party/v8-i18n/tests \ | |
564 | third_party/webdriver/pylib/test \ | |
565 | third_party/webdriver/test_data \ | |
566 | third_party/webrtc/modules/audio_device/test/android \ | |
567 | third_party/webrtc/modules/audio_processing/test/android \ | |
568 | third_party/webrtc/modules/video_capture/main/test/android \ | |
569 | third_party/webrtc/test/testsupport/mac \ | |
570 | third_party/webrtc/video_engine/test/android \ | |
571 | third_party/webrtc/video_engine/test/auto_test/android \ | |
572 | third_party/webrtc/voice_engine/test/android \ | |
573 | third_party/xdg-utils/tests \ | |
574 | third_party/yasm/source/patched-yasm/libyasm/tests \ | |
575 | third_party/yasm/source/patched-yasm/modules/arch/lc3b/tests \ | |
576 | third_party/yasm/source/patched-yasm/modules/arch/x86/tests \ | |
577 | third_party/yasm/source/patched-yasm/modules/dbgfmts/dwarf2/tests \ | |
578 | third_party/yasm/source/patched-yasm/modules/dbgfmts/stabs/tests \ | |
579 | third_party/yasm/source/patched-yasm/modules/objfmts/bin/tests \ | |
580 | third_party/yasm/source/patched-yasm/modules/objfmts/coff/tests \ | |
581 | third_party/yasm/source/patched-yasm/modules/objfmts/elf/tests \ | |
582 | third_party/yasm/source/patched-yasm/modules/objfmts/macho/tests \ | |
583 | third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests \ | |
584 | third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests \ | |
585 | third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests \ | |
586 | third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests \ | |
587 | third_party/yasm/source/patched-yasm/modules/parsers/gas/tests \ | |
588 | third_party/yasm/source/patched-yasm/modules/parsers/nasm/tests \ | |
589 | third_party/yasm/source/patched-yasm/modules/parsers/tasm/tests \ | |
590 | third_party/yasm/source/patched-yasm/modules/preprocs/nasm/tests \ | |
591 | third_party/yasm/source/patched-yasm/modules/preprocs/raw/tests \ | |
592 | third_party/yasm/source/patched-yasm/tools/python-yasm/tests \ | |
593 | tools/clang/plugins/tests \ | |
594 | tools/gyp/test \ | |
595 | tools/page_cycler/webpagereplay/tests \ | |
596 | tools/perf_expectations/tests \ | |
597 | ui/app_list/test \ | |
598 | ui/aura/test \ | |
599 | ui/base/test \ | |
600 | ui/compositor/test \ | |
601 | ui/gfx/test \ | |
602 | ui/test \ | |
603 | ui/views/test \ | |
604 | v8/test \ | |
605 | webkit/data/layout_tests \ | |
606 | webkit/plugins/npapi/test \ | |
607 | webkit/tools/test/reference_build \ | |
608 | webkit/tools/test_shell/mac \ | |
609 | ; do | |
610 | rm -vfr "$dir" | |
611 | done | |
612 | ||
613 | # partial remove (keep .gyp) | |
614 | for dir in \ | |
615 | chrome/test/data \ | |
616 | testing \ | |
617 | ; do | |
618 | find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete | |
619 | done | |
620 | ||
621 | # link headers from system dir. too many files to patch, we don't even build tests | |
622 | install -d testing/gtest/include | |
623 | ln -s /usr/include/gtest testing/gtest/include/gtest | |
624 | ||
625 | # delete unittest files | |
626 | find -name '*_unittest.*' \ | |
627 | -print -delete | |
628 | } | |
629 | ||
99f39995 | 630 | remove_nonessential_dirs | tee -a REMOVED-nonessential_dirs.txt |
8352ba82 | 631 | almost_strip_dirs | tee -a REMOVED-stripped.txt |
18ffc809 | 632 | remove_bin_only | tee -a REMOVED-bin_only.txt |
da3dfa9f | 633 | remove_tests | tee -a REMOVED-tests.txt |
99f39995 ER |
634 | |
635 | strip_system_dirs \ | |
31187203 | 636 | native_client/src/third_party_mod/jsoncpp \ |
99f39995 | 637 | third_party/bzip2 \ |
31187203 | 638 | third_party/flac \ |
99f39995 | 639 | third_party/icu \ |
31187203 | 640 | third_party/jsoncpp \ |
99f39995 | 641 | third_party/libevent \ |
07d26a0d | 642 | third_party/libexif \ |
99f39995 | 643 | third_party/libjpeg \ |
07d26a0d | 644 | third_party/libmtp \ |
99f39995 | 645 | third_party/libpng \ |
3ee15dec | 646 | third_party/libsrtp \ |
581aec44 | 647 | third_party/libusb \ |
4b411ffe | 648 | third_party/libvpx \ |
31187203 | 649 | third_party/libwebp \ |
81699e86 | 650 | third_party/libxml_ \ |
99f39995 | 651 | third_party/libxslt \ |
07d26a0d | 652 | third_party/opus \ |
75a27c2e | 653 | third_party/protobuf \ |
ed514974 | 654 | third_party/speex \ |
e15125f5 | 655 | third_party/yasm \ |
2a97b574 | 656 | third_party/zlib \ |
99f39995 | 657 | v8 \ |
e21194da | 658 | | tee -a REMOVED-system_dirs.txt |
00360a4d | 659 | |
e21194da | 660 | clean_third_party | tee -a REMOVED-third_party.txt |
fe547a32 | 661 | |
cd09b941 | 662 | if [ "${v8:-1}" != "0" ]; then |
fe547a32 ER |
663 | # The implementation files include v8 headers with full path, |
664 | # like #include "v8/include/v8.h". Make sure the system headers | |
665 | # will be used. | |
598df428 | 666 | rm -rf v8/include |
fe547a32 ER |
667 | ln -s /usr/include v8/include |
668 | fi | |
669 | ||
cd09b941 | 670 | if [ "${nacl:-1}" != "0" ]; then |
fe547a32 ER |
671 | # NOTE: here is always x86_64 |
672 | rm -rf native_client/toolchain/linux_x86_newlib | |
fe547a32 | 673 | fi |
18ffc809 ER |
674 | |
675 | # cleanup empty dirs | |
07b01cb7 | 676 | find -type d -print0 | sort -zr | xargs -0 rmdir -v --ignore-fail-on-non-empty | tee -a REMOVED-dirs.txt |