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