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