]> git.pld-linux.org Git - packages/chromium-browser.git/blame - clean-source.sh
cleanup
[packages/chromium-browser.git] / clean-source.sh
CommitLineData
fe547a32 1#!/bin/sh
8f5f6775 2set -xe
fe547a32 3
0593259b
ER
4export 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
9eval "$@"
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
063abe65 14# also removed non-linux files: find -name win -o -name mac -o name android -o name windows
9304218b 15# find -type d -name 'android' -o -name 'chromeos' -o -name 'cros'
07b01cb7 16# find -type d -name *doc*
dda6f58c 17# find -type d -name *example*
894dee72
ER
18# find -type d -name java
19# find -type d -name tools
063abe65 20# find -type d -name samples
05d9087c
ER
21# suffix with _ those that we can't remove (just yet) because of the gclient
22# hooks (see build/all.gyp) or of some unneeded deps/includes
f888c710
ER
23remove_nonessential_dirs() {
24 local dir
25 for dir in \
18ffc809 26 android_webview \
9304218b
ER
27 ash/resources/default_100_percent/cros_ \
28 ash/resources/default_200_percent/cros_ \
dda6f58c 29 ash/shell/cocoa \
9304218b 30 ash/system/chromeos \
55dddbd9 31 base/android \
9304218b 32 base/chromeos \
e31bf7c6 33 base/ios \
55dddbd9
ER
34 base/mac_ \
35 base/win_ \
3333a973 36 breakpad/src/client/mac \
9304218b 37 breakpad/src/common/android \
3333a973
ER
38 breakpad/src/common/mac \
39 breakpad/src/tools/mac \
108c5f7c 40 build/android_ \
3333a973
ER
41 build/mac \
42 build/win \
55dddbd9
ER
43 chrome/android \
44 chrome/app/android \
9304218b
ER
45 chrome/app/resources/terms/chromeos \
46 chrome/app/theme/default_100_percent/cros_ \
3333a973
ER
47 chrome/app/theme/default_100_percent/mac \
48 chrome/app/theme/default_100_percent/win \
9304218b 49 chrome/app/theme/default_200_percent/cros_ \
3333a973
ER
50 chrome/app/theme/default_200_percent/mac \
51 chrome/app/theme/default_200_percent/win \
52 chrome/app/theme/touch_100_percent/win \
53 chrome/app/theme/touch_140_percent/win \
54 chrome/app/theme/touch_180_percent/win \
55dddbd9 55 chrome/browser/android \
9304218b
ER
56 chrome/browser/chromeos/cros \
57 chrome/browser/chromeos_ \
18ffc809 58 chrome/browser/component/web_contents_delegate_android_ \
e31bf7c6 59 chrome/browser/extensions/docs \
55dddbd9 60 chrome/browser/history/android \
3333a973 61 chrome/browser/mac \
18ffc809 62 chrome/browser/resources/about_welcome_android \
9304218b 63 chrome/browser/resources/chromeos_ \
18ffc809 64 chrome/browser/resources/ntp_android \
9304218b
ER
65 chrome/browser/resources/options/chromeos_ \
66 chrome/browser/resources/shared/css/chromeos \
67 chrome/browser/resources/shared/js/chromeos_ \
9304218b 68 chrome/browser/ui/android \
dda6f58c 69 chrome/browser/ui/cocoa \
9304218b
ER
70 chrome/browser/ui/webui/chromeos \
71 chrome/browser/ui/webui/ntp/android \
72 chrome/browser/ui/webui/options/chromeos \
54623fc8 73 chrome/common/extensions/docs \
3333a973
ER
74 chrome/common/mac \
75 chrome/installer/mac \
76 chrome/installer/mac/third_party/xz/config/mac \
894dee72 77 chrome/installer/tools \
dda6f58c
ER
78 chrome/third_party/jstemplate/tutorial_examples \
79 chrome/third_party/mock4js/examples \
05d9087c 80 chrome/third_party/wtl/ \
9304218b 81 chrome/tools/build/chromeos \
3333a973
ER
82 chrome/tools/build/mac \
83 chrome/tools/build/win \
894dee72 84 chrome/tools_ \
54623fc8 85 chrome_frame \
108c5f7c 86 chromeos_ \
3333a973
ER
87 cloud_print/service/win \
88 cloud_print/virtual_driver/win \
55dddbd9
ER
89 content/app/android \
90 content/browser/android \
894dee72 91 content/browser/renderer_host/java_ \
55dddbd9
ER
92 content/common/android \
93 content/common/mac_ \
894dee72
ER
94 content/components/navigation_interception/java \
95 content/components/web_contents_delegate_android/java \
55dddbd9
ER
96 content/public/android \
97 content/public/browser/android \
98 content/renderer/android \
894dee72 99 content/renderer/java_ \
55dddbd9 100 content/shell/android \
3333a973 101 content/shell/mac \
54623fc8 102 data \
05d9087c
ER
103 gears \
104 google_update \
e31bf7c6 105 gpu/command_buffer/docs \
05d9087c 106 gpu/demos \
894dee72 107 gpu/tools_ \
9304218b 108 media/audio/android \
e31bf7c6 109 media/audio/ios \
3333a973
ER
110 media/audio/mac \
111 media/audio/win \
9304218b 112 media/base/android \
894dee72 113 media/tools \
3333a973
ER
114 media/video/capture/mac \
115 media/video/capture/win \
9304218b 116 media/webm/chromeos \
063abe65 117 mesa/MesaLib/src/mesa/drivers/windows \
3333a973 118 native_client/build/mac \
e31bf7c6 119 native_client/documentation \
55dddbd9 120 native_client/src/include/win_ \
3333a973
ER
121 native_client/src/shared/imc/win \
122 native_client/src/shared/platform/win \
894dee72 123 native_client/src/tools \
3333a973
ER
124 native_client/src/trusted/debug_stub/win \
125 native_client/src/trusted/desc/win \
126 native_client/src/trusted/nonnacl_util/win \
127 native_client/src/trusted/platform_qualify/win \
55dddbd9 128 native_client/src/trusted/service_runtime/win_ \
894dee72 129 native_client/tools \
18ffc809 130 native_client/tools/trusted_cross_toolchains \
54623fc8 131 native_client_sdk \
3333a973 132 native_client_sdk/src/libraries/win \
9304218b 133 net/android \
894dee72
ER
134 net/tools \
135 net/tools/testserver \
063abe65 136 npapi/npspy/windows \
05d9087c 137 o3d \
54623fc8
ER
138 o3d/documentation \
139 o3d/samples \
e31bf7c6
ER
140 ppapi/c/documentation \
141 ppapi/cpp/documentation \
894dee72 142 ppapi/native_client/src/tools \
3333a973 143 ppapi/native_client/src/trusted/plugin/win \
894dee72 144 ppapi/native_client/tools \
3333a973 145 remoting/host/installer/mac \
e15125f5 146 remoting/host/installer/win \
3333a973 147 remoting/host/mac \
e15125f5 148 remoting/host/setup/win \
3333a973 149 remoting/host/win \
894dee72 150 remoting/tools_ \
dda6f58c 151 rlz/examples \
3333a973
ER
152 rlz/mac \
153 rlz/win \
894dee72 154 sandbox/win/tools \
55dddbd9 155 sandbox/win_ \
e31bf7c6 156 sdch/ios \
3333a973
ER
157 sdch/mac \
158 skia/config/win \
894dee72 159 sync/tools \
063abe65
ER
160 tcmalloc/chromium/src/windows \
161 tcmalloc/vendor/src/windows \
e31bf7c6 162 third_party/WebKit/Source/JavaScriptCore/docs \
894dee72 163 third_party/WebKit/Source/JavaScriptCore/tools \
55dddbd9 164 third_party/WebKit/Source/Platform/chromium/public/android \
3333a973
ER
165 third_party/WebKit/Source/Platform/chromium/public/mac \
166 third_party/WebKit/Source/Platform/chromium/public/win \
063abe65
ER
167 third_party/WebKit/Source/ThirdParty/gtest/samples \
168 third_party/WebKit/Source/ThirdParty/gyp/samples \
169 third_party/WebKit/Source/ThirdParty/gyp/samples/samples \
894dee72 170 third_party/WebKit/Source/ThirdParty/gyp/tools \
3333a973 171 third_party/WebKit/Source/WTF/wtf/mac \
4a263112 172 third_party/WebKit/Source/WTF/wtf/qt \
3333a973
ER
173 third_party/WebKit/Source/WTF/wtf/threads/win \
174 third_party/WebKit/Source/WTF/wtf/win \
175 third_party/WebKit/Source/WebCore/WebCore.gyp/mac \
176 third_party/WebKit/Source/WebCore/accessibility/mac \
4a263112 177 third_party/WebKit/Source/WebCore/accessibility/qt \
3333a973 178 third_party/WebKit/Source/WebCore/accessibility/win \
4a263112 179 third_party/WebKit/Source/WebCore/bridge/qt \
55dddbd9 180 third_party/WebKit/Source/WebCore/editing/android \
3333a973 181 third_party/WebKit/Source/WebCore/editing/mac \
4a263112 182 third_party/WebKit/Source/WebCore/editing/qt \
55dddbd9 183 third_party/WebKit/Source/WebCore/history/android \
3333a973 184 third_party/WebKit/Source/WebCore/history/mac \
4a263112 185 third_party/WebKit/Source/WebCore/history/qt \
3333a973
ER
186 third_party/WebKit/Source/WebCore/loader/mac \
187 third_party/WebKit/Source/WebCore/loader/win \
55dddbd9 188 third_party/WebKit/Source/WebCore/page/android \
3333a973 189 third_party/WebKit/Source/WebCore/page/mac \
4a263112 190 third_party/WebKit/Source/WebCore/page/qt \
3333a973
ER
191 third_party/WebKit/Source/WebCore/page/scrolling/mac \
192 third_party/WebKit/Source/WebCore/page/win \
55dddbd9 193 third_party/WebKit/Source/WebCore/platform/android \
3333a973 194 third_party/WebKit/Source/WebCore/platform/audio/mac \
4a263112 195 third_party/WebKit/Source/WebCore/platform/audio/qt \
3333a973 196 third_party/WebKit/Source/WebCore/platform/cf/win \
dda6f58c 197 third_party/WebKit/Source/WebCore/platform/cocoa \
3333a973
ER
198 third_party/WebKit/Source/WebCore/platform/graphics/ca/mac \
199 third_party/WebKit/Source/WebCore/platform/graphics/ca/win \
dda6f58c 200 third_party/WebKit/Source/WebCore/platform/graphics/cocoa \
3333a973 201 third_party/WebKit/Source/WebCore/platform/graphics/gpu/mac \
4a263112 202 third_party/WebKit/Source/WebCore/platform/graphics/gpu/qt \
3333a973 203 third_party/WebKit/Source/WebCore/platform/graphics/mac \
4a263112 204 third_party/WebKit/Source/WebCore/platform/graphics/qt \
3333a973 205 third_party/WebKit/Source/WebCore/platform/graphics/surfaces/mac \
4a263112 206 third_party/WebKit/Source/WebCore/platform/graphics/surfaces/qt \
e15125f5 207 third_party/WebKit/Source/WebCore/platform/graphics/surfaces/win \
3333a973 208 third_party/WebKit/Source/WebCore/platform/graphics/win \
e31bf7c6 209 third_party/WebKit/Source/WebCore/platform/ios \
3333a973 210 third_party/WebKit/Source/WebCore/platform/mac \
55dddbd9 211 third_party/WebKit/Source/WebCore/platform/network/android \
3333a973 212 third_party/WebKit/Source/WebCore/platform/network/mac \
4a263112 213 third_party/WebKit/Source/WebCore/platform/network/qt \
3333a973 214 third_party/WebKit/Source/WebCore/platform/network/win \
4a263112 215 third_party/WebKit/Source/WebCore/platform/qt \
55dddbd9 216 third_party/WebKit/Source/WebCore/platform/text/android \
3333a973 217 third_party/WebKit/Source/WebCore/platform/text/mac \
4a263112 218 third_party/WebKit/Source/WebCore/platform/text/qt \
3333a973
ER
219 third_party/WebKit/Source/WebCore/platform/text/win \
220 third_party/WebKit/Source/WebCore/platform/win \
221 third_party/WebKit/Source/WebCore/platform/wx/wxcode/mac \
222 third_party/WebKit/Source/WebCore/platform/wx/wxcode/win \
223 third_party/WebKit/Source/WebCore/plugins/mac \
4a263112 224 third_party/WebKit/Source/WebCore/plugins/qt \
3333a973 225 third_party/WebKit/Source/WebCore/plugins/win \
55dddbd9
ER
226 third_party/WebKit/Source/WebKit/chromium/public/android \
227 third_party/WebKit/Source/WebKit/chromium/public/mac_ \
228 third_party/WebKit/Source/WebKit/chromium/public/platform/android \
3333a973
ER
229 third_party/WebKit/Source/WebKit/chromium/public/platform/mac \
230 third_party/WebKit/Source/WebKit/chromium/public/platform/win \
231 third_party/WebKit/Source/WebKit/chromium/public/win \
55dddbd9 232 third_party/WebKit/Source/WebKit/chromium/src/android \
3333a973
ER
233 third_party/WebKit/Source/WebKit/chromium/src/mac \
234 third_party/WebKit/Source/WebKit/chromium/src/win \
e31bf7c6 235 third_party/WebKit/Source/WebKit/gtk/docs \
3333a973 236 third_party/WebKit/Source/WebKit/mac \
4a263112 237 third_party/WebKit/Source/WebKit/qt \
e31bf7c6 238 third_party/WebKit/Source/WebKit/qt/docs \
dda6f58c 239 third_party/WebKit/Source/WebKit/qt/examples \
3333a973 240 third_party/WebKit/Source/WebKit/win \
063abe65 241 third_party/WebKit/Source/WebKit/wx/bindings/python/samples \
3333a973
ER
242 third_party/WebKit/Source/WebKit2/Platform/CoreIPC/mac \
243 third_party/WebKit/Source/WebKit2/Platform/CoreIPC/win \
244 third_party/WebKit/Source/WebKit2/Platform/mac \
245 third_party/WebKit/Source/WebKit2/Platform/win \
246 third_party/WebKit/Source/WebKit2/PluginProcess/mac \
247 third_party/WebKit/Source/WebKit2/Shared/API/c/mac \
248 third_party/WebKit/Source/WebKit2/Shared/API/c/win \
249 third_party/WebKit/Source/WebKit2/Shared/Plugins/Netscape/mac \
250 third_party/WebKit/Source/WebKit2/Shared/Plugins/Netscape/win \
251 third_party/WebKit/Source/WebKit2/Shared/Plugins/mac \
252 third_party/WebKit/Source/WebKit2/Shared/cg/win \
253 third_party/WebKit/Source/WebKit2/Shared/mac \
254 third_party/WebKit/Source/WebKit2/Shared/win \
255 third_party/WebKit/Source/WebKit2/UIProcess/API/C/mac \
256 third_party/WebKit/Source/WebKit2/UIProcess/API/C/win \
257 third_party/WebKit/Source/WebKit2/UIProcess/API/mac \
258 third_party/WebKit/Source/WebKit2/UIProcess/Launcher/mac \
259 third_party/WebKit/Source/WebKit2/UIProcess/Launcher/win \
260 third_party/WebKit/Source/WebKit2/UIProcess/Plugins/mac \
261 third_party/WebKit/Source/WebKit2/UIProcess/Plugins/win \
262 third_party/WebKit/Source/WebKit2/UIProcess/mac \
263 third_party/WebKit/Source/WebKit2/UIProcess/win \
264 third_party/WebKit/Source/WebKit2/WebProcess/Authentication/mac \
265 third_party/WebKit/Source/WebKit2/WebProcess/Cookies/mac \
266 third_party/WebKit/Source/WebKit2/WebProcess/Downloads/cf/win \
267 third_party/WebKit/Source/WebKit2/WebProcess/Downloads/mac \
268 third_party/WebKit/Source/WebKit2/WebProcess/FullScreen/mac \
269 third_party/WebKit/Source/WebKit2/WebProcess/FullScreen/win \
270 third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/API/c/win \
271 third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/mac \
272 third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/win \
273 third_party/WebKit/Source/WebKit2/WebProcess/Plugins/Netscape/mac \
274 third_party/WebKit/Source/WebKit2/WebProcess/Plugins/Netscape/win \
275 third_party/WebKit/Source/WebKit2/WebProcess/WebCoreSupport/mac \
276 third_party/WebKit/Source/WebKit2/WebProcess/WebCoreSupport/win \
277 third_party/WebKit/Source/WebKit2/WebProcess/WebPage/ca/mac \
278 third_party/WebKit/Source/WebKit2/WebProcess/WebPage/ca/win \
279 third_party/WebKit/Source/WebKit2/WebProcess/WebPage/mac \
280 third_party/WebKit/Source/WebKit2/WebProcess/WebPage/win \
281 third_party/WebKit/Source/WebKit2/WebProcess/mac \
282 third_party/WebKit/Source/WebKit2/WebProcess/win \
283 third_party/WebKit/Source/WebKit2/mac \
284 third_party/WebKit/Source/WebKit2/win \
3333a973 285 third_party/WebKit/Tools/DumpRenderTree/mac \
4a263112 286 third_party/WebKit/Tools/DumpRenderTree/qt \
3333a973 287 third_party/WebKit/Tools/DumpRenderTree/win \
063abe65
ER
288 third_party/WebKit/Tools_ \
289 third_party/angle/extensions \
290 third_party/angle/samples \
54623fc8 291 third_party/angle/samples/gles2_book \
05d9087c
ER
292 third_party/boost \
293 third_party/bsdiff \
294 third_party/bspatch \
894dee72
ER
295 third_party/cacheinvalidation/src/example-app-build \
296 third_party/cacheinvalidation/src/java \
55dddbd9 297 third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android \
55dddbd9
ER
298 third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android \
299 third_party/cld/encodings/compact_lang_det/win_ \
18ffc809 300 third_party/cros_system_api_ \
05d9087c 301 third_party/ffmpeg/binaries \
3333a973
ER
302 third_party/ffmpeg/chromium/binaries/Chromium/win \
303 third_party/ffmpeg/chromium/config/Chrome/mac \
e15125f5 304 third_party/ffmpeg/chromium/config/Chrome/win \
3333a973 305 third_party/ffmpeg/chromium/config/Chromium/mac \
e15125f5 306 third_party/ffmpeg/chromium/config/Chromium/win \
3333a973 307 third_party/ffmpeg/chromium/include/win \
e31bf7c6 308 third_party/ffmpeg/doc \
894dee72 309 third_party/ffmpeg/tools \
05d9087c 310 third_party/fuzzymatch \
8352ba82 311 third_party/gles2_book \
05d9087c
ER
312 third_party/gles_book_examples \
313 third_party/gold \
05d9087c 314 third_party/hunspell/dictionaries \
54623fc8 315 third_party/hunspell_dictionaries \
e31bf7c6 316 third_party/hyphen/doc \
55dddbd9 317 third_party/icu/android \
05d9087c
ER
318 third_party/icu/mac \
319 third_party/lcov \
e31bf7c6 320 third_party/leveldatabase/src/doc \
3333a973 321 third_party/leveldatabase/src/port/win \
dda6f58c 322 third_party/libjingle/source/talk/examples \
3333a973
ER
323 third_party/libjpeg_turbo/mac \
324 third_party/libjpeg_turbo/win \
55dddbd9 325 third_party/libva/va/android \
3333a973
ER
326 third_party/libvpx/source/config/mac \
327 third_party/libvpx/source/config/win \
328 third_party/libxml/mac \
54623fc8 329 third_party/lighttpd \
e31bf7c6 330 third_party/mesa/MesaLib/docs \
e31bf7c6 331 third_party/mesa/MesaLib/src/gallium/docs \
9304218b 332 third_party/mozc/chrome/chromeos_ \
894dee72 333 third_party/npapi/npspy/extern/java \
05d9087c
ER
334 third_party/nspr \
335 third_party/nss \
336 third_party/ocmock \
55dddbd9 337 third_party/openssl/config/android \
894dee72 338 third_party/ots/tools \
05d9087c
ER
339 third_party/pthread \
340 third_party/pyftpdlib \
e31bf7c6 341 third_party/re2/doc \
05d9087c 342 third_party/scons \
894dee72 343 third_party/sfntly/cpp/src/sfntly/tools \
05d9087c 344 third_party/simplejson \
55dddbd9 345 third_party/skia/include/utils/android \
e31bf7c6 346 third_party/skia/include/utils/ios \
3333a973
ER
347 third_party/skia/include/utils/mac \
348 third_party/skia/include/utils/win \
55dddbd9
ER
349 third_party/skia/include/views/android \
350 third_party/skia/src/gpu/gl/android \
3333a973
ER
351 third_party/skia/src/gpu/gl/mac \
352 third_party/skia/src/gpu/gl/win \
e31bf7c6 353 third_party/skia/src/utils/ios \
3333a973
ER
354 third_party/skia/src/utils/mac \
355 third_party/skia/src/utils/win \
e31bf7c6 356 third_party/skia/src/views/ios \
3333a973
ER
357 third_party/skia/src/views/mac \
358 third_party/skia/src/views/win \
359 third_party/snappy/mac \
e31bf7c6
ER
360 third_party/sqlite/src/doc \
361 third_party/tcmalloc/vendor/doc \
05d9087c 362 third_party/tcmalloc_ \
dda6f58c
ER
363 third_party/trace-viewer/examples \
364 third_party/trace-viewer/third_party/pywebsocket/src/example \
894dee72 365 third_party/v8-i18n/tools_ \
54623fc8 366 third_party/vc_80 \
e31bf7c6 367 third_party/webdriver/pylib/docs \
55dddbd9 368 third_party/webrtc/modules/audio_device/android \
e31bf7c6 369 third_party/webrtc/modules/audio_device/ios \
3333a973
ER
370 third_party/webrtc/modules/audio_device/main/source/mac \
371 third_party/webrtc/modules/audio_device/main/source/win \
e15125f5 372 third_party/webrtc/modules/audio_device/win \
894dee72 373 third_party/webrtc/modules/video_capture/android/java \
55dddbd9 374 third_party/webrtc/modules/video_capture/main/source/android \
894dee72
ER
375 third_party/webrtc/modules/video_coding/codecs/tools_ \
376 third_party/webrtc/modules/video_render/android/java \
55dddbd9 377 third_party/webrtc/modules/video_render/main/source/android \
3333a973 378 third_party/webrtc/modules/video_render/main/source/mac \
55dddbd9 379 third_party/webrtc/system_wrappers/source/android \
894dee72 380 third_party/webrtc/tools_ \
55dddbd9 381 third_party/yasm/source/config/android \
3333a973
ER
382 third_party/yasm/source/config/mac \
383 third_party/yasm/source/config/win \
9304218b 384 tools/android \
063abe65
ER
385 tools/gyp/samples \
386 tools/gyp/samples/samples \
894dee72 387 tools/gyp/tools \
3333a973 388 tools/mac \
54623fc8 389 tools/site_compare \
05d9087c
ER
390 tools/stats_viewer \
391 tools/symsrc \
05d9087c 392 tools/valgrind \
3333a973 393 tools/win \
05d9087c 394 tools/wine_valgrind \
9304218b 395 ui/android \
dda6f58c 396 ui/base/cocoa \
e15125f5 397 ui/base/ime/win \
55dddbd9 398 ui/base/win_ \
9304218b 399 ui/gfx/android \
3333a973 400 ui/gfx/mac \
9304218b
ER
401 ui/resources/default_100_percent/cros_ \
402 ui/resources/default_200_percent/cros_ \
dda6f58c 403 ui/views/examples \
3333a973 404 ui/views/win \
063abe65 405 v8/samples \
894dee72 406 v8/tools_ \
9304218b 407 webkit/chromeos \
55dddbd9 408 webkit/media/android \
894dee72 409 webkit/tools_ \
063abe65
ER
410 webrtc/modules/video_capture/windows \
411 webrtc/modules/video_render/windows \
8352ba82 412 win8 \
f888c710
ER
413 ; do
414 rm -vfr "$dir"
415 done
416}
417
8352ba82
ER
418# There are directories we want to strip, but that are unnecessarily required by the build-system
419# So we drop everything but the gyp/gypi files
420almost_strip_dirs() {
421 local dir
422 for dir in \
bcc7de3a 423 breakpad \
e31bf7c6 424 build/ios \
8352ba82 425 courgette \
18ffc809 426 third_party/cros_dbus_cplusplus \
8352ba82
ER
427 ; do
428 find $dir -depth -mindepth 1 \! \( -name '*.gyp' -o -name '*.gypi' \) -print -delete || :
429 done
bcc7de3a
ER
430
431 find tools -type f \
432 '!' -iname '*.gyp*' \
433 '!' -path 'tools/build/*' \
434 '!' -path 'tools/clang/scripts/plugin_flags.sh' \
108c5f7c
ER
435 '!' -path 'tools/generate_library_loader/*' \
436 '!' -path 'tools/generate_shim_headers/generate_shim_headers.py' \
bcc7de3a
ER
437 '!' -path 'tools/generate_stubs/*' \
438 '!' -path 'tools/grit/*' \
439 '!' -path 'tools/gritsettings/*' \
440 '!' -path 'tools/gyp/*' \
441 '!' -path 'tools/json_comment_eater.py' \
442 '!' -path 'tools/json_schema_compiler/*' \
108c5f7c 443 '!' -path 'tools/json_to_struct/*' \
bcc7de3a
ER
444 '!' -path 'tools/protoc_wrapper/*' \
445 '!' -path 'tools/uuidgen.py' \
446 '!' -path 'tools/zip2msi.py' \
108c5f7c 447 '!' -path 'tools/usb_ids/*' \
bcc7de3a 448 -print -delete
8352ba82
ER
449}
450
e21194da
ER
451# clean third party
452# list based from archlinux PKGBUILD
453# https://aur.archlinux.org/packages/ch/chromium-dev/PKGBUILD
454clean_third_party() {
063abe65
ER
455 local dir
456 for dir in \
457 third_party/ashmem \
458 third_party/npapi/npspy \
459 third_party/re2/benchlog \
460 third_party/eyesfree \
461 third_party/guava \
462 third_party/icon_family \
463 third_party/isimpledom \
464 third_party/jsoncpp \
465 third_party/jsr-305 \
466 third_party/libexif \
467 third_party/mach_override \
468 third_party/snappy \
469 third_party/iaccessible2 \
470 third_party/sudden_motion_sensor \
471 third_party/sqlite/*.patch \
472 third_party/sqlite/src/*.patch \
473 ; do
474 rm -vfr "$dir"
475 done
476
e21194da 477 find third_party -type f \! -iname '*.gyp*' \
15f29c79
ER
478 \! -path 'third_party/WebKit/*' \
479 \! -path 'third_party/adobe/flash/*' \
e21194da
ER
480 \! -path 'third_party/angle/*' \
481 \! -path 'third_party/cacheinvalidation/*' \
482 \! -path 'third_party/cld/*' \
15f29c79 483 \! -path 'third_party/cros_system_api/*' \
e21194da 484 \! -path 'third_party/flac/flac.h' \
063abe65 485 \! -path 'third_party/flot/*.js' \
e21194da
ER
486 \! -path 'third_party/hunspell/*' \
487 \! -path 'third_party/hyphen/*' \
488 \! -path 'third_party/iccjpeg/*' \
e21194da
ER
489 \! -path 'third_party/khronos/*' \
490 \! -path 'third_party/leveldatabase/*' \
15f29c79 491 \! -path 'third_party/libXNVCtrl/*' \
e21194da
ER
492 \! -path 'third_party/libjingle/*' \
493 \! -path 'third_party/libphonenumber/*' \
e21194da
ER
494 \! -path 'third_party/libusb/libusb.h' \
495 \! -path 'third_party/libva/*' \
496 \! -path 'third_party/libvpx/libvpx.h' \
497 \! -path 'third_party/libxml/chromium/*' \
e21194da 498 \! -path 'third_party/libyuv/*' \
063abe65 499 \! -path 'third_party/lss/*.h' \
e21194da
ER
500 \! -path 'third_party/mesa/*' \
501 \! -path 'third_party/modp_b64/*' \
e21194da
ER
502 \! -path 'third_party/mt19937ar/*' \
503 \! -path 'third_party/npapi/*' \
15f29c79 504 \! -path 'third_party/opus/opus.h*' \
e21194da 505 \! -path 'third_party/ots/*' \
e21194da 506 \! -path 'third_party/protobuf/*' \
e21194da
ER
507 \! -path 'third_party/qcms/*' \
508 \! -path 'third_party/re2/*' \
e21194da
ER
509 \! -path 'third_party/sfntly/*' \
510 \! -path 'third_party/skia/*' \
511 \! -path 'third_party/smhasher/*' \
512 \! -path 'third_party/speex/speex.h' \
513 \! -path 'third_party/sqlite/*' \
514 \! -path 'third_party/tcmalloc/*' \
e21194da
ER
515 \! -path 'third_party/trace-viewer/*' \
516 \! -path 'third_party/undoview/*' \
e21194da
ER
517 \! -path 'third_party/v8-i18n/*' \
518 \! -path 'third_party/v8/*' \
e21194da
ER
519 \! -path 'third_party/webrtc/*' \
520 \! -path 'third_party/widevine/*' \
e21194da
ER
521 -print -delete
522
e21194da
ER
523 rm -vf third_party/expat/files/lib/expat.h
524}
525
99f39995
ER
526# parts based on ubuntu debian/rules
527# http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules
99f39995 528remove_bin_only() {
55dddbd9 529 find -type f \( \
99f39995 530 -iname \*.exe -o \
894dee72
ER
531 -iname \*.nexe -o \
532 -iname \*.fon -o \
533 -iname \*.ttf -o \
99f39995
ER
534 -iname \*.dll -o \
535 -iname \*.pdb -o \
536 -name \*.o -o \
537 -name \*.a -o \
538 -name \*.dylib \
539 \) -exec rm -fv {} \;
540}
541
542# removes dir, if the bcond is not turned off
543strip_system_dirs() {
544 local dir lib bcond
545 for dir in "$@"; do
546 lib=${dir##*/}
547 bcond=$(eval echo \$$lib)
cd09b941 548 [ "${bcond:-1}" = 0 ] && continue
99f39995
ER
549
550 # skip already removed dirs
551 test -d $dir || continue
552
0e308272 553 find $dir -depth -mindepth 1 \! \( -name '*.gyp' -o -name '*.gypi' -o -path $dir/$lib.h \) -print -delete
99f39995
ER
554 done
555}
556
da3dfa9f 557# remove test data and files
e31bf7c6 558# some scanned with find -name tests -o -name test -o -name test_data -o name testdata
da3dfa9f
ER
559# and find -iname *test*
560remove_tests() {
561 local dir
562
563 # full remove
564 for dir in \
565 ash/test \
566 base/test \
567 breakpad/src/client/windows/tests \
568 breakpad/src/common/linux/tests \
569 breakpad/src/common/tests \
e31bf7c6 570 cc/test \
da3dfa9f
ER
571 chrome/browser/chromeos/bluetooth/test \
572 chrome/browser/component_updater/test \
e31bf7c6 573 chrome/browser/extensions/api/test_ \
da3dfa9f
ER
574 chrome/browser/printing/cloud_print/test \
575 chrome/browser/resources/gaia_auth/test \
576 chrome/browser/resources/tracing/tests \
577 chrome/browser/sync/test \
e31bf7c6
ER
578 chrome/browser/ui/cocoa/test \
579 chrome/browser/ui/gtk/test \
da3dfa9f 580 chrome/browser/ui/tests \
e31bf7c6 581 chrome/browser/ui/views/test \
da3dfa9f
ER
582 chrome/installer/test \
583 chrome/test/chromeos \
584 chrome/test/data/firefox2_nss_mac \
585 chrome/test/data/safe_browsing/old \
586 chrome/test/logging/win \
587 chrome/test/pyautolib/chromeos \
588 chrome/test/webdriver/test \
e31bf7c6 589 chrome/test_ \
da3dfa9f
ER
590 chrome/tools/test \
591 chrome_frame/test \
592 chrome_frame/tools/test \
593 content/browser/worker_host/test \
e31bf7c6 594 content/common/gpu/testdata \
da3dfa9f
ER
595 content/public/test \
596 content/test \
597 courgette/testdata \
e31bf7c6
ER
598 device/bluetooth/test \
599 device/test \
da3dfa9f
ER
600 gpu/command_buffer/tests \
601 media/test \
602 media/tools/layout_tests/test_data \
e31bf7c6
ER
603 native_client/buildbot \
604 native_client/src/shared/platform/testdata \
605 native_client/src/trusted/gio/testdata \
606 native_client/src/trusted/interval_multiset/testdata \
da3dfa9f 607 native_client/src/trusted/service_runtime/testdata \
e31bf7c6 608 native_client/src/trusted/validator/x86/decoder/generator/testdata \
da3dfa9f 609 native_client/src/trusted/validator/x86/testing \
e31bf7c6
ER
610 native_client/src/trusted/validator_arm/testdata \
611 native_client/src/trusted/validator_mips/testdata \
612 native_client/src/trusted/validator_x86/testdata \
da3dfa9f 613 native_client/tests \
e31bf7c6 614 native_client/tools/testdata \
da3dfa9f
ER
615 native_client/tools/tests \
616 native_client_sdk/src/build_tools/tests \
617 native_client_sdk/src/libraries/c_salt/test \
618 net/test \
619 o3d/tests \
620 ppapi/native_client/tests \
621 ppapi/tests \
622 printing/test \
623 rlz/test \
624 sandbox/linux/seccomp-legacy/tests \
625 sandbox/linux/tests \
626 sandbox/tests \
627 sandbox/win/tests \
e31bf7c6 628 sdch/open-vcdiff/testdata \
da3dfa9f
ER
629 seccompsandbox/tests \
630 sync/internal_api/public/test \
631 sync/internal_api/test \
632 sync/test \
633 testing/android \
634 testing/gmock/scripts/test \
635 testing/gmock/test \
636 testing/gtest/scripts/test \
637 testing/gtest/test \
638 third_party/WebKit/LayoutTests \
639 third_party/WebKit/Source/JavaScriptCore/API/tests \
640 third_party/WebKit/Source/JavaScriptCore/qt/tests \
641 third_party/WebKit/Source/JavaScriptCore/tests \
642 third_party/WebKit/Source/ThirdParty/gtest/scripts/test \
643 third_party/WebKit/Source/ThirdParty/gtest/test \
644 third_party/WebKit/Source/ThirdParty/gyp/test \
645 third_party/WebKit/Source/ThirdParty/qunit/test \
646 third_party/WebKit/Source/WebCore/bindings/scripts/test \
647 third_party/WebKit/Source/WebCore/testing_ \
648 third_party/WebKit/Source/WebKit/chromium/tests \
649 third_party/WebKit/Source/WebKit/efl/tests \
650 third_party/WebKit/Source/WebKit/gtk/tests \
651 third_party/WebKit/Source/WebKit/qt/tests \
652 third_party/WebKit/Source/WebKit2/UIProcess/API/efl/tests \
653 third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/tests \
654 third_party/WebKit/Source/WebKit2/UIProcess/API/qt/tests \
655 third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/mac \
656 third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/win \
657 third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/mac \
658 third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/win \
659 third_party/WebKit/Tools/Scripts/webkitpy/test \
660 third_party/WebKit/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac \
661 third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit/win \
662 third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/mac \
663 third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/win \
664 third_party/WebKit/Tools/TestWebKitAPI/Tests/mac \
665 third_party/WebKit/Tools/TestWebKitAPI/mac \
666 third_party/WebKit/Tools/TestWebKitAPI/win \
667 third_party/angle/tests \
668 third_party/cacheinvalidation/files/src/google/cacheinvalidation/test \
e31bf7c6 669 third_party/cacheinvalidation/src/google/cacheinvalidation/test \
da3dfa9f
ER
670 third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing \
671 third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing/android \
672 third_party/ffmpeg/tests \
673 third_party/harfbuzz/tests \
674 third_party/hunspell/tests \
675 third_party/hyphen/tests \
676 third_party/libexif/sources/test \
677 third_party/libjingle/source/talk/app/webrtc/test \
e31bf7c6 678 third_party/libjingle/source/talk/media/testdata \
da3dfa9f
ER
679 third_party/libphonenumber/src/resources/test \
680 third_party/libphonenumber/src/test \
681 third_party/libsrtp/srtp/crypto/test \
682 third_party/libsrtp/srtp/test \
e31bf7c6 683 third_party/libyuv/unit_test/testdata \
da3dfa9f
ER
684 third_party/mesa/MesaLib/src/gallium/tests \
685 third_party/openssl/openssl/crypto/des/t/test \
686 third_party/openssl/openssl/test \
687 third_party/ots/test \
e31bf7c6 688 third_party/protobuf/src/google/protobuf/testdata \
da3dfa9f
ER
689 third_party/protobuf/src/google/protobuf/testing \
690 third_party/re2/re2/testing \
691 third_party/safe_browsing/testing \
692 third_party/sfntly/cpp/src/test \
693 third_party/sqlite/src/test \
694 third_party/sqlite/test \
695 third_party/talloc/libreplace/test \
696 third_party/tcmalloc/chromium/src/tests \
697 third_party/tcmalloc/vendor/src/tests \
698 third_party/tlslite/test \
699 third_party/trace-viewer/test_data \
e31bf7c6
ER
700 third_party/trace-viewer/third_party/pywebsocket/src/test \
701 third_party/trace-viewer/third_party/pywebsocket/src/test/testdata \
da3dfa9f
ER
702 third_party/v8-i18n/tests \
703 third_party/webdriver/pylib/test \
704 third_party/webdriver/test_data \
705 third_party/webrtc/modules/audio_device/test/android \
706 third_party/webrtc/modules/audio_processing/test/android \
e31bf7c6 707 third_party/webrtc/modules/utility/test \
da3dfa9f 708 third_party/webrtc/modules/video_capture/main/test/android \
e31bf7c6
ER
709 third_party/webrtc/system_wrappers/test \
710 third_party/webrtc/test \
da3dfa9f
ER
711 third_party/webrtc/test/testsupport/mac \
712 third_party/webrtc/video_engine/test/android \
713 third_party/webrtc/video_engine/test/auto_test/android \
714 third_party/webrtc/voice_engine/test/android \
715 third_party/xdg-utils/tests \
716 third_party/yasm/source/patched-yasm/libyasm/tests \
717 third_party/yasm/source/patched-yasm/modules/arch/lc3b/tests \
718 third_party/yasm/source/patched-yasm/modules/arch/x86/tests \
719 third_party/yasm/source/patched-yasm/modules/dbgfmts/dwarf2/tests \
720 third_party/yasm/source/patched-yasm/modules/dbgfmts/stabs/tests \
721 third_party/yasm/source/patched-yasm/modules/objfmts/bin/tests \
722 third_party/yasm/source/patched-yasm/modules/objfmts/coff/tests \
723 third_party/yasm/source/patched-yasm/modules/objfmts/elf/tests \
724 third_party/yasm/source/patched-yasm/modules/objfmts/macho/tests \
725 third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests \
726 third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests \
727 third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests \
728 third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests \
729 third_party/yasm/source/patched-yasm/modules/parsers/gas/tests \
730 third_party/yasm/source/patched-yasm/modules/parsers/nasm/tests \
731 third_party/yasm/source/patched-yasm/modules/parsers/tasm/tests \
732 third_party/yasm/source/patched-yasm/modules/preprocs/nasm/tests \
733 third_party/yasm/source/patched-yasm/modules/preprocs/raw/tests \
734 third_party/yasm/source/patched-yasm/tools/python-yasm/tests \
735 tools/clang/plugins/tests \
e31bf7c6 736 tools/grit/grit/testdata \
da3dfa9f 737 tools/gyp/test \
e31bf7c6 738 tools/gyp/tools/emacs/testdata \
da3dfa9f
ER
739 tools/page_cycler/webpagereplay/tests \
740 tools/perf_expectations/tests \
e31bf7c6 741 tools/swarm_client/tests \
da3dfa9f
ER
742 ui/app_list/test \
743 ui/aura/test \
744 ui/base/test \
745 ui/compositor/test \
746 ui/gfx/test \
747 ui/test \
748 ui/views/test \
749 v8/test \
e31bf7c6 750 webkit/compositor_bindings/test \
da3dfa9f
ER
751 webkit/data/layout_tests \
752 webkit/plugins/npapi/test \
753 webkit/tools/test/reference_build \
754 webkit/tools/test_shell/mac \
755 ; do
756 rm -vfr "$dir"
757 done
758
759 # partial remove (keep .gyp)
760 for dir in \
e31bf7c6 761 chrome/browser/nacl_host/test \
da3dfa9f
ER
762 chrome/test/data \
763 testing \
e31bf7c6
ER
764 third_party/webrtc/modules/audio_coding/codecs/cng/test \
765 third_party/webrtc/modules/audio_coding/codecs/g711/test \
766 third_party/webrtc/modules/audio_coding/codecs/g722/test \
767 third_party/webrtc/modules/audio_coding/codecs/ilbc/test \
768 third_party/webrtc/modules/audio_coding/codecs/isac/fix/test \
769 third_party/webrtc/modules/audio_coding/codecs/isac/main/test \
770 third_party/webrtc/modules/audio_coding/main/test \
771 third_party/webrtc/modules/audio_coding/neteq/test \
772 third_party/webrtc/modules/audio_conference_mixer/test \
773 third_party/webrtc/modules/audio_device/test \
774 third_party/webrtc/modules/audio_processing/test \
775 third_party/webrtc/modules/rtp_rtcp/test \
776 third_party/webrtc/modules/udp_transport/test \
777 third_party/webrtc/modules/video_capture/main/test \
778 third_party/webrtc/modules/video_coding/codecs/test \
779 third_party/webrtc/modules/video_coding/codecs/vp8/test \
780 third_party/webrtc/modules/video_coding/main/test \
781 third_party/webrtc/modules/video_processing/main/test \
782 third_party/webrtc/modules/video_render/main/test \
783 third_party/webrtc/video_engine/test \
784 third_party/webrtc/voice_engine/test \
785 tools/json_schema_compiler/test \
da3dfa9f 786 ; do
e31bf7c6 787 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
da3dfa9f
ER
788 done
789
790 # link headers from system dir. too many files to patch, we don't even build tests
791 install -d testing/gtest/include
792 ln -s /usr/include/gtest testing/gtest/include/gtest
793
794 # delete unittest files
dda6f58c
ER
795 find . '(' \
796 -name '*_unittest*.*' \
063abe65
ER
797 -o -name '*_unittest.*' \
798 -o -name '*_unittest' \
799 -o -name 'test_*.*' \
dda6f58c
ER
800 -o -name '*_test.*' \
801 ')' '!' -name '*.gyp*' \
063abe65
ER
802 '!' -name '*.isolate' \
803 '!' -name '*.grd' \
dda6f58c 804 '!' -path './chrome/browser/diagnostics/diagnostics_test.*' \
063abe65
ER
805 '!' -path './chrome/browser/extensions/api/declarative/test_rules_registry.*' \
806 '!' -path './chrome/browser/extensions/api/test/test_api.*' \
807 '!' -path './chrome/browser/resources/net_internals/*' \
808 '!' -path './chrome/browser/ui/webui/test_chrome_web_ui_controller_factory*' \
809 '!' -path './chrome/common/net/test_server_locations.*' \
810 '!' -path './chrome/test/base/test_switches.*' \
dda6f58c 811 '!' -path './chrome/test/perf/browser_perf_test.*' \
063abe65
ER
812 '!' -path './chrome/test/perf/perf_test.*' \
813 '!' -path './native_client/src/trusted/fault_injection/test_injection.*' \
814 '!' -path './native_client/src/trusted/service_runtime/env_cleanser_test.h' \
815 '!' -path './net/base/test_completion_callback.*' \
816 '!' -path './net/base/test_data_stream.*' \
817 '!' -path './net/base/test_root_certs*' \
3b691646 818 '!' -path './remoting/base/resources_unittest.*' \
063abe65
ER
819 '!' -path './third_party/skia/src/gpu/gr_unittests.*' \
820 '!' -path './ui/compositor/test_web_graphics_context_3d.*' \
821 '!' -path './webkit/fileapi/test_mount_point_provider.*' \
822 -print -delete || :
da3dfa9f
ER
823}
824
e31bf7c6
ER
825remove_nonessential_dirs > REMOVED-nonessential_dirs.txt
826almost_strip_dirs > REMOVED-stripped.txt
827remove_bin_only > REMOVED-bin_only.txt
828remove_tests > REMOVED-tests.txt
99f39995
ER
829
830strip_system_dirs \
31187203 831 native_client/src/third_party_mod/jsoncpp \
99f39995 832 third_party/bzip2 \
31187203 833 third_party/flac \
99f39995 834 third_party/icu \
31187203 835 third_party/jsoncpp \
42e551c9 836 third_party/libXNVCtrl \
99f39995 837 third_party/libevent \
07d26a0d 838 third_party/libexif \
99f39995 839 third_party/libjpeg \
07d26a0d 840 third_party/libmtp \
99f39995 841 third_party/libpng \
3ee15dec 842 third_party/libsrtp \
581aec44 843 third_party/libusb \
4b411ffe 844 third_party/libvpx \
31187203 845 third_party/libwebp \
81699e86 846 third_party/libxml_ \
99f39995 847 third_party/libxslt \
07d26a0d 848 third_party/opus \
75a27c2e 849 third_party/protobuf \
ed514974 850 third_party/speex \
e15125f5 851 third_party/yasm \
2a97b574 852 third_party/zlib \
99f39995 853 v8 \
e31bf7c6 854> REMOVED-system_dirs.txt
00360a4d 855
e31bf7c6 856clean_third_party > REMOVED-third_party.txt
fe547a32 857
cd09b941 858if [ "${v8:-1}" != "0" ]; then
fe547a32
ER
859 # The implementation files include v8 headers with full path,
860 # like #include "v8/include/v8.h". Make sure the system headers
861 # will be used.
598df428 862 rm -rf v8/include
fe547a32
ER
863 ln -s /usr/include v8/include
864fi
865
cd09b941 866if [ "${nacl:-1}" != "0" ]; then
fe547a32
ER
867 # NOTE: here is always x86_64
868 rm -rf native_client/toolchain/linux_x86_newlib
fe547a32 869fi
18ffc809 870
23e8b485
ER
871if [ "${emptydirs:-0}" != "0" ]; then
872 # cleanup empty dirs
873 find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty > REMOVED-dirs.txt
874fi
e31bf7c6
ER
875
876# report what's in them
877for a in REMOVED-*.txt; do
878 cat $a
879done
This page took 0.197667 seconds and 4 git commands to generate.