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