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