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