]> git.pld-linux.org Git - packages/chromium-browser.git/blob - clean-source.sh
- release 2 (by relup.sh)
[packages/chromium-browser.git] / clean-source.sh
1 #!/bin/sh
2 set -xe
3
4 export LC_ALL=C
5
6 # import options
7 # remove everything unless it's remove has been disabled with "0"
8 # "v8=0" means "do not remove v8"
9 eval "$@"
10
11 # Strip tarball from some big directories not needed on the linux platform
12 # https://code.google.com/p/chromium/wiki/LinuxPackaging
13 # initial list from src/tools/export_tarball/export_tarball.py
14 # also removed non-linux files: find -name win -o -name mac -o name android -o name windows
15 # find -type d -name 'android' -o -name 'chromeos' -o -name 'cros'
16 # find -type d -name *doc*
17 # find -type d -name *example*
18 # find -type d -name java
19 # find -type d -name tools
20 # find -type d -name samples
21 # suffix with _ those that we can't remove (just yet) because of the gclient
22 # hooks (see build/all.gyp) or of some unneeded deps/includes
23 remove_nonessential_dirs() {
24         find -type f '(' \
25                 -name 'Android.mk' -o \
26                 -name '*.vcproj' -o \
27                 -name '*.sln' -o \
28                 -name '*.mm' -o \
29                 -name '*.m' \
30         ')' '!' -type d '(' \
31                 '!' -path './remoting/host/continue_window_mac.mm' \
32                 '!' -path './remoting/host/disconnect_window_mac.mm' \
33         ')' \
34                 -print -delete
35
36         find -regextype posix-extended \
37                 -regex '.*_(win|cros|mac)_.*.xtb' \
38         -print -delete
39
40         local dir
41         for dir in \
42         v8/benchmarks \
43         v8/src/arm \
44         third_party/chromite \
45         android_webview \
46         ash/resources/default_100_percent/cros_ \
47         ash/resources/default_200_percent/cros_ \
48         ash/shell/cocoa \
49         ash/system/chromeos_ \
50         base/android \
51         base/chromeos \
52         base/ios \
53         breakpad/src/client/mac \
54         breakpad/src/common/android \
55         breakpad/src/common/mac \
56         breakpad/src/tools/mac \
57         build/mac \
58         build/win_ \
59         chrome/android \
60         chrome/app/android \
61         chrome/app/resources/terms/chromeos \
62         chrome/app/theme/default_100_percent/cros_ \
63         chrome/app/theme/default_100_percent/mac_ \
64         chrome/app/theme/default_100_percent/win_ \
65         chrome/app/theme/default_200_percent/cros_ \
66         chrome/app/theme/default_200_percent/mac \
67         chrome/app/theme/default_200_percent/win_ \
68         chrome/app/theme/touch_100_percent/win \
69         chrome/app/theme/touch_140_percent/win \
70         chrome/app/theme/touch_180_percent/win \
71         chrome/browser/android \
72         chrome/browser/chromeos/cros \
73         chrome/browser/extensions/docs \
74         chrome/browser/history/android \
75         chrome/browser/mac_ \
76         chrome/browser/resources/about_welcome_android \
77         chrome/browser/resources/chromeos_ \
78         chrome/browser/resources/ntp_android \
79         chrome/browser/resources/options/chromeos_ \
80         chrome/browser/resources/shared/css/chromeos \
81         chrome/browser/resources/shared/js/chromeos_ \
82         chrome/browser/ui/android_ \
83         chrome/browser/ui/cocoa \
84         chrome/browser/ui/webui/chromeos \
85         chrome/browser/ui/webui/ntp/android \
86         chrome/browser/ui/webui/options/chromeos \
87         chrome/common/extensions/docs \
88         chrome/common/mac \
89         chrome/installer/mac \
90         chrome/installer/mac/third_party/xz/config/mac \
91         chrome/installer/tools \
92         chrome/third_party/jstemplate/tutorial_examples \
93         third_party/jstemplate/tutorial_examples \
94         chrome/third_party/mock4js/examples \
95         chrome/third_party/wtl/ \
96         chrome/tools/build/chromeos \
97         chrome/tools/build/mac \
98         chrome/tools/build/win \
99         chrome_frame \
100         cloud_print/virtual_driver/win \
101         content/app/android \
102         content/browser/android \
103         content/common/android \
104         content/components/navigation_interception/java \
105         content/components/web_contents_delegate_android/java \
106         content/public/android \
107         content/public/browser/android \
108         content/renderer/android \
109         content/shell/android \
110         content/shell/mac \
111         data \
112         gears \
113         google_update \
114         gpu/command_buffer/docs \
115         gpu/demos \
116         media/audio/android \
117         media/audio/ios \
118         media/audio/mac \
119         media/audio/win \
120         media/tools \
121         media/video/capture/mac \
122         media/video/capture/win \
123         media/webm/chromeos \
124         mesa/MesaLib/src/mesa/drivers/windows \
125         native_client/build/mac \
126         native_client/documentation \
127         native_client/src/shared/imc/win \
128         native_client/src/shared/platform/win \
129         native_client/src/tools \
130         native_client/src/trusted/debug_stub/win \
131         native_client/src/trusted/desc/win \
132         native_client/src/trusted/nonnacl_util/win \
133         native_client/src/trusted/platform_qualify/win \
134         native_client/tools \
135         native_client/tools/trusted_cross_toolchains \
136         native_client_sdk \
137         native_client_sdk/src/libraries/win \
138         net/android \
139         net/tools/testserver \
140         npapi/npspy/windows \
141         o3d \
142         o3d/documentation \
143         o3d/samples \
144         ppapi/c/documentation \
145         ppapi/cpp/documentation \
146         ppapi/native_client/src/tools \
147         ppapi/native_client/src/trusted/plugin/win \
148         ppapi/native_client/tools \
149         remoting/host/installer/mac_ \
150         remoting/host/installer/win \
151         remoting/host/mac_ \
152         remoting/host/setup/win \
153         remoting/host/win_ \
154         rlz/examples \
155         rlz/mac \
156         rlz/win \
157         sandbox/win/tools \
158         sdch/ios \
159         sdch/mac \
160         skia/config/win \
161         sync/tools_ \
162         tcmalloc/chromium/src/windows \
163         tcmalloc/vendor/src/windows \
164         third_party/WebKit/Source/JavaScriptCore/docs \
165         third_party/WebKit/Source/JavaScriptCore/tools \
166         third_party/WebKit/Source/Platform/chromium/public/android \
167         third_party/WebKit/Source/Platform/chromium/public/mac \
168         third_party/WebKit/Source/Platform/chromium/public/win \
169         third_party/WebKit/Source/ThirdParty/gtest/samples \
170         third_party/WebKit/Source/ThirdParty/gyp/samples \
171         third_party/WebKit/Source/ThirdParty/gyp/samples/samples \
172         third_party/WebKit/Source/ThirdParty/gyp/tools \
173         third_party/WebKit/Source/WTF/wtf/mac \
174         third_party/WebKit/Source/WTF/wtf/qt \
175         third_party/WebKit/Source/WTF/wtf/threads/win \
176         third_party/WebKit/Source/WTF/wtf/win \
177         third_party/WebKit/Source/WebCore/WebCore.gyp/mac \
178         third_party/WebKit/Source/WebCore/accessibility/mac \
179         third_party/WebKit/Source/WebCore/accessibility/qt \
180         third_party/WebKit/Source/WebCore/accessibility/win \
181         third_party/WebKit/Source/WebCore/bridge/qt \
182         third_party/WebKit/Source/WebCore/editing/android \
183         third_party/WebKit/Source/WebCore/editing/mac \
184         third_party/WebKit/Source/WebCore/editing/qt \
185         third_party/WebKit/Source/WebCore/history/android \
186         third_party/WebKit/Source/WebCore/history/mac \
187         third_party/WebKit/Source/WebCore/history/qt \
188         third_party/WebKit/Source/WebCore/loader/mac \
189         third_party/WebKit/Source/WebCore/loader/win \
190         third_party/WebKit/Source/WebCore/page/android \
191         third_party/WebKit/Source/WebCore/page/mac \
192         third_party/WebKit/Source/WebCore/page/qt \
193         third_party/WebKit/Source/WebCore/page/scrolling/mac \
194         third_party/WebKit/Source/WebCore/page/win \
195         third_party/WebKit/Source/WebCore/platform/android \
196         third_party/WebKit/Source/WebCore/platform/audio/mac \
197         third_party/WebKit/Source/WebCore/platform/audio/qt \
198         third_party/WebKit/Source/WebCore/platform/cf/win \
199         third_party/WebKit/Source/WebCore/platform/cocoa \
200         third_party/WebKit/Source/WebCore/platform/graphics/ca/mac \
201         third_party/WebKit/Source/WebCore/platform/graphics/ca/win \
202         third_party/WebKit/Source/WebCore/platform/graphics/cocoa \
203         third_party/WebKit/Source/WebCore/platform/graphics/gpu/mac \
204         third_party/WebKit/Source/WebCore/platform/graphics/gpu/qt \
205         third_party/WebKit/Source/WebCore/platform/graphics/mac \
206         third_party/WebKit/Source/WebCore/platform/graphics/qt \
207         third_party/WebKit/Source/WebCore/platform/graphics/surfaces/mac \
208         third_party/WebKit/Source/WebCore/platform/graphics/surfaces/qt \
209         third_party/WebKit/Source/WebCore/platform/graphics/surfaces/win \
210         third_party/WebKit/Source/WebCore/platform/graphics/win \
211         third_party/WebKit/Source/WebCore/platform/ios \
212         third_party/WebKit/Source/WebCore/platform/mac \
213         third_party/WebKit/Source/WebCore/platform/network/android \
214         third_party/WebKit/Source/WebCore/platform/network/mac \
215         third_party/WebKit/Source/WebCore/platform/network/qt \
216         third_party/WebKit/Source/WebCore/platform/network/win \
217         third_party/WebKit/Source/WebCore/platform/qt \
218         third_party/WebKit/Source/WebCore/platform/text/android \
219         third_party/WebKit/Source/WebCore/platform/text/mac \
220         third_party/WebKit/Source/WebCore/platform/text/qt \
221         third_party/WebKit/Source/WebCore/platform/text/win \
222         third_party/WebKit/Source/WebCore/platform/win \
223         third_party/WebKit/Source/WebCore/platform/wx/wxcode/mac \
224         third_party/WebKit/Source/WebCore/platform/wx/wxcode/win \
225         third_party/WebKit/Source/WebCore/plugins/mac \
226         third_party/WebKit/Source/WebCore/plugins/qt \
227         third_party/WebKit/Source/WebCore/plugins/win \
228         third_party/WebKit/Source/WebKit/chromium/public/android \
229         third_party/WebKit/Source/WebKit/chromium/public/platform/android \
230         third_party/WebKit/Source/WebKit/chromium/public/platform/mac \
231         third_party/WebKit/Source/WebKit/chromium/public/platform/win \
232         third_party/WebKit/Source/WebKit/chromium/public/win \
233         third_party/WebKit/Source/WebKit/chromium/src/android \
234         third_party/WebKit/Source/WebKit/chromium/src/mac \
235         third_party/WebKit/Source/WebKit/chromium/src/win \
236         third_party/WebKit/Source/WebKit/gtk/docs \
237         third_party/WebKit/Source/WebKit/mac \
238         third_party/WebKit/Source/WebKit/qt \
239         third_party/WebKit/Source/WebKit/qt/docs \
240         third_party/WebKit/Source/WebKit/qt/examples \
241         third_party/WebKit/Source/WebKit/win \
242         third_party/WebKit/Source/WebKit/wx/bindings/python/samples \
243         third_party/WebKit/Source/WebKit2/Platform/CoreIPC/mac \
244         third_party/WebKit/Source/WebKit2/Platform/CoreIPC/win \
245         third_party/WebKit/Source/WebKit2/Platform/mac \
246         third_party/WebKit/Source/WebKit2/Platform/win \
247         third_party/WebKit/Source/WebKit2/PluginProcess/mac \
248         third_party/WebKit/Source/WebKit2/Shared/API/c/mac \
249         third_party/WebKit/Source/WebKit2/Shared/API/c/win \
250         third_party/WebKit/Source/WebKit2/Shared/Plugins/Netscape/mac \
251         third_party/WebKit/Source/WebKit2/Shared/Plugins/Netscape/win \
252         third_party/WebKit/Source/WebKit2/Shared/Plugins/mac \
253         third_party/WebKit/Source/WebKit2/Shared/cg/win \
254         third_party/WebKit/Source/WebKit2/Shared/mac \
255         third_party/WebKit/Source/WebKit2/Shared/win \
256         third_party/WebKit/Source/WebKit2/UIProcess/API/C/mac \
257         third_party/WebKit/Source/WebKit2/UIProcess/API/C/win \
258         third_party/WebKit/Source/WebKit2/UIProcess/API/mac \
259         third_party/WebKit/Source/WebKit2/UIProcess/Launcher/mac \
260         third_party/WebKit/Source/WebKit2/UIProcess/Launcher/win \
261         third_party/WebKit/Source/WebKit2/UIProcess/Plugins/mac \
262         third_party/WebKit/Source/WebKit2/UIProcess/Plugins/win \
263         third_party/WebKit/Source/WebKit2/UIProcess/mac \
264         third_party/WebKit/Source/WebKit2/UIProcess/win \
265         third_party/WebKit/Source/WebKit2/WebProcess/Authentication/mac \
266         third_party/WebKit/Source/WebKit2/WebProcess/Cookies/mac \
267         third_party/WebKit/Source/WebKit2/WebProcess/Downloads/cf/win \
268         third_party/WebKit/Source/WebKit2/WebProcess/Downloads/mac \
269         third_party/WebKit/Source/WebKit2/WebProcess/FullScreen/mac \
270         third_party/WebKit/Source/WebKit2/WebProcess/FullScreen/win \
271         third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/API/c/win \
272         third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/mac \
273         third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/win \
274         third_party/WebKit/Source/WebKit2/WebProcess/Plugins/Netscape/mac \
275         third_party/WebKit/Source/WebKit2/WebProcess/Plugins/Netscape/win \
276         third_party/WebKit/Source/WebKit2/WebProcess/WebCoreSupport/mac \
277         third_party/WebKit/Source/WebKit2/WebProcess/WebCoreSupport/win \
278         third_party/WebKit/Source/WebKit2/WebProcess/WebPage/ca/mac \
279         third_party/WebKit/Source/WebKit2/WebProcess/WebPage/ca/win \
280         third_party/WebKit/Source/WebKit2/WebProcess/WebPage/mac \
281         third_party/WebKit/Source/WebKit2/WebProcess/WebPage/win \
282         third_party/WebKit/Source/WebKit2/WebProcess/mac \
283         third_party/WebKit/Source/WebKit2/WebProcess/win \
284         third_party/WebKit/Source/WebKit2/mac \
285         third_party/WebKit/Source/WebKit2/win \
286         third_party/WebKit/Tools/DumpRenderTree/mac \
287         third_party/WebKit/Tools/DumpRenderTree/qt \
288         third_party/WebKit/Tools/DumpRenderTree/win \
289         third_party/angle_dx11/extensions \
290         third_party/angle_dx11/samples \
291         third_party/angle_dx11/samples/gles2_book \
292         third_party/boost \
293         third_party/bsdiff \
294         third_party/bspatch \
295         third_party/cacheinvalidation/src/example-app-build \
296         third_party/cacheinvalidation/src/java \
297         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android \
298         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android \
299         third_party/ffmpeg/binaries \
300         third_party/ffmpeg/chromium/binaries/Chromium/win \
301         third_party/ffmpeg/chromium/config/Chrome/linux/arm \
302         third_party/ffmpeg/chromium/config/Chrome/mac \
303         third_party/ffmpeg/chromium/config/Chrome/win \
304         third_party/ffmpeg/chromium/config/ChromeOS/linux/arm \
305         third_party/ffmpeg/chromium/config/Chromium/linux/arm \
306         third_party/ffmpeg/chromium/config/Chromium/mac \
307         third_party/ffmpeg/chromium/config/Chromium/win \
308         third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm \
309         third_party/ffmpeg/chromium/include/win \
310         third_party/ffmpeg/doc_ \
311         third_party/ffmpeg/libavcodec/alpha \
312         third_party/ffmpeg/libavcodec/arm \
313         third_party/ffmpeg/libavcodec/avr32 \
314         third_party/ffmpeg/libavcodec/bfin \
315         third_party/ffmpeg/libavcodec/mips_ \
316         third_party/ffmpeg/libavcodec/ppc \
317         third_party/ffmpeg/libavcodec/sh4 \
318         third_party/ffmpeg/libavcodec/sparc \
319         third_party/ffmpeg/libavresample/arm \
320         third_party/ffmpeg/libavutil/avr32 \
321         third_party/ffmpeg/libavutil/bfin \
322         third_party/ffmpeg/libavutil/mips_ \
323         third_party/ffmpeg/libavutil/ppc \
324         third_party/ffmpeg/libavutil/sh4 \
325         third_party/ffmpeg/libswresample/arm \
326         third_party/ffmpeg/libswscale/bfin \
327         third_party/ffmpeg/libswscale/ppc \
328         third_party/ffmpeg/libswscale/sparc \
329         third_party/ffmpeg/tools \
330         third_party/fuzzymatch \
331         third_party/gles2_book \
332         third_party/gles_book_examples \
333         third_party/gold \
334         third_party/hunspell/dictionaries \
335         third_party/hunspell_dictionaries \
336         third_party/hyphen/doc \
337         third_party/icu/android \
338         third_party/icu/mac \
339         third_party/lcov \
340         third_party/leveldatabase/src/doc \
341         third_party/leveldatabase/src/port/win \
342         third_party/libjingle/source/talk/examples \
343         third_party/libjpeg_turbo/mac \
344         third_party/libjpeg_turbo/win \
345         third_party/libva/va/android \
346         third_party/libvpx/source/config/mac \
347         third_party/libvpx/source/config/win \
348         third_party/libxml/mac \
349         third_party/lighttpd \
350         third_party/mesa/MesaLib/docs \
351         third_party/mesa/MesaLib/src/gallium/docs \
352         third_party/npapi/npspy/extern/java \
353         third_party/nspr \
354         third_party/nss \
355         third_party/ocmock \
356         third_party/openssl/config/android \
357         third_party/ots/tools \
358         third_party/pthread \
359         third_party/pyftpdlib \
360         third_party/re2/doc \
361         third_party/scons \
362         third_party/sfntly/cpp/src/sfntly/tools \
363         third_party/simplejson \
364         third_party/skia/include/utils/android \
365         third_party/skia/include/utils/ios \
366         third_party/skia/include/utils/mac \
367         third_party/skia/include/utils/win \
368         third_party/skia/include/views/android \
369         third_party/skia/src/gpu/gl/android \
370         third_party/skia/src/gpu/gl/mac \
371         third_party/skia/src/gpu/gl/win \
372         third_party/skia/src/utils/ios \
373         third_party/skia/src/utils/mac \
374         third_party/skia/src/utils/win \
375         third_party/skia/src/views/ios \
376         third_party/skia/src/views/mac \
377         third_party/skia/src/views/win \
378         third_party/snappy/mac \
379         third_party/sqlite/src/doc \
380         third_party/tcmalloc/vendor/doc \
381         third_party/trace-viewer/examples \
382         third_party/trace-viewer/third_party/pywebsocket/src/example \
383         third_party/vc_80 \
384         third_party/webdriver/pylib/docs \
385         third_party/webrtc/modules/audio_device/android \
386         third_party/webrtc/modules/audio_device/ios \
387         third_party/webrtc/modules/audio_device/main/source/mac \
388         third_party/webrtc/modules/audio_device/main/source/win \
389         third_party/webrtc/modules/audio_device/win \
390         third_party/webrtc/modules/video_capture/android/java \
391         third_party/webrtc/modules/video_capture/main/source/android \
392         third_party/webrtc/modules/video_render/android/java \
393         third_party/webrtc/modules/video_render/main/source/android \
394         third_party/webrtc/modules/video_render/main/source/mac \
395         third_party/webrtc/system_wrappers/source/android \
396         third_party/yasm/source/config/android \
397         third_party/yasm/source/config/mac \
398         third_party/yasm/source/config/win \
399         tools/android \
400         tools/gyp/samples \
401         tools/gyp/samples/samples \
402         tools/gyp/tools \
403         tools/mac \
404         tools/site_compare \
405         tools/stats_viewer \
406         tools/symsrc \
407         tools/valgrind \
408         tools/win \
409         tools/wine_valgrind \
410         ui/android \
411         ui/base/cocoa \
412         ui/base/ime/win \
413         ui/gfx/android \
414         ui/gfx/mac \
415         ui/resources/default_100_percent/cros_ \
416         ui/resources/default_200_percent/cros_ \
417         ui/views/examples_ \
418         ui/views/win \
419         v8/samples \
420         webkit/chromeos \
421         webkit/media/android \
422         webrtc/modules/video_capture/windows \
423         webrtc/modules/video_render/windows \
424         win8 \
425         ; do
426                 rm -vfr "$dir"
427         done
428
429         find $(ls -d \
430                 base/mac \
431                 base/win \
432                 build/android \
433                 chrome/browser/chromeos_ \
434                 v8/src/d8* \
435                 chrome/browser/component/web_contents_delegate_android \
436                 chrome/tools \
437                 chromeos_ \
438                 cloud_print/service/win \
439                 content/browser/renderer_host/java \
440                 content/common/mac \
441                 content/renderer/java \
442                 gpu/tools \
443                 media/base/android_ \
444                 native_client/src/include/win \
445                 native_client/src/trusted/service_runtime/win \
446                 net/tools \
447                 remoting/tools \
448                 sandbox/win \
449                 third_party/WebKit/Source/WebKit/chromium/public/mac \
450                 third_party/WebKit/Tools \
451                 third_party/cld/encodings/compact_lang_det/win \
452                 third_party/cros_system_api \
453                 third_party/mozc/chrome/chromeos \
454                 third_party/sfntly/cpp/src/sample \
455                 third_party/tcmalloc \
456                 third_party/v8-i18n/tools \
457                 third_party/webrtc/modules/video_coding/codecs/tools \
458                 third_party/webrtc/tools \
459                 ui/base/win \
460                 v8/tools_ \
461                 webkit/tools \
462         ) '!' -type d '(' \
463                 '!' -name '*.grd' \
464                 '!' -name '*.gyp*' \
465                 '!' -name '*.isolate' \
466                 '!' -path 'base/mac/bundle_locations.h' \
467                 '!' -path 'base/mac/crash_logging.h' \
468                 '!' -path 'base/win/windows_version.h' \
469                 '!' -path 'chrome/browser/chromeos/attestation/platform_verification_flow.h' \
470                 '!' -path 'chrome/browser/chromeos/contacts/contact.proto' \
471                 '!' -path 'chrome/browser/chromeos/extensions/*.h' \
472                 '!' -path 'chrome/browser/chromeos/extensions/echo_private_api.h' \
473                 '!' -path 'chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h' \
474                 '!' -path 'chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_functions.h' \
475                 '!' -path 'chrome/browser/chromeos/extensions/info_private_api.h' \
476                 '!' -path 'chrome/browser/chromeos/extensions/media_player_api.h' \
477                 '!' -path 'chrome/browser/chromeos/extensions/networking_private_api.h' \
478                 '!' -path 'chrome/browser/chromeos/extensions/wallpaper_api.h' \
479                 '!' -path 'chrome/browser/chromeos/extensions/wallpaper_private_api.h' \
480                 '!' -path 'chrome/browser/chromeos/settings/cros_settings.h' \
481                 '!' -path 'chrome/browser/chromeos/settings/cros_settings_names.h' \
482                 '!' -path 'chrome/browser/chromeos/settings/cros_settings_provider.h' \
483                 '!' -path 'chrome/browser/chromeos/settings/device_settings_service.h' \
484                 '!' -path 'chrome/browser/chromeos/system_logs/*.h' \
485                 '!' -path 'chrome/tools/build/generate_policy_source.py' \
486                 '!' -path 'chrome/tools/build/linux/sed.sh' \
487                 '!' -path 'chrome/tools/build/make_version_cc.py' \
488                 '!' -path 'chrome/tools/build/repack_locales.py' \
489                 '!' -path 'chrome/tools/build/version.py' \
490                 '!' -path 'chromeos/chromeos_constants.h' \
491                 '!' -path 'chromeos/chromeos_export.h' \
492                 '!' -path 'chromeos/chromeos_switches.h' \
493                 '!' -path 'chromeos/dbus/dbus_client_implementation_type.h' \
494                 '!' -path 'chromeos/dbus/dbus_method_call_status.h' \
495                 '!' -path 'chromeos/dbus/session_manager_client.h' \
496                 '!' -path 'chromeos/network/network_state_handler_observer.h' \
497                 '!' -path 'chromeos/network/onc/onc_constants.h' \
498                 '!' -path 'content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h' \
499                 '!' -path 'content/common/mac/attributed_string_coder.h' \
500                 '!' -path 'content/common/mac/font_descriptor.h' \
501                 '!' -path 'content/renderer/java/java_bridge_dispatcher.h' \
502                 '!' -path 'media/base/android/demuxer_android.h' \
503                 '!' -path 'native_client/src/include/win/mman.h' \
504                 '!' -path 'native_client/src/trusted/service_runtime/win/debug_exception_handler.h' \
505                 '!' -path 'native_client/src/trusted/service_runtime/win/exception_patch/ntdll_patch.h' \
506                 '!' -path 'net/tools/tld_cleanup/*' \
507                 '!' -path 'remoting/tools/build/*' \
508                 '!' -path 'remoting/tools/verify_resources.py' \
509                 '!' -path 'sandbox/win/src/sandbox_types.h' \
510                 '!' -path 'third_party/WebKit/Source/WebKit/chromium/public/mac/WebSubstringUtil.h' \
511                 '!' -path 'third_party/cld/encodings/compact_lang_det/win/cld_*.cc' \
512                 '!' -path 'third_party/cld/encodings/compact_lang_det/win/cld_*.h' \
513                 '!' -path 'third_party/cros_system_api/dbus/*.proto' \
514                 '!' -path 'third_party/cros_system_api/dbus/service_constants.h' \
515                 '!' -path 'third_party/sfntly/cpp/src/sample/chromium/*' \
516                 '!' -path 'third_party/tcmalloc/chromium/*' \
517                 '!' -path 'third_party/v8-i18n/tools/js2c.py' \
518                 '!' -path 'third_party/webrtc/tools/tools_unittests.isolate' \
519                 '!' -path 'ui/base/win/dpi.h' \
520                 '!' -path 'ui/webui/resources/js/webui_resource_test.js' \
521                 '!' -path 'v8/tools/js2c.py' \
522                 '!' -path 'v8/tools/jsmin.py' \
523                 '!' -path 'webkit/tools/test_shell/*.h' \
524                 ')' \
525         -print -delete
526 }
527
528 # There are directories we want to strip, but that are unnecessarily required by the build-system
529 # So we drop everything but the gyp/gypi files
530 almost_strip_dirs() {
531         local dir
532         for dir in \
533                 breakpad_ \
534                 build/ios \
535                 courgette_ \
536                 third_party/cros_dbus_cplusplus \
537                 ; do
538                 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
539         done
540
541         find tools -type f \
542                 '!' -iname '*.gyp*' \
543                 '!' -path 'tools/build/*' \
544                 '!' -path 'tools/clang/scripts/plugin_flags.sh' \
545                 '!' -path 'tools/compile_test/compile_test.py' \
546                 '!' -path 'tools/generate_library_loader/*' \
547                 '!' -path 'tools/generate_shim_headers/generate_shim_headers.py' \
548                 '!' -path 'tools/generate_stubs/*' \
549                 '!' -path 'tools/grit/*' \
550                 '!' -path 'tools/gritsettings/*' \
551                 '!' -path 'tools/gyp/*' \
552                 '!' -path 'tools/idl_parser/*' \
553                 '!' -path 'tools/json_comment_eater/json_comment_eater.py' \
554                 '!' -path 'tools/json_schema_compiler/*' \
555                 '!' -path 'tools/json_to_struct/*' \
556                 '!' -path 'tools/licenses.py' \
557                 '!' -path 'tools/protoc_wrapper/*' \
558                 '!' -path 'tools/usb_ids/*' \
559                 '!' -path 'tools/uuidgen.py' \
560                 '!' -path 'tools/zip2msi.py' \
561                 -print -delete
562 }
563
564 # clean third party
565 # list based from archlinux PKGBUILD
566 # https://aur.archlinux.org/packages/ch/chromium-dev/PKGBUILD
567 clean_third_party() {
568
569         # NOTE: don't forget to sync remove_bundled_libraries() {
570
571         local dir
572         for dir in \
573                 third_party/ashmem \
574                 third_party/eyesfree \
575                 third_party/guava \
576                 third_party/iaccessible2 \
577                 third_party/icon_family \
578                 third_party/isimpledom \
579                 third_party/jsr-305 \
580                 third_party/mach_override \
581                 third_party/npapi/npspy \
582                 third_party/re2/benchlog \
583                 third_party/sqlite/*.patch \
584                 third_party/sqlite/src/*.patch \
585                 third_party/sudden_motion_sensor \
586                 ; do
587                 rm -vfr "$dir"
588         done
589
590         find third_party -type f \
591                 '!' -iname '*.gyp*' \
592                 '!' -iname '*.isolate' \
593                 '!' -path 'third_party/WebKit/*' \
594                 '!' -path 'third_party/adobe/flash/*' \
595                 '!' -path 'third_party/angle/enumerate_files.py' \
596                 '!' -path 'third_party/angle/include/EGL/*' \
597                 '!' -path 'third_party/angle/include/GLSLANG/*' \
598                 '!' -path 'third_party/angle/include/*.h' \
599                 '!' -path 'third_party/angle/src/*' \
600                 '!' -path 'third_party/angle/src/common/*' \
601                 '!' -path 'third_party/angle/src/compiler/*' \
602                 '!' -path 'third_party/angle/src/enumerate_files.py' \
603                 '!' -path 'third_party/angle/src/third_party/compiler/*' \
604                 '!' -path 'third_party/brotli/*' \
605                 '!' -path 'third_party/cacheinvalidation/*' \
606                 '!' -path 'third_party/cld/*' \
607                 '!' -path 'third_party/cld_2/*' \
608                 '!' -path 'third_party/cros_system_api/*' \
609                 '!' -path 'third_party/dom_distiller_js/*' \
610                 '!' -path 'third_party/ffmpeg/*' \
611                 '!' -path 'third_party/fips181/*' \
612                 '!' -path 'third_party/flot/*.js' \
613                 '!' -path 'third_party/hunspell/*' \
614                 '!' -path 'third_party/hyphen/*' \
615                 '!' -path 'third_party/iccjpeg/*' \
616                 '!' -path 'third_party/icu/icu.isolate' \
617                 '!' -path 'third_party/jinja2/*' \
618                 '!' -path 'third_party/jstemplate/*' \
619                 '!' -path 'third_party/khronos/*' \
620                 '!' -path 'third_party/leveldatabase/*' \
621                 '!' -path 'third_party/libXNVCtrl/*' \
622                 '!' -path 'third_party/libaddressinput/*' \
623                 '!' -path 'third_party/libjingle/*' \
624                 '!' -path 'third_party/libphonenumber/*' \
625                 '!' -path 'third_party/libusb/*' \
626                 '!' -path 'third_party/libva/*' \
627                 '!' -path 'third_party/libvpx/*' \
628                 '!' -path 'third_party/libwebm/*' \
629                 '!' -path 'third_party/libwebp/*' \
630                 '!' -path 'third_party/libxml/chromium/*' \
631                 '!' -path 'third_party/libyuv/*' \
632                 '!' -path 'third_party/lss/*.h' \
633                 '!' -path 'third_party/lzma_sdk/*' \
634                 '!' -path 'third_party/markupsafe/*' \
635                 '!' -path 'third_party/mesa/src/include/GL/gl.h' \
636                 '!' -path 'third_party/mesa/src/include/GL/glext.h' \
637                 '!' -path 'third_party/mesa/src/include/GL/glx.h' \
638                 '!' -path 'third_party/mesa/src/include/GL/glxext.h' \
639                 '!' -path 'third_party/mesa/src/include/GL/osmesa.h' \
640                 '!' -path 'third_party/modp_b64/*' \
641                 '!' -path 'third_party/mt19937ar/*' \
642                 '!' -path 'third_party/npapi/*' \
643                 '!' -path 'third_party/ots/*' \
644                 '!' -path 'third_party/pdfium/*' \
645                 '!' -path 'third_party/ply/*' \
646                 '!' -path 'third_party/polymer/*' \
647                 '!' -path 'third_party/polymer_legacy/*' \
648                 '!' -path 'third_party/protobuf/*' \
649                 '!' -path 'third_party/qcms/*' \
650                 '!' -path 'third_party/re2/*' \
651                 '!' -path 'third_party/readability/*' \
652                 '!' -path 'third_party/sfntly/*' \
653                 '!' -path 'third_party/skia/*' \
654                 '!' -path 'third_party/smhasher/*' \
655                 '!' -path 'third_party/snappy/*' \
656                 '!' -path 'third_party/sqlite/amalgamation/*' \
657                 '!' -path 'third_party/sqlite/sqlite3.h' \
658                 '!' -path 'third_party/sqlite/src/ext/*' \
659                 '!' -path 'third_party/tcmalloc/*' \
660                 '!' -path 'third_party/trace-viewer/*' \
661                 '!' -path 'third_party/undoview/*' \
662                 '!' -path 'third_party/usrsctp/*' \
663                 '!' -path 'third_party/v8-i18n/*' \
664                 '!' -path 'third_party/v8/*' \
665                 '!' -path 'third_party/webrtc/*' \
666                 '!' -path 'third_party/widevine/*' \
667                 '!' -path 'third_party/x86inc/*' \
668                 '!' -path 'third_party/zlib/google/*' \
669                 '!' -path 'third_party/zlib/zlib.h' \
670                 \
671                 '!' -path 'third_party/jinja2/*' \
672                 '!' -path 'third_party/libvpx/*' \
673                 '!' -path 'third_party/markupsafe/*' \
674                 '!' -path 'third_party/opus/*' \
675                 -print -delete
676
677         rm -vf third_party/expat/files/lib/expat.h
678 }
679
680 # parts based on ubuntu debian/rules
681 # http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules
682 remove_bin_only() {
683         # preserve: ui/keyboard/resources/roboto_bold.ttf
684         find -type f \( \
685                 -iname \*.exe -o \
686                 -iname \*.nexe -o \
687                 -iname \*.fon -o \
688                 -iname \*.ttf_  -o \
689                 -iname \*.dll -o \
690                 -iname \*.pdb -o \
691                 -name \*.o -o \
692                 -name \*.a -o \
693                 -name \*.dylib \
694         \) -exec rm -fv {} \;
695 }
696
697 # removes dir, if the bcond is not turned off
698 strip_system_dirs() {
699         local dir lib bcond args
700         # prevent "*" from being expanded in $args
701         set -f
702         for dir in "$@"; do
703                 args=${dir#* }
704                 test "$args" = "$dir" && args=
705                 dir=${dir%% *}
706                 lib=${dir##*/}
707                 bcond=$(eval echo \$$lib)
708                 [ "${bcond:-1}" = 0 ] && continue
709
710                 # skip already removed dirs
711                 test -d $dir || continue
712
713                 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' -o -name '*.isolate' -o -path $dir/$lib.h $args ')' -print -delete || :
714         done
715         set +f
716 }
717
718 # remove test data and files
719 # some scanned with find -name tests -o -name test -o -name test_data -o name testdata
720 # and find -iname *test*
721 remove_tests() {
722         local dir
723
724         echo '> full remove'
725         for dir in \
726         ash/test \
727         base/test_ \
728         breakpad/src/client/windows/tests \
729         breakpad/src/common/linux/tests \
730         breakpad/src/common/tests \
731         cc/test \
732         chrome/browser/chromeos/bluetooth/test \
733         chrome/browser/component_updater/test \
734         chrome/browser/extensions/api/test_ \
735         chrome/browser/printing/cloud_print/test \
736         chrome/browser/resources/gaia_auth/test_ \
737         chrome/browser/resources/tracing/tests \
738         chrome/browser/sync/test \
739         chrome/browser/ui/cocoa/test \
740         chrome/browser/ui/gtk/test \
741         chrome/browser/ui/tests \
742         chrome/browser/ui/views/test \
743         chrome/installer/test \
744         chrome/test/chromeos \
745         chrome/test/data/firefox2_nss_mac \
746         chrome/test/data/safe_browsing/old \
747         chrome/test/logging/win \
748         chrome/test/pyautolib/chromeos \
749         chrome/test/webdriver/test \
750         chrome/test_ \
751         chrome/tools/test \
752         chrome_frame/test \
753         chrome_frame/tools/test \
754         content/browser/worker_host/test \
755         content/common/gpu/testdata \
756         content/public/test_ \
757         content/test \
758         courgette/testdata \
759         device/bluetooth/test \
760         device/test \
761         gpu/command_buffer/tests \
762         media/test \
763         media/tools/layout_tests/test_data \
764         native_client/buildbot \
765         native_client/src/shared/platform/testdata \
766         native_client/src/trusted/gio/testdata \
767         native_client/src/trusted/interval_multiset/testdata \
768         native_client/src/trusted/service_runtime/testdata \
769         native_client/src/trusted/validator/x86/decoder/generator/testdata \
770         native_client/src/trusted/validator/x86/testing \
771         native_client/src/trusted/validator_arm/testdata \
772         native_client/src/trusted/validator_mips/testdata \
773         native_client/src/trusted/validator_x86/testdata \
774         native_client/tests \
775         native_client/tools/testdata \
776         native_client/tools/tests \
777         native_client_sdk/src/build_tools/tests \
778         native_client_sdk/src/libraries/c_salt/test \
779         net/test \
780         o3d/tests \
781         ppapi/native_client/tests \
782         ppapi/tests_ \
783         printing/test \
784         rlz/test \
785         sandbox/linux/seccomp-legacy/tests \
786         sandbox/linux/tests \
787         sandbox/tests \
788         sandbox/win/tests \
789         sdch/open-vcdiff/testdata \
790         seccompsandbox/tests \
791         sync/internal_api/public/test \
792         sync/internal_api/test \
793         sync/test \
794         testing/android \
795         testing/gmock/scripts/test \
796         testing/gmock/test \
797         testing/gtest/scripts/test \
798         testing/gtest/test \
799         third_party/WebKit/LayoutTests \
800         third_party/WebKit/Source/JavaScriptCore/API/tests \
801         third_party/WebKit/Source/JavaScriptCore/qt/tests \
802         third_party/WebKit/Source/JavaScriptCore/tests \
803         third_party/WebKit/Source/ThirdParty/gtest/scripts/test \
804         third_party/WebKit/Source/ThirdParty/gtest/test \
805         third_party/WebKit/Source/ThirdParty/gyp/test \
806         third_party/WebKit/Source/ThirdParty/qunit/test \
807         third_party/WebKit/Source/WebCore/bindings/scripts/test \
808         third_party/WebKit/Source/WebCore/testing_ \
809         third_party/WebKit/Source/WebKit/chromium/tests \
810         third_party/WebKit/Source/WebKit/efl/tests \
811         third_party/WebKit/Source/WebKit/gtk/tests \
812         third_party/WebKit/Source/WebKit/qt/tests \
813         third_party/WebKit/Source/WebKit2/UIProcess/API/efl/tests \
814         third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/tests \
815         third_party/WebKit/Source/WebKit2/UIProcess/API/qt/tests \
816         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/mac \
817         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/win \
818         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/mac \
819         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/win \
820         third_party/WebKit/Tools/Scripts/webkitpy/test \
821         third_party/WebKit/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac \
822         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit/win \
823         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/mac \
824         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/win \
825         third_party/WebKit/Tools/TestWebKitAPI/Tests/mac \
826         third_party/WebKit/Tools/TestWebKitAPI/mac \
827         third_party/WebKit/Tools/TestWebKitAPI/win \
828         third_party/angle_dx11/tests \
829         third_party/cacheinvalidation/files/src/google/cacheinvalidation/test \
830         third_party/cacheinvalidation/src/google/cacheinvalidation/test \
831         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing \
832         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing/android \
833         third_party/ffmpeg/tests_ \
834         third_party/harfbuzz/tests \
835         third_party/hunspell/tests \
836         third_party/hyphen/tests \
837         third_party/libexif/sources/test \
838         third_party/libjingle/source/talk/app/webrtc/test \
839         third_party/libjingle/source/talk/media/testdata \
840         third_party/libphonenumber/src/resources/test \
841         third_party/libphonenumber/src/test \
842         third_party/libsrtp/srtp/crypto/test \
843         third_party/libsrtp/srtp/test \
844         third_party/libyuv/unit_test/testdata \
845         third_party/mesa/MesaLib/src/gallium/tests \
846         third_party/openssl/openssl/crypto/des/t/test \
847         third_party/openssl/openssl/test \
848         third_party/ots/test \
849         third_party/protobuf/src/google/protobuf/testdata \
850         third_party/protobuf/src/google/protobuf/testing \
851         third_party/re2/re2/testing \
852         third_party/safe_browsing/testing \
853         third_party/sfntly/cpp/src/test \
854         third_party/sqlite/src/test \
855         third_party/sqlite/test \
856         third_party/talloc/libreplace/test \
857         third_party/tcmalloc/chromium/src/tests \
858         third_party/tcmalloc/vendor/src/tests \
859         third_party/tlslite/test \
860         third_party/trace-viewer/test_data \
861         third_party/trace-viewer/third_party/pywebsocket/src/test \
862         third_party/trace-viewer/third_party/pywebsocket/src/test/testdata \
863         third_party/v8-i18n/tests \
864         third_party/webdriver/pylib/test \
865         third_party/webdriver/test_data \
866         third_party/webrtc/modules/audio_device/test/android \
867         third_party/webrtc/modules/audio_processing/test/android \
868         third_party/webrtc/modules/utility/test \
869         third_party/webrtc/modules/video_capture/main/test/android \
870         third_party/webrtc/system_wrappers/test \
871         third_party/webrtc/test/manual \
872         third_party/webrtc/test/testsupport/mac \
873         third_party/webrtc/video_engine/test/auto_test/android \
874         third_party/webrtc/voice_engine/test/android \
875         third_party/xdg-utils/tests \
876         third_party/yasm/source/patched-yasm/libyasm/tests \
877         third_party/yasm/source/patched-yasm/modules/arch/lc3b/tests \
878         third_party/yasm/source/patched-yasm/modules/arch/x86/tests \
879         third_party/yasm/source/patched-yasm/modules/dbgfmts/dwarf2/tests \
880         third_party/yasm/source/patched-yasm/modules/dbgfmts/stabs/tests \
881         third_party/yasm/source/patched-yasm/modules/objfmts/bin/tests \
882         third_party/yasm/source/patched-yasm/modules/objfmts/coff/tests \
883         third_party/yasm/source/patched-yasm/modules/objfmts/elf/tests \
884         third_party/yasm/source/patched-yasm/modules/objfmts/macho/tests \
885         third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests \
886         third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests \
887         third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests \
888         third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests \
889         third_party/yasm/source/patched-yasm/modules/parsers/gas/tests \
890         third_party/yasm/source/patched-yasm/modules/parsers/nasm/tests \
891         third_party/yasm/source/patched-yasm/modules/parsers/tasm/tests \
892         third_party/yasm/source/patched-yasm/modules/preprocs/nasm/tests \
893         third_party/yasm/source/patched-yasm/modules/preprocs/raw/tests \
894         third_party/yasm/source/patched-yasm/tools/python-yasm/tests \
895         third_party/zlib/google/test \
896         tools/clang/plugins/tests \
897         tools/grit/grit/testdata \
898         tools/gyp/test \
899         tools/gyp/tools/emacs/testdata \
900         tools/page_cycler/webpagereplay/tests \
901         tools/perf_expectations/tests \
902         tools/swarm_client/tests \
903         ui/app_list/test \
904         ui/aura/test \
905         ui/base/test \
906         ui/compositor/test \
907         ui/gfx/test \
908         ui/test \
909         ui/views/test \
910         v8/test \
911         webkit/compositor_bindings/test \
912         webkit/data/layout_tests \
913         webkit/plugins/npapi/test \
914         webkit/tools/test/reference_build \
915         webkit/tools/test_shell/mac \
916         ; do
917                 rm -vfr "$dir"
918         done
919
920         echo '> partial remove (keep .gyp)'
921         for dir in \
922                 chrome/browser/nacl_host/test \
923                 chrome/test/data \
924                 testing/gtest_ \
925                 testing/gtest_ios \
926                 testing/gmock_ \
927                 third_party/webrtc/modules/audio_coding/codecs/cng/test \
928                 third_party/webrtc/modules/audio_coding/codecs/g711/test \
929                 third_party/webrtc/modules/audio_coding/codecs/g722/test \
930                 third_party/webrtc/modules/audio_coding/codecs/ilbc/test \
931                 third_party/webrtc/modules/audio_coding/codecs/isac/fix/test \
932                 third_party/webrtc/modules/audio_coding/codecs/isac/main/test \
933                 third_party/webrtc/modules/audio_coding/main/test \
934                 third_party/webrtc/modules/audio_coding/neteq/test \
935                 third_party/webrtc/modules/audio_conference_mixer/test \
936                 third_party/webrtc/modules/audio_device/test \
937                 third_party/webrtc/modules/audio_processing/test \
938                 third_party/webrtc/modules/rtp_rtcp/test \
939                 third_party/webrtc/modules/udp_transport/test \
940                 third_party/webrtc/modules/video_capture/main/test \
941                 third_party/webrtc/modules/video_coding/codecs/test \
942                 third_party/webrtc/modules/video_coding/codecs/vp8/test \
943                 third_party/webrtc/modules/video_coding/main/test \
944                 third_party/webrtc/modules/video_processing/main/test \
945                 third_party/webrtc/modules/video_render/main/test \
946                 third_party/webrtc/video_engine/test_ \
947                 third_party/webrtc/voice_engine/test \
948                 tools/json_schema_compiler/test \
949                 ; do
950                 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
951         done
952
953         # link headers from system dir. too many files to patch, we don't even build tests
954 #       install -d testing/gtest/include
955 #       ln -s /usr/include/gtest testing/gtest/include/gtest
956
957         # fast exit. as this requires fine-tuning
958         return
959
960         echo '> delete unittest files'
961         find . '(' \
962                 -name '*_unittest*.*' -o \
963                 -name '*_unittest.*' -o \
964                 -name '*_unittest' -o \
965                 -name 'test_*.*' -o \
966                 -name '*_test.*' -o \
967                 -path './testing/' \
968         ')' '!' -type d '(' \
969                 '!' -name '*.grd' \
970                 '!' -name '*.gyp*' \
971                 '!' -name '*.isolate' \
972                 '!' -path './base/test/*' \
973                 '!' -path './base/test/launcher/*' \
974                 '!' -path './base/test/launcher/test_launcher.*' \
975                 '!' -path './base/test/launcher/test_result.*' \
976                 '!' -path './cc/debug/*' \
977                 '!' -path './cc/debug/test_context_provider.h' \
978                 '!' -path './cc/debug/test_web_graphics_context_3d.h' \
979                 '!' -path './chrome/browser/diagnostics/diagnostics_test.*' \
980                 '!' -path './chrome/browser/extensions/api/declarative/test_rules_registry.*' \
981                 '!' -path './chrome/browser/extensions/api/test/test_api.*' \
982                 '!' -path './chrome/browser/resources/gaia_auth/manifest_test.json' \
983                 '!' -path './extensions/renderer/resources/test_custom_bindings.js' \
984                 '!' -path './sync/internal_api/attachments/attachment_service_proxy_for_test.cc' \
985                 '!' -path './net/base/registry_controlled_domains/effective_tld_names_unittest1.gperf' \
986                 '!' -path './chrome/browser/resources/net_internals/*' \
987                 '!' -path './chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.*' \
988                 '!' -path './chrome/browser/ui/webui/test_chrome_web_ui_controller_factory*' \
989                 '!' -path './chrome/common/net/test_server_locations.*' \
990                 '!' -path './chrome/renderer/resources/extensions/test_custom_bindings.js' \
991                 '!' -path './chrome/test/base/test_switches.*' \
992                 '!' -path './chrome/test/perf/browser_perf_test.*' \
993                 '!' -path './chrome/test/perf/perf_test.*' \
994                 '!' -path './content/public/test/test_utils.h' \
995                 '!' -path './extensions/browser/api/test/test_api.*' \
996                 '!' -path './extensions/renderer/test_features_native_handler.*' \
997                 '!' -path './media/cast/rtcp/test_rtcp_packet_builder.*' \
998                 '!' -path './native_client/src/trusted/fault_injection/test_injection.*' \
999                 '!' -path './native_client/src/trusted/service_runtime/env_cleanser_test.h' \
1000                 '!' -path './net/base/test_completion_callback.*' \
1001                 '!' -path './net/base/test_data_stream.*' \
1002                 '!' -path './net/cert/test_root_certs*' \
1003                 '!' -path './remoting/base/resources_unittest.*' \
1004                 '!' -path './sync/api/attachments/attachment_service_proxy_for_test.*' \
1005                 '!' -path './testing/*' \
1006                 '!' -path './testing/perf/perf_test.*' \
1007                 '!' -path './third_party/skia/src/gpu/gr_unittests.*' \
1008                 '!' -path './third_party/trace-viewer/src/base/unittest/test_error.js' \
1009                 '!' -path './third_party/trace-viewer/src/tracing/test_utils.js' \
1010                 '!' -path './third_party/trace-viewer/third_party/tvcm/src/tvcm/unittest/*.js' \
1011                 '!' -path './third_party/trace-viewer/third_party/tvcm/src/tvcm/unittest/test_case.js' \
1012                 '!' -path './third_party/trace-viewer/third_party/tvcm/src/tvcm/unittest/test_error.js' \
1013                 '!' -path './third_party/trace-viewer/third_party/tvcm/src/tvcm/unittest/test_runner.js' \
1014                 '!' -path './third_party/trace-viewer/trace_viewer/tracing/test_utils.js' \
1015                 '!' -path './mojo/embedder/test_embedder.*' \
1016                 '!' -path './ui/base/hit_test.*' \
1017                 '!' -path './tools/compile_test/compile_test.py' \
1018                 '!' -path './tools/compile_test/compile_test.py' \
1019                 '!' -path './ui/compositor/test_web_graphics_context_3d.*' \
1020                 '!' -path './ui/webui/resources/js/webui_resource_test.js' \
1021                 '!' -path './webkit/browser/fileapi/*.cc' \
1022                 '!' -path './webkit/browser/fileapi/*.h' \
1023                 '!' -path './webkit/common/gpu/test_context_provider_factory.*' \
1024                 '!' -path './webkit/gpu/test_context_provider_factory.*' \
1025                 '!' -path './webkit/support/test_webkit_platform_support.h' \
1026                 '!' -path './webkit/tools/test_shell/*.h' \
1027         ')' \
1028                 -print -delete || :
1029 }
1030
1031 # Remove most bundled libraries. Some are still needed.
1032 # Sync this with gentoo/chromium-*.ebuild
1033 # NOTE: argument list to script specifies paths to preserve
1034 remove_bundled_libraries() {
1035         # ninja: error: '../../third_party/jinja2/__init__.py', needed by 'gen/blink/InternalSettingsGenerated.idl', missing and no known rule to make it
1036         # ninja: error: '../../third_party/markupsafe/__init__.py', needed by 'gen/blink/InternalSettingsGenerated.idl', missing and no known rule to make it
1037
1038         # NOTE: don't forget to sync clean_third_party()
1039
1040         build/linux/unbundle/remove_bundled_libraries.py \
1041                 third_party/adobe/flash/flapper_version.h \
1042                 third_party/jinja2 \
1043                 third_party/markupsafe/ \
1044                 third_party/ply \
1045                 third_party/fips181 \
1046                 'base/third_party/dmg_fp' \
1047                 'base/third_party/dynamic_annotations' \
1048                 'base/third_party/icu' \
1049                 'base/third_party/nspr' \
1050                 'base/third_party/superfasthash' \
1051                 'base/third_party/symbolize' \
1052                 'base/third_party/valgrind' \
1053                 'base/third_party/xdg_mime' \
1054                 'base/third_party/xdg_user_dirs' \
1055                 'breakpad/src/third_party/curl' \
1056                 'chrome/third_party/mozilla_security_manager' \
1057                 'courgette/third_party' \
1058                 'crypto/third_party/nss' \
1059                 'net/third_party/mozilla_security_manager' \
1060                 'net/third_party/nss' \
1061                 'third_party/WebKit' \
1062                 'third_party/angle' \
1063                 'third_party/angle/src/third_party/compiler' \
1064                 'third_party/brotli' \
1065                 'third_party/cacheinvalidation' \
1066                 'third_party/cld_2' \
1067                 'third_party/cros_system_api' \
1068                 'third_party/dom_distiller_js' \
1069                 'third_party/dom_distiller_js/package/proto_gen/third_party/dom_distiller_js' \
1070                 'third_party/ffmpeg' \
1071                 'third_party/flot' \
1072                 'third_party/hunspell' \
1073                 'third_party/iccjpeg' \
1074                 'third_party/jstemplate' \
1075                 'third_party/khronos' \
1076                 'third_party/leveldatabase' \
1077                 'third_party/libXNVCtrl' \
1078                 'third_party/libaddressinput' \
1079                 'third_party/libjingle' \
1080                 'third_party/libphonenumber' \
1081                 'third_party/libsrtp' \
1082                 'third_party/libusb' \
1083                 'third_party/libvpx' \
1084                 'third_party/libvpx/source/libvpx/third_party/x86inc' \
1085                 'third_party/libwebm' \
1086                 'third_party/libxml/chromium' \
1087                 'third_party/libyuv' \
1088                 'third_party/lss' \
1089                 'third_party/lzma_sdk' \
1090                 'third_party/mesa' \
1091                 'third_party/modp_b64' \
1092                 'third_party/mt19937ar' \
1093                 'third_party/npapi' \
1094                 'third_party/opus' \
1095                 'third_party/ots' \
1096                 'third_party/pdfium' \
1097                 'third_party/pdfium/third_party/logging.h' \
1098                 'third_party/pdfium/third_party/macros.h' \
1099                 'third_party/pdfium/third_party/numerics' \
1100                 'third_party/pdfium/third_party/template_util.h' \
1101                 'third_party/polymer' \
1102                 'third_party/protobuf' \
1103                 'third_party/qcms' \
1104                 'third_party/readability' \
1105                 'third_party/sfntly' \
1106                 'third_party/skia' \
1107                 'third_party/smhasher' \
1108                 'third_party/sqlite' \
1109                 'third_party/tcmalloc' \
1110                 'third_party/tlslite' \
1111                 'third_party/trace-viewer' \
1112                 'third_party/trace-viewer/third_party/jszip' \
1113                 'third_party/trace-viewer/third_party/tvcm' \
1114                 'third_party/trace-viewer/third_party/tvcm/third_party/d3' \
1115                 'third_party/trace-viewer/third_party/tvcm/third_party/gl-matrix' \
1116                 'third_party/trace-viewer/third_party/tvcm/third_party/polymer' \
1117                 'third_party/undoview' \
1118                 'third_party/usrsctp' \
1119                 'third_party/webdriver' \
1120                 'third_party/webrtc' \
1121                 'third_party/widevine' \
1122                 'third_party/x86inc' \
1123                 'third_party/zlib/google' \
1124                 'third_party/zlib' \
1125                 'url/third_party/mozilla' \
1126                 'v8/src/third_party/kernel' \
1127                 'v8/src/third_party/valgrind' \
1128                 'v8/third_party/fdlibm' \
1129                 --do-print \
1130                 --do-remove
1131 }
1132
1133 remove_bundled_libraries > REMOVED-bundled_libraries.txt
1134
1135 strip_system_dirs \
1136         native_client/src/third_party_mod/jsoncpp \
1137         third_party/bzip2 \
1138         third_party/ffmpeg_ \
1139         third_party/flac \
1140         third_party/icu_ \
1141         third_party/jsoncpp \
1142         third_party/libXNVCtrl \
1143         third_party/libevent \
1144         third_party/libexif \
1145         third_party/libjpeg \
1146         third_party/libmtp \
1147         third_party/libpng \
1148         third_party/libsrtp \
1149         third_party/libusb_ \
1150         third_party/libvpx_ \
1151         third_party/libwebp \
1152         third_party/libxslt \
1153         third_party/mesa \
1154         third_party/opus_ \
1155         third_party/protobuf_ \
1156         third_party/re2 \
1157         third_party/snappy \
1158         third_party/speex \
1159         third_party/sqlite \
1160         third_party/yasm \
1161         "third_party/zlib -o -path third_party/zlib/google/*" \
1162         v8 \
1163 > REMOVED-system_dirs.txt
1164 remove_nonessential_dirs > REMOVED-nonessential_dirs.txt
1165 almost_strip_dirs > REMOVED-stripped.txt
1166 remove_bin_only > REMOVED-bin_only.txt
1167 remove_tests > REMOVED-tests.txt
1168
1169 if [ "${sqlite:-1}" = 1 ]; then
1170         # some code does not pass -DUSE_SYSTEM_SQLITE properly
1171         ln -sf /usr/include/sqlite3.h third_party/sqlite/sqlite3.h
1172 fi
1173
1174 clean_third_party > REMOVED-third_party.txt
1175
1176 if [ "${v8:-1}" != "0" ]; then
1177         # The implementation files include v8 headers with full path,
1178         # like #include "v8/include/v8.h". Make sure the system headers
1179         # will be used.
1180         rm -rf v8/include
1181         ln -s /usr/include v8/include
1182 fi
1183
1184 if [ "${nacl:-1}" != "0" ]; then
1185         # NOTE: here is always x86_64
1186         rm -rf native_client/toolchain/linux_x86_newlib
1187 fi
1188
1189 if [ "${emptydirs:-0}" != "0" ]; then
1190         # cleanup empty dirs
1191         find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty > REMOVED-dirs.txt
1192 fi
1193
1194 # report what's in them
1195 for a in REMOVED-*.txt; do
1196         cat $a
1197 done
This page took 0.130274 seconds and 3 git commands to generate.