]> git.pld-linux.org Git - packages/chromium-browser.git/blob - clean-source.sh
2d56226f7db499013d8fd15c57e74ae8e5f1f5ca
[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         v8/src/d8* \
45         third_party/chromite \
46         android_webview \
47         ash/resources/default_100_percent/cros_ \
48         ash/resources/default_200_percent/cros_ \
49         ash/shell/cocoa \
50         ash/system/chromeos \
51         base/android \
52         base/chromeos \
53         base/ios \
54         breakpad/src/client/mac \
55         breakpad/src/common/android \
56         breakpad/src/common/mac \
57         breakpad/src/tools/mac \
58         build/mac \
59         build/win_ \
60         chrome/android \
61         chrome/app/android \
62         chrome/app/resources/terms/chromeos \
63         chrome/app/theme/default_100_percent/cros_ \
64         chrome/app/theme/default_100_percent/mac_ \
65         chrome/app/theme/default_100_percent/win_ \
66         chrome/app/theme/default_200_percent/cros_ \
67         chrome/app/theme/default_200_percent/mac \
68         chrome/app/theme/default_200_percent/win_ \
69         chrome/app/theme/touch_100_percent/win \
70         chrome/app/theme/touch_140_percent/win \
71         chrome/app/theme/touch_180_percent/win \
72         chrome/browser/android \
73         chrome/browser/chromeos/cros \
74         chrome/browser/extensions/docs \
75         chrome/browser/history/android \
76         chrome/browser/mac \
77         chrome/browser/resources/about_welcome_android \
78         chrome/browser/resources/chromeos_ \
79         chrome/browser/resources/ntp_android \
80         chrome/browser/resources/options/chromeos_ \
81         chrome/browser/resources/shared/css/chromeos \
82         chrome/browser/resources/shared/js/chromeos_ \
83         chrome/browser/ui/android_ \
84         chrome/browser/ui/cocoa \
85         chrome/browser/ui/webui/chromeos \
86         chrome/browser/ui/webui/ntp/android \
87         chrome/browser/ui/webui/options/chromeos \
88         chrome/common/extensions/docs \
89         chrome/common/mac \
90         chrome/installer/mac \
91         chrome/installer/mac/third_party/xz/config/mac \
92         chrome/installer/tools \
93         chrome/third_party/jstemplate/tutorial_examples \
94         third_party/jstemplate/tutorial_examples \
95         chrome/third_party/mock4js/examples \
96         chrome/third_party/wtl/ \
97         chrome/tools/build/chromeos \
98         chrome/tools/build/mac \
99         chrome/tools/build/win \
100         chrome_frame \
101         cloud_print/virtual_driver/win \
102         content/app/android \
103         content/browser/android \
104         content/common/android \
105         content/components/navigation_interception/java \
106         content/components/web_contents_delegate_android/java \
107         content/public/android \
108         content/public/browser/android \
109         content/renderer/android \
110         content/shell/android \
111         content/shell/mac \
112         data \
113         gears \
114         google_update \
115         gpu/command_buffer/docs \
116         gpu/demos \
117         media/audio/android \
118         media/audio/ios \
119         media/audio/mac \
120         media/audio/win \
121         media/tools \
122         media/video/capture/mac \
123         media/video/capture/win \
124         media/webm/chromeos \
125         mesa/MesaLib/src/mesa/drivers/windows \
126         native_client/build/mac \
127         native_client/documentation \
128         native_client/src/shared/imc/win \
129         native_client/src/shared/platform/win \
130         native_client/src/tools \
131         native_client/src/trusted/debug_stub/win \
132         native_client/src/trusted/desc/win \
133         native_client/src/trusted/nonnacl_util/win \
134         native_client/src/trusted/platform_qualify/win \
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/mac \
303         third_party/ffmpeg/chromium/config/Chrome/win \
304         third_party/ffmpeg/chromium/config/Chromium/mac \
305         third_party/ffmpeg/chromium/config/Chromium/win \
306         third_party/ffmpeg/chromium/include/win \
307         third_party/ffmpeg/doc \
308         third_party/ffmpeg/tools \
309         third_party/fuzzymatch \
310         third_party/gles2_book \
311         third_party/gles_book_examples \
312         third_party/gold \
313         third_party/hunspell/dictionaries \
314         third_party/hunspell_dictionaries \
315         third_party/hyphen/doc \
316         third_party/icu/android \
317         third_party/icu/mac \
318         third_party/lcov \
319         third_party/leveldatabase/src/doc \
320         third_party/leveldatabase/src/port/win \
321         third_party/libjingle/source/talk/examples \
322         third_party/libjpeg_turbo/mac \
323         third_party/libjpeg_turbo/win \
324         third_party/libva/va/android \
325         third_party/libvpx/source/config/mac \
326         third_party/libvpx/source/config/win \
327         third_party/libxml/mac \
328         third_party/lighttpd \
329         third_party/mesa/MesaLib/docs \
330         third_party/mesa/MesaLib/src/gallium/docs \
331         third_party/npapi/npspy/extern/java \
332         third_party/nspr \
333         third_party/nss \
334         third_party/ocmock \
335         third_party/openssl/config/android \
336         third_party/ots/tools \
337         third_party/pthread \
338         third_party/pyftpdlib \
339         third_party/re2/doc \
340         third_party/scons \
341         third_party/sfntly/cpp/src/sfntly/tools \
342         third_party/simplejson \
343         third_party/skia/include/utils/android \
344         third_party/skia/include/utils/ios \
345         third_party/skia/include/utils/mac \
346         third_party/skia/include/utils/win \
347         third_party/skia/include/views/android \
348         third_party/skia/src/gpu/gl/android \
349         third_party/skia/src/gpu/gl/mac \
350         third_party/skia/src/gpu/gl/win \
351         third_party/skia/src/utils/ios \
352         third_party/skia/src/utils/mac \
353         third_party/skia/src/utils/win \
354         third_party/skia/src/views/ios \
355         third_party/skia/src/views/mac \
356         third_party/skia/src/views/win \
357         third_party/snappy/mac \
358         third_party/sqlite/src/doc \
359         third_party/tcmalloc/vendor/doc \
360         third_party/trace-viewer/examples \
361         third_party/trace-viewer/third_party/pywebsocket/src/example \
362         third_party/vc_80 \
363         third_party/webdriver/pylib/docs \
364         third_party/webrtc/modules/audio_device/android \
365         third_party/webrtc/modules/audio_device/ios \
366         third_party/webrtc/modules/audio_device/main/source/mac \
367         third_party/webrtc/modules/audio_device/main/source/win \
368         third_party/webrtc/modules/audio_device/win \
369         third_party/webrtc/modules/video_capture/android/java \
370         third_party/webrtc/modules/video_capture/main/source/android \
371         third_party/webrtc/modules/video_render/android/java \
372         third_party/webrtc/modules/video_render/main/source/android \
373         third_party/webrtc/modules/video_render/main/source/mac \
374         third_party/webrtc/system_wrappers/source/android \
375         third_party/yasm/source/config/android \
376         third_party/yasm/source/config/mac \
377         third_party/yasm/source/config/win \
378         tools/android \
379         tools/gyp/samples \
380         tools/gyp/samples/samples \
381         tools/gyp/tools \
382         tools/mac \
383         tools/site_compare \
384         tools/stats_viewer \
385         tools/symsrc \
386         tools/valgrind \
387         tools/win \
388         tools/wine_valgrind \
389         ui/android \
390         ui/base/cocoa \
391         ui/base/ime/win \
392         ui/gfx/android \
393         ui/gfx/mac \
394         ui/resources/default_100_percent/cros_ \
395         ui/resources/default_200_percent/cros_ \
396         ui/views/examples \
397         ui/views/win \
398         v8/samples \
399         webkit/chromeos \
400         webkit/media/android \
401         webrtc/modules/video_capture/windows \
402         webrtc/modules/video_render/windows \
403         win8 \
404         ; do
405                 rm -vfr "$dir"
406         done
407
408         find $(ls -d \
409                 base/mac \
410                 base/win \
411                 build/android \
412                 chrome/browser/chromeos \
413                 chrome/browser/component/web_contents_delegate_android \
414                 chrome/tools \
415                 chromeos_ \
416                 cloud_print/service/win \
417                 content/browser/renderer_host/java \
418                 content/common/mac \
419                 content/renderer/java \
420                 gpu/tools \
421                 media/base/android_ \
422                 native_client/src/include/win \
423                 native_client/src/trusted/service_runtime/win \
424                 net/tools \
425                 remoting/tools \
426                 sandbox/win \
427                 third_party/WebKit/Source/WebKit/chromium/public/mac \
428                 third_party/WebKit/Tools \
429                 third_party/cld/encodings/compact_lang_det/win \
430                 third_party/cros_system_api \
431                 third_party/mozc/chrome/chromeos \
432                 third_party/sfntly/cpp/src/sample \
433                 third_party/tcmalloc \
434                 third_party/v8-i18n/tools \
435                 third_party/webrtc/modules/video_coding/codecs/tools \
436                 third_party/webrtc/tools \
437                 ui/base/win \
438                 v8/tools \
439                 webkit/tools \
440         ) '!' -type d '(' \
441                 '!' -name '*.grd' \
442                 '!' -name '*.gyp*' \
443                 '!' -path 'base/mac/bundle_locations.h' \
444                 '!' -path 'base/mac/crash_logging.h' \
445                 '!' -path 'base/win/windows_version.h' \
446                 '!' -path 'build/android/cpufeatures.gypi' \
447                 '!' -path 'chrome/browser/chromeos/attestation/platform_verification_flow.h' \
448                 '!' -path 'chrome/browser/chromeos/contacts/contact.proto' \
449                 '!' -path 'chrome/browser/chromeos/extensions/*.h' \
450                 '!' -path 'chrome/browser/chromeos/extensions/echo_private_api.h' \
451                 '!' -path 'chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h' \
452                 '!' -path 'chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_functions.h' \
453                 '!' -path 'chrome/browser/chromeos/extensions/info_private_api.h' \
454                 '!' -path 'chrome/browser/chromeos/extensions/media_player_api.h' \
455                 '!' -path 'chrome/browser/chromeos/extensions/networking_private_api.h' \
456                 '!' -path 'chrome/browser/chromeos/extensions/wallpaper_api.h' \
457                 '!' -path 'chrome/browser/chromeos/extensions/wallpaper_private_api.h' \
458                 '!' -path 'chrome/browser/chromeos/settings/cros_settings.h' \
459                 '!' -path 'chrome/browser/chromeos/settings/cros_settings_names.h' \
460                 '!' -path 'chrome/browser/chromeos/settings/cros_settings_provider.h' \
461                 '!' -path 'chrome/browser/chromeos/settings/device_settings_service.h' \
462                 '!' -path 'chrome/browser/chromeos/system_logs/*.h' \
463                 '!' -path 'chrome/tools/build/generate_policy_source.py' \
464                 '!' -path 'chrome/tools/build/linux/sed.sh' \
465                 '!' -path 'chrome/tools/build/make_version_cc.py' \
466                 '!' -path 'chrome/tools/build/repack_locales.py' \
467                 '!' -path 'chrome/tools/build/version.py' \
468                 '!' -path 'chromeos/chromeos_constants.h' \
469                 '!' -path 'chromeos/chromeos_export.h' \
470                 '!' -path 'chromeos/chromeos_switches.h' \
471                 '!' -path 'chromeos/dbus/dbus_client_implementation_type.h' \
472                 '!' -path 'chromeos/dbus/dbus_method_call_status.h' \
473                 '!' -path 'chromeos/dbus/session_manager_client.h' \
474                 '!' -path 'chromeos/network/network_state_handler_observer.h' \
475                 '!' -path 'chromeos/network/onc/onc_constants.h' \
476                 '!' -path 'content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h' \
477                 '!' -path 'content/common/mac/attributed_string_coder.h' \
478                 '!' -path 'content/common/mac/font_descriptor.h' \
479                 '!' -path 'content/renderer/java/java_bridge_dispatcher.h' \
480                 '!' -path 'media/base/android/demuxer_android.h' \
481                 '!' -path 'native_client/src/include/win/mman.h' \
482                 '!' -path 'native_client/src/trusted/service_runtime/win/debug_exception_handler.h' \
483                 '!' -path 'native_client/src/trusted/service_runtime/win/exception_patch/ntdll_patch.h' \
484                 '!' -path 'net/tools/tld_cleanup/*' \
485                 '!' -path 'remoting/tools/build/*' \
486                 '!' -path 'remoting/tools/verify_resources.py' \
487                 '!' -path 'sandbox/win/src/sandbox_types.h' \
488                 '!' -path 'third_party/WebKit/Source/WebKit/chromium/public/mac/WebSubstringUtil.h' \
489                 '!' -path 'third_party/cld/encodings/compact_lang_det/win/cld_*.cc' \
490                 '!' -path 'third_party/cld/encodings/compact_lang_det/win/cld_*.h' \
491                 '!' -path 'third_party/cros_system_api/dbus/*.proto' \
492                 '!' -path 'third_party/cros_system_api/dbus/service_constants.h' \
493                 '!' -path 'third_party/sfntly/cpp/src/sample/chromium/*' \
494                 '!' -path 'third_party/tcmalloc/chromium/*' \
495                 '!' -path 'third_party/v8-i18n/tools/js2c.py' \
496                 '!' -path 'third_party/webrtc/tools/tools_unittests.isolate' \
497                 '!' -path 'ui/base/win/dpi.h' \
498                 '!' -path 'ui/webui/resources/js/webui_resource_test.js' \
499                 '!' -path 'v8/tools/js2c.py' \
500                 '!' -path 'v8/tools/jsmin.py' \
501                 '!' -path 'webkit/tools/test_shell/*.h' \
502                 ')' \
503         -print -delete
504 }
505
506 # There are directories we want to strip, but that are unnecessarily required by the build-system
507 # So we drop everything but the gyp/gypi files
508 almost_strip_dirs() {
509         local dir
510         for dir in \
511                 breakpad_ \
512                 build/ios \
513                 courgette \
514                 third_party/cros_dbus_cplusplus \
515                 ; do
516                 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
517         done
518
519         find tools -type f \
520                 '!' -iname '*.gyp*' \
521                 '!' -path 'tools/build/*' \
522                 '!' -path 'tools/clang/scripts/plugin_flags.sh' \
523                 '!' -path 'tools/compile_test/compile_test.py' \
524                 '!' -path 'tools/generate_library_loader/*' \
525                 '!' -path 'tools/generate_shim_headers/generate_shim_headers.py' \
526                 '!' -path 'tools/generate_stubs/*' \
527                 '!' -path 'tools/grit/*' \
528                 '!' -path 'tools/gritsettings/*' \
529                 '!' -path 'tools/gyp/*' \
530                 '!' -path 'tools/idl_parser/*' \
531                 '!' -path 'tools/json_comment_eater/json_comment_eater.py' \
532                 '!' -path 'tools/json_schema_compiler/*' \
533                 '!' -path 'tools/json_to_struct/*' \
534                 '!' -path 'tools/licenses.py' \
535                 '!' -path 'tools/protoc_wrapper/*' \
536                 '!' -path 'tools/usb_ids/*' \
537                 '!' -path 'tools/uuidgen.py' \
538                 '!' -path 'tools/zip2msi.py' \
539                 -print -delete
540 }
541
542 # clean third party
543 # list based from archlinux PKGBUILD
544 # https://aur.archlinux.org/packages/ch/chromium-dev/PKGBUILD
545 clean_third_party() {
546         local dir
547         for dir in \
548                 third_party/ashmem \
549                 third_party/eyesfree \
550                 third_party/guava \
551                 third_party/iaccessible2 \
552                 third_party/icon_family \
553                 third_party/isimpledom \
554                 third_party/jsr-305 \
555                 third_party/libexif \
556                 third_party/mach_override \
557                 third_party/npapi/npspy \
558                 third_party/re2/benchlog \
559                 third_party/sqlite/*.patch \
560                 third_party/sqlite/src/*.patch \
561                 third_party/sudden_motion_sensor \
562                 ; do
563                 rm -vfr "$dir"
564         done
565
566         find third_party -type f \
567                 '!' -iname '*.gyp*' \
568                 \! -path 'third_party/WebKit/*' \
569                 \! -path 'third_party/adobe/flash/*' \
570                 \! -path 'third_party/angle_dx11/include/EGL/*' \
571                 \! -path 'third_party/angle_dx11/include/GLSLANG/*' \
572                 \! -path 'third_party/angle_dx11/src/common/*' \
573                 \! -path 'third_party/angle_dx11/src/compiler/*' \
574                 \! -path 'third_party/angle_dx11/src/third_party/compiler/*' \
575                 \! -path 'third_party/cacheinvalidation/*' \
576                 \! -path 'third_party/cld/*' \
577                 \! -path 'third_party/cld_2/*' \
578                 \! -path 'third_party/cros_system_api/*' \
579                 \! -path 'third_party/flot/*.js' \
580                 \! -path 'third_party/hunspell/*' \
581                 \! -path 'third_party/hyphen/*' \
582                 \! -path 'third_party/iccjpeg/*' \
583                 \! -path 'third_party/jstemplate/*' \
584                 \! -path 'third_party/khronos/*' \
585                 \! -path 'third_party/leveldatabase/*' \
586                 \! -path 'third_party/libXNVCtrl/*' \
587                 \! -path 'third_party/libjingle/*' \
588                 \! -path 'third_party/libphonenumber/*' \
589                 \! -path 'third_party/libusb/*' \
590                 \! -path 'third_party/libva/*' \
591                 \! -path 'third_party/libvpx/*' \
592                 \! -path 'third_party/libwebp/*' \
593                 \! -path 'third_party/libxml/chromium/*' \
594                 \! -path 'third_party/libyuv/*' \
595                 \! -path 'third_party/lss/*.h' \
596                 \! -path 'third_party/lzma_sdk/*' \
597                 \! -path 'third_party/mesa/src/include/GL/gl.h' \
598                 \! -path 'third_party/mesa/src/include/GL/glext.h' \
599                 \! -path 'third_party/mesa/src/include/GL/glx.h' \
600                 \! -path 'third_party/mesa/src/include/GL/glxext.h' \
601                 \! -path 'third_party/mesa/src/include/GL/osmesa.h' \
602                 \! -path 'third_party/modp_b64/*' \
603                 \! -path 'third_party/mt19937ar/*' \
604                 \! -path 'third_party/npapi/*' \
605                 \! -path 'third_party/ots/*' \
606                 \! -path 'third_party/protobuf/*' \
607                 \! -path 'third_party/qcms/*' \
608                 \! -path 'third_party/re2/*' \
609                 \! -path 'third_party/sfntly/*' \
610                 \! -path 'third_party/skia/*' \
611                 \! -path 'third_party/smhasher/*' \
612                 \! -path 'third_party/snappy/*' \
613                 \! -path 'third_party/sqlite/amalgamation/*' \
614                 \! -path 'third_party/sqlite/sqlite3.h' \
615                 \! -path 'third_party/sqlite/src/ext/*' \
616                 \! -path 'third_party/tcmalloc/*' \
617                 \! -path 'third_party/trace-viewer/*' \
618                 \! -path 'third_party/undoview/*' \
619                 \! -path 'third_party/usrsctp/*' \
620                 \! -path 'third_party/v8-i18n/*' \
621                 \! -path 'third_party/v8/*' \
622                 \! -path 'third_party/webrtc/*' \
623                 \! -path 'third_party/widevine/*' \
624                 \! -path 'third_party/x86inc/*' \
625                 \! -path 'third_party/zlib/google/*' \
626                 -print -delete
627
628         rm -vf third_party/expat/files/lib/expat.h
629 }
630
631 # parts based on ubuntu debian/rules
632 # http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules
633 remove_bin_only() {
634         find -type f \( \
635                 -iname \*.exe -o \
636                 -iname \*.nexe -o \
637                 -iname \*.fon -o \
638                 -iname \*.ttf  -o \
639                 -iname \*.dll -o \
640                 -iname \*.pdb -o \
641                 -name \*.o -o \
642                 -name \*.a -o \
643                 -name \*.dylib \
644         \) -exec rm -fv {} \;
645 }
646
647 # removes dir, if the bcond is not turned off
648 strip_system_dirs() {
649         local dir lib bcond args
650         # prevent "*" from being expanded in $args
651         set -f
652         for dir in "$@"; do
653                 args=${dir#* }
654                 test "$args" = "$dir" && args=
655                 dir=${dir%% *}
656                 lib=${dir##*/}
657                 bcond=$(eval echo \$$lib)
658                 [ "${bcond:-1}" = 0 ] && continue
659
660                 # skip already removed dirs
661                 test -d $dir || continue
662
663                 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' -o -path $dir/$lib.h $args ')' -print -delete || :
664         done
665         set +f
666 }
667
668 # remove test data and files
669 # some scanned with find -name tests -o -name test -o -name test_data -o name testdata
670 # and find -iname *test*
671 remove_tests() {
672         local dir
673
674         # full remove
675         for dir in \
676         ash/test \
677         base/test_ \
678         breakpad/src/client/windows/tests \
679         breakpad/src/common/linux/tests \
680         breakpad/src/common/tests \
681         cc/test \
682         chrome/browser/chromeos/bluetooth/test \
683         chrome/browser/component_updater/test \
684         chrome/browser/extensions/api/test_ \
685         chrome/browser/printing/cloud_print/test \
686         chrome/browser/resources/gaia_auth/test_ \
687         chrome/browser/resources/tracing/tests \
688         chrome/browser/sync/test \
689         chrome/browser/ui/cocoa/test \
690         chrome/browser/ui/gtk/test \
691         chrome/browser/ui/tests \
692         chrome/browser/ui/views/test \
693         chrome/installer/test \
694         chrome/test/chromeos \
695         chrome/test/data/firefox2_nss_mac \
696         chrome/test/data/safe_browsing/old \
697         chrome/test/logging/win \
698         chrome/test/pyautolib/chromeos \
699         chrome/test/webdriver/test \
700         chrome/test_ \
701         chrome/tools/test \
702         chrome_frame/test \
703         chrome_frame/tools/test \
704         content/browser/worker_host/test \
705         content/common/gpu/testdata \
706         content/public/test \
707         content/test \
708         courgette/testdata \
709         device/bluetooth/test \
710         device/test \
711         gpu/command_buffer/tests \
712         media/test \
713         media/tools/layout_tests/test_data \
714         native_client/buildbot \
715         native_client/src/shared/platform/testdata \
716         native_client/src/trusted/gio/testdata \
717         native_client/src/trusted/interval_multiset/testdata \
718         native_client/src/trusted/service_runtime/testdata \
719         native_client/src/trusted/validator/x86/decoder/generator/testdata \
720         native_client/src/trusted/validator/x86/testing \
721         native_client/src/trusted/validator_arm/testdata \
722         native_client/src/trusted/validator_mips/testdata \
723         native_client/src/trusted/validator_x86/testdata \
724         native_client/tests \
725         native_client/tools/testdata \
726         native_client/tools/tests \
727         native_client_sdk/src/build_tools/tests \
728         native_client_sdk/src/libraries/c_salt/test \
729         net/test \
730         o3d/tests \
731         ppapi/native_client/tests \
732         ppapi/tests \
733         printing/test \
734         rlz/test \
735         sandbox/linux/seccomp-legacy/tests \
736         sandbox/linux/tests \
737         sandbox/tests \
738         sandbox/win/tests \
739         sdch/open-vcdiff/testdata \
740         seccompsandbox/tests \
741         sync/internal_api/public/test \
742         sync/internal_api/test \
743         sync/test \
744         testing/android \
745         testing/gmock/scripts/test \
746         testing/gmock/test \
747         testing/gtest/scripts/test \
748         testing/gtest/test \
749         third_party/WebKit/LayoutTests \
750         third_party/WebKit/Source/JavaScriptCore/API/tests \
751         third_party/WebKit/Source/JavaScriptCore/qt/tests \
752         third_party/WebKit/Source/JavaScriptCore/tests \
753         third_party/WebKit/Source/ThirdParty/gtest/scripts/test \
754         third_party/WebKit/Source/ThirdParty/gtest/test \
755         third_party/WebKit/Source/ThirdParty/gyp/test \
756         third_party/WebKit/Source/ThirdParty/qunit/test \
757         third_party/WebKit/Source/WebCore/bindings/scripts/test \
758         third_party/WebKit/Source/WebCore/testing_ \
759         third_party/WebKit/Source/WebKit/chromium/tests \
760         third_party/WebKit/Source/WebKit/efl/tests \
761         third_party/WebKit/Source/WebKit/gtk/tests \
762         third_party/WebKit/Source/WebKit/qt/tests \
763         third_party/WebKit/Source/WebKit2/UIProcess/API/efl/tests \
764         third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/tests \
765         third_party/WebKit/Source/WebKit2/UIProcess/API/qt/tests \
766         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/mac \
767         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/win \
768         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/mac \
769         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/win \
770         third_party/WebKit/Tools/Scripts/webkitpy/test \
771         third_party/WebKit/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac \
772         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit/win \
773         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/mac \
774         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/win \
775         third_party/WebKit/Tools/TestWebKitAPI/Tests/mac \
776         third_party/WebKit/Tools/TestWebKitAPI/mac \
777         third_party/WebKit/Tools/TestWebKitAPI/win \
778         third_party/angle_dx11/tests \
779         third_party/cacheinvalidation/files/src/google/cacheinvalidation/test \
780         third_party/cacheinvalidation/src/google/cacheinvalidation/test \
781         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing \
782         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing/android \
783         third_party/ffmpeg/tests \
784         third_party/harfbuzz/tests \
785         third_party/hunspell/tests \
786         third_party/hyphen/tests \
787         third_party/libexif/sources/test \
788         third_party/libjingle/source/talk/app/webrtc/test \
789         third_party/libjingle/source/talk/media/testdata \
790         third_party/libphonenumber/src/resources/test \
791         third_party/libphonenumber/src/test \
792         third_party/libsrtp/srtp/crypto/test \
793         third_party/libsrtp/srtp/test \
794         third_party/libyuv/unit_test/testdata \
795         third_party/mesa/MesaLib/src/gallium/tests \
796         third_party/openssl/openssl/crypto/des/t/test \
797         third_party/openssl/openssl/test \
798         third_party/ots/test \
799         third_party/protobuf/src/google/protobuf/testdata \
800         third_party/protobuf/src/google/protobuf/testing \
801         third_party/re2/re2/testing \
802         third_party/safe_browsing/testing \
803         third_party/sfntly/cpp/src/test \
804         third_party/sqlite/src/test \
805         third_party/sqlite/test \
806         third_party/talloc/libreplace/test \
807         third_party/tcmalloc/chromium/src/tests \
808         third_party/tcmalloc/vendor/src/tests \
809         third_party/tlslite/test \
810         third_party/trace-viewer/test_data \
811         third_party/trace-viewer/third_party/pywebsocket/src/test \
812         third_party/trace-viewer/third_party/pywebsocket/src/test/testdata \
813         third_party/v8-i18n/tests \
814         third_party/webdriver/pylib/test \
815         third_party/webdriver/test_data \
816         third_party/webrtc/modules/audio_device/test/android \
817         third_party/webrtc/modules/audio_processing/test/android \
818         third_party/webrtc/modules/utility/test \
819         third_party/webrtc/modules/video_capture/main/test/android \
820         third_party/webrtc/system_wrappers/test \
821         third_party/webrtc/test/manual \
822         third_party/webrtc/test/testsupport/mac \
823         third_party/webrtc/video_engine/test/auto_test/android \
824         third_party/webrtc/voice_engine/test/android \
825         third_party/xdg-utils/tests \
826         third_party/yasm/source/patched-yasm/libyasm/tests \
827         third_party/yasm/source/patched-yasm/modules/arch/lc3b/tests \
828         third_party/yasm/source/patched-yasm/modules/arch/x86/tests \
829         third_party/yasm/source/patched-yasm/modules/dbgfmts/dwarf2/tests \
830         third_party/yasm/source/patched-yasm/modules/dbgfmts/stabs/tests \
831         third_party/yasm/source/patched-yasm/modules/objfmts/bin/tests \
832         third_party/yasm/source/patched-yasm/modules/objfmts/coff/tests \
833         third_party/yasm/source/patched-yasm/modules/objfmts/elf/tests \
834         third_party/yasm/source/patched-yasm/modules/objfmts/macho/tests \
835         third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests \
836         third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests \
837         third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests \
838         third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests \
839         third_party/yasm/source/patched-yasm/modules/parsers/gas/tests \
840         third_party/yasm/source/patched-yasm/modules/parsers/nasm/tests \
841         third_party/yasm/source/patched-yasm/modules/parsers/tasm/tests \
842         third_party/yasm/source/patched-yasm/modules/preprocs/nasm/tests \
843         third_party/yasm/source/patched-yasm/modules/preprocs/raw/tests \
844         third_party/yasm/source/patched-yasm/tools/python-yasm/tests \
845         tools/clang/plugins/tests \
846         tools/grit/grit/testdata \
847         tools/gyp/test \
848         tools/gyp/tools/emacs/testdata \
849         tools/page_cycler/webpagereplay/tests \
850         tools/perf_expectations/tests \
851         tools/swarm_client/tests \
852         ui/app_list/test \
853         ui/aura/test \
854         ui/base/test \
855         ui/compositor/test \
856         ui/gfx/test \
857         ui/test \
858         ui/views/test \
859         v8/test \
860         webkit/compositor_bindings/test \
861         webkit/data/layout_tests \
862         webkit/plugins/npapi/test \
863         webkit/tools/test/reference_build \
864         webkit/tools/test_shell/mac \
865         ; do
866                 rm -vfr "$dir"
867         done
868
869         # partial remove (keep .gyp)
870         for dir in \
871                 chrome/browser/nacl_host/test \
872                 chrome/test/data \
873                 testing/gtest_ \
874                 testing/gtest_ios \
875                 testing/gmock_ \
876                 third_party/webrtc/modules/audio_coding/codecs/cng/test \
877                 third_party/webrtc/modules/audio_coding/codecs/g711/test \
878                 third_party/webrtc/modules/audio_coding/codecs/g722/test \
879                 third_party/webrtc/modules/audio_coding/codecs/ilbc/test \
880                 third_party/webrtc/modules/audio_coding/codecs/isac/fix/test \
881                 third_party/webrtc/modules/audio_coding/codecs/isac/main/test \
882                 third_party/webrtc/modules/audio_coding/main/test \
883                 third_party/webrtc/modules/audio_coding/neteq/test \
884                 third_party/webrtc/modules/audio_conference_mixer/test \
885                 third_party/webrtc/modules/audio_device/test \
886                 third_party/webrtc/modules/audio_processing/test \
887                 third_party/webrtc/modules/rtp_rtcp/test \
888                 third_party/webrtc/modules/udp_transport/test \
889                 third_party/webrtc/modules/video_capture/main/test \
890                 third_party/webrtc/modules/video_coding/codecs/test \
891                 third_party/webrtc/modules/video_coding/codecs/vp8/test \
892                 third_party/webrtc/modules/video_coding/main/test \
893                 third_party/webrtc/modules/video_processing/main/test \
894                 third_party/webrtc/modules/video_render/main/test \
895                 third_party/webrtc/video_engine/test_ \
896                 third_party/webrtc/voice_engine/test \
897                 tools/json_schema_compiler/test \
898                 ; do
899                 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
900         done
901
902         # link headers from system dir. too many files to patch, we don't even build tests
903 #       install -d testing/gtest/include
904 #       ln -s /usr/include/gtest testing/gtest/include/gtest
905
906         # delete unittest files
907         find . '(' \
908                 -name '*_unittest*.*' \
909                 -o -name '*_unittest.*' \
910                 -o -name '*_unittest' \
911                 -o -name 'test_*.*' \
912                 -o -name '*_test.*' \
913                 -o -path './testing/' \
914         ')' '!' -name '*.gyp*' \
915                 '!' -name '*.isolate' \
916                 '!' -name '*.grd' \
917                 '!' -path './base/test/*' \
918                 '!' -path './base/test/launcher/*' \
919                 '!' -path './base/test/launcher/test_launcher.*' \
920                 '!' -path './base/test/launcher/test_result.*' \
921                 '!' -path './cc/debug/*' \
922                 '!' -path './cc/debug/test_context_provider.h' \
923                 '!' -path './cc/debug/test_web_graphics_context_3d.h' \
924                 '!' -path './chrome/browser/diagnostics/diagnostics_test.*' \
925                 '!' -path './chrome/browser/extensions/api/declarative/test_rules_registry.*' \
926                 '!' -path './chrome/browser/extensions/api/test/test_api.*' \
927                 '!' -path './chrome/browser/resources/gaia_auth/manifest_test.json' \
928                 '!' -path './chrome/browser/resources/net_internals/*' \
929                 '!' -path './chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.*' \
930                 '!' -path './chrome/browser/ui/webui/test_chrome_web_ui_controller_factory*' \
931                 '!' -path './chrome/common/net/test_server_locations.*' \
932                 '!' -path './chrome/renderer/resources/extensions/test_custom_bindings.js' \
933                 '!' -path './chrome/test/base/test_switches.*' \
934                 '!' -path './chrome/test/perf/browser_perf_test.*' \
935                 '!' -path './chrome/test/perf/perf_test.*' \
936                 '!' -path './media/cast/rtcp/test_rtcp_packet_builder.*' \
937                 '!' -path './native_client/src/trusted/fault_injection/test_injection.*' \
938                 '!' -path './native_client/src/trusted/service_runtime/env_cleanser_test.h' \
939                 '!' -path './net/base/test_completion_callback.*' \
940                 '!' -path './net/base/test_data_stream.*' \
941                 '!' -path './net/cert/test_root_certs*' \
942                 '!' -path './remoting/base/resources_unittest.*' \
943                 '!' -path './testing/*' \
944                 '!' -path './testing/perf/perf_test.*' \
945                 '!' -path './third_party/skia/src/gpu/gr_unittests.*' \
946                 '!' -path './third_party/trace-viewer/src/base/unittest/test_error.js' \
947                 '!' -path './third_party/trace-viewer/src/tracing/test_utils.js' \
948                 '!' -path './tools/compile_test/compile_test.py' \
949                 '!' -path './ui/compositor/test_web_graphics_context_3d.*' \
950                 '!' -path './ui/webui/resources/js/webui_resource_test.js' \
951                 '!' -path './webkit/browser/fileapi/*.cc' \
952                 '!' -path './webkit/browser/fileapi/*.h' \
953                 '!' -path './webkit/common/gpu/test_context_provider_factory.*' \
954                 '!' -path './webkit/gpu/test_context_provider_factory.*' \
955                 '!' -path './webkit/support/test_webkit_platform_support.h' \
956                 '!' -path './webkit/tools/test_shell/*.h' \
957         -print -delete || :
958 }
959
960 # Remove most bundled libraries. Some are still needed.
961 # Sync this with gentoo/chromium-*.ebuild
962 remove_bundled_libraries() {
963         build/linux/unbundle/remove_bundled_libraries.py \
964                 third_party/adobe/flash/flapper_version.h \
965                 'base/third_party/dmg_fp' \
966                 'base/third_party/dynamic_annotations' \
967                 'base/third_party/icu' \
968                 'base/third_party/nspr' \
969                 'base/third_party/symbolize' \
970                 'base/third_party/valgrind' \
971                 'base/third_party/xdg_mime' \
972                 'base/third_party/xdg_user_dirs' \
973                 'breakpad/src/third_party/curl' \
974                 'chrome/third_party/mozilla_security_manager' \
975                 'crypto/third_party/nss' \
976                 'net/third_party/mozilla_security_manager' \
977                 'net/third_party/nss' \
978                 'third_party/WebKit' \
979                 'third_party/angle_dx11' \
980                 'third_party/cacheinvalidation' \
981                 'third_party/cld' \
982                 'third_party/cros_system_api' \
983                 'third_party/ffmpeg' \
984                 'third_party/flot' \
985                 'third_party/hunspell' \
986                 'third_party/iccjpeg' \
987                 'third_party/jstemplate' \
988                 'third_party/khronos' \
989                 'third_party/leveldatabase' \
990                 'third_party/libjingle' \
991                 'third_party/libphonenumber' \
992                 'third_party/libsrtp' \
993                 'third_party/libusb' \
994                 'third_party/libvpx' \
995                 'third_party/libwebp' \
996                 'third_party/libxml/chromium' \
997                 'third_party/libXNVCtrl' \
998                 'third_party/libyuv' \
999                 'third_party/lss' \
1000                 'third_party/lzma_sdk' \
1001                 'third_party/mesa' \
1002                 'third_party/modp_b64' \
1003                 'third_party/mt19937ar' \
1004                 'third_party/npapi' \
1005                 'third_party/ots' \
1006                 'third_party/pywebsocket' \
1007                 'third_party/qcms' \
1008                 'third_party/sfntly' \
1009                 'third_party/skia' \
1010                 'third_party/smhasher' \
1011                 'third_party/sqlite' \
1012                 'third_party/tcmalloc' \
1013                 'third_party/tlslite' \
1014                 'third_party/trace-viewer' \
1015                 'third_party/undoview' \
1016                 'third_party/usrsctp' \
1017                 'third_party/webdriver' \
1018                 'third_party/webrtc' \
1019                 'third_party/widevine' \
1020                 'third_party/x86inc' \
1021                 'third_party/zlib/google' \
1022                 'url/third_party/mozilla' \
1023                 'v8/src/third_party/valgrind' \
1024                 --do-print \
1025                 --do-remove
1026 }
1027
1028 remove_bundled_libraries > REMOVED-bundled_libraries.txt
1029
1030 strip_system_dirs \
1031         native_client/src/third_party_mod/jsoncpp \
1032         third_party/bzip2 \
1033         third_party/ffmpeg \
1034         third_party/flac \
1035         third_party/icu \
1036         third_party/jsoncpp \
1037         third_party/libXNVCtrl \
1038         third_party/libevent \
1039         third_party/libexif \
1040         third_party/libjpeg \
1041         third_party/libmtp \
1042         third_party/libpng \
1043         third_party/libsrtp \
1044         third_party/libusb_ \
1045         third_party/libvpx \
1046         third_party/libwebp \
1047         third_party/libxslt \
1048         third_party/mesa \
1049         third_party/opus \
1050         third_party/protobuf \
1051         third_party/re2 \
1052         third_party/snappy \
1053         third_party/speex \
1054         third_party/sqlite \
1055         third_party/yasm \
1056         "third_party/zlib -o -path third_party/zlib/google/*" \
1057         v8 \
1058 > REMOVED-system_dirs.txt
1059 remove_nonessential_dirs > REMOVED-nonessential_dirs.txt
1060 almost_strip_dirs > REMOVED-stripped.txt
1061 remove_bin_only > REMOVED-bin_only.txt
1062 remove_tests > REMOVED-tests.txt
1063
1064 if [ "${sqlite:-1}" = 1 ]; then
1065         # some code does not pass -DUSE_SYSTEM_SQLITE properly
1066         ln -sf /usr/include/sqlite3.h third_party/sqlite/sqlite3.h
1067 fi
1068
1069 clean_third_party > REMOVED-third_party.txt
1070
1071 if [ "${v8:-1}" != "0" ]; then
1072         # The implementation files include v8 headers with full path,
1073         # like #include "v8/include/v8.h". Make sure the system headers
1074         # will be used.
1075         rm -rf v8/include
1076         ln -s /usr/include v8/include
1077 fi
1078
1079 if [ "${nacl:-1}" != "0" ]; then
1080         # NOTE: here is always x86_64
1081         rm -rf native_client/toolchain/linux_x86_newlib
1082 fi
1083
1084 if [ "${emptydirs:-0}" != "0" ]; then
1085         # cleanup empty dirs
1086         find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty > REMOVED-dirs.txt
1087 fi
1088
1089 # report what's in them
1090 for a in REMOVED-*.txt; do
1091         cat $a
1092 done
This page took 0.137363 seconds and 2 git commands to generate.