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