]> git.pld-linux.org Git - packages/chromium-browser.git/blob - clean-source.sh
21fdcb99ae9fc37fdbc8eaa3c52a37982893a193
[packages/chromium-browser.git] / clean-source.sh
1 #!/bin/sh
2 set -xe
3
4 # import options
5 # remove everything unless it's remove has been disabled with "0"
6 # "v8=0" means "do not remove v8"
7 eval "$@"
8
9 # Strip tarball from some big directories not needed on the linux platform
10 # https://code.google.com/p/chromium/wiki/LinuxPackaging
11 # initial list from src/tools/export_tarball/export_tarball.py
12 # some scanned with find -name tests -o -name test -o -name test_data
13 # and find -iname *test*
14 # also removed non-linux files: find -name win -o -name mac -o name android
15 # find -type d -name 'android' -o -name 'chromeos' -o -name 'cros'
16 # suffix with _ those that we can't remove (just yet) because of the gclient
17 # hooks (see build/all.gyp) or of some unneeded deps/includes
18 remove_nonessential_dirs() {
19         local dir
20         for dir in \
21         android_webview \
22         ash/resources/default_100_percent/cros_ \
23         ash/resources/default_200_percent/cros_ \
24         ash/system/chromeos \
25         ash/test \
26         base/android \
27         base/android/javatests/src/org/chromium/base/test \
28         base/chromeos \
29         base/mac_ \
30         base/test \
31         base/win_ \
32         breakpad/src/client/mac \
33         breakpad/src/client/mac/tests \
34         breakpad/src/client/windows/tests \
35         breakpad/src/common/android \
36         breakpad/src/common/android/testing \
37         breakpad/src/common/linux/tests \
38         breakpad/src/common/mac \
39         breakpad/src/common/tests \
40         breakpad/src/tools/mac \
41         build/android \
42         build/mac \
43         build/win \
44         chrome/android \
45         chrome/app/android \
46         chrome/app/resources/terms/chromeos \
47         chrome/app/theme/default_100_percent/cros_ \
48         chrome/app/theme/default_100_percent/mac \
49         chrome/app/theme/default_100_percent/win \
50         chrome/app/theme/default_200_percent/cros_ \
51         chrome/app/theme/default_200_percent/mac \
52         chrome/app/theme/default_200_percent/win \
53         chrome/app/theme/touch_100_percent/win \
54         chrome/app/theme/touch_140_percent/win \
55         chrome/app/theme/touch_180_percent/win \
56         chrome/browser/android \
57         chrome/browser/chromeos/bluetooth/test \
58         chrome/browser/chromeos/cros \
59         chrome/browser/chromeos_ \
60         chrome/browser/component/web_contents_delegate_android_ \
61         chrome/browser/component_updater/test \
62         chrome/browser/history/android \
63         chrome/browser/mac \
64         chrome/browser/printing/cloud_print/test \
65         chrome/browser/resources/about_welcome_android \
66         chrome/browser/resources/chromeos_ \
67         chrome/browser/resources/gaia_auth/test \
68         chrome/browser/resources/ntp_android \
69         chrome/browser/resources/options/chromeos_ \
70         chrome/browser/resources/shared/css/chromeos \
71         chrome/browser/resources/shared/js/chromeos_ \
72         chrome/browser/resources/tracing/tests \
73         chrome/browser/sync/test \
74         chrome/browser/ui/android \
75         chrome/browser/ui/tests \
76         chrome/browser/ui/webui/chromeos \
77         chrome/browser/ui/webui/ntp/android \
78         chrome/browser/ui/webui/options/chromeos \
79         chrome/common/extensions/docs \
80         chrome/common/mac \
81         chrome/installer/mac \
82         chrome/installer/mac/third_party/xz/config/mac \
83         chrome/installer/test \
84         chrome/test/chromeos \
85         chrome/test/data/firefox2_nss_mac \
86         chrome/test/data/safe_browsing/old \
87         chrome/test/logging/win \
88         chrome/test/pyautolib/chromeos \
89         chrome/test/webdriver/test \
90         chrome/third_party/wtl/ \
91         chrome/tools/build/chromeos \
92         chrome/tools/build/mac \
93         chrome/tools/build/win \
94         chrome/tools/test \
95         chrome/tools/test/reference_build \
96         chrome_frame \
97         chrome_frame/test \
98         chrome_frame/tools/test \
99         chromeos \
100         cloud_print/service/win \
101         cloud_print/virtual_driver/win \
102         content/app/android \
103         content/browser/android \
104         content/browser/worker_host/test \
105         content/common/android \
106         content/common/mac_ \
107         content/public/android \
108         content/public/browser/android \
109         content/public/test \
110         content/renderer/android \
111         content/shell/android \
112         content/shell/mac \
113         content/test \
114         content/test/data/layout_tests/LayoutTests/http/tests \
115         content/test/data/layout_tests/LayoutTests/http/tests/websocket/tests \
116         content/test/data/layout_tests/LayoutTests/platform/chromium-win/http/tests \
117         courgette/testdata \
118         data \
119         gears \
120         google_update \
121         gpu/command_buffer/tests \
122         gpu/demos \
123         media/audio/android \
124         media/audio/mac \
125         media/audio/win \
126         media/base/android \
127         media/test \
128         media/tools/layout_tests/test_data \
129         media/video/capture/mac \
130         media/video/capture/win \
131         media/webm/chromeos \
132         native_client/build/mac \
133         native_client/src/include/win_ \
134         native_client/src/shared/imc/win \
135         native_client/src/shared/platform/win \
136         native_client/src/trusted/debug_stub/win \
137         native_client/src/trusted/desc/win \
138         native_client/src/trusted/nonnacl_util/win \
139         native_client/src/trusted/platform_qualify/win \
140         native_client/src/trusted/service_runtime/testdata \
141         native_client/src/trusted/service_runtime/win_ \
142         native_client/src/trusted/validator/x86/testing \
143         native_client/tests \
144         native_client/tools/tests \
145         native_client/tools/trusted_cross_toolchains \
146         native_client_sdk \
147         native_client_sdk/src/build_tools/tests \
148         native_client_sdk/src/libraries/c_salt/test \
149         native_client_sdk/src/libraries/win \
150         net/android \
151         net/test \
152         o3d \
153         o3d/documentation \
154         o3d/samples \
155         o3d/tests \
156         ppapi/native_client/src/trusted/plugin/win \
157         ppapi/native_client/tests \
158         ppapi/tests \
159         printing/test \
160         remoting/host/installer/mac \
161         remoting/host/installer/win \
162         remoting/host/mac \
163         remoting/host/setup/win \
164         remoting/host/win \
165         rlz/mac \
166         rlz/test \
167         rlz/win \
168         sandbox/linux/seccomp-legacy/tests \
169         sandbox/linux/tests \
170         sandbox/tests \
171         sandbox/win/tests \
172         sandbox/win_ \
173         sdch/mac \
174         seccompsandbox/tests \
175         skia/config/win \
176         sync/internal_api/public/test \
177         sync/internal_api/test \
178         sync/test \
179         testing/android \
180         testing/gmock/scripts/test \
181         testing/gmock/test \
182         testing/gtest/scripts/test \
183         testing/gtest/test \
184         third_party/WebKit/LayoutTests \
185         third_party/WebKit/Source/JavaScriptCore/API/tests \
186         third_party/WebKit/Source/JavaScriptCore/qt/tests \
187         third_party/WebKit/Source/JavaScriptCore/tests \
188         third_party/WebKit/Source/Platform/chromium/public/android \
189         third_party/WebKit/Source/Platform/chromium/public/mac \
190         third_party/WebKit/Source/Platform/chromium/public/win \
191         third_party/WebKit/Source/ThirdParty/gtest/scripts/test \
192         third_party/WebKit/Source/ThirdParty/gtest/test \
193         third_party/WebKit/Source/ThirdParty/gyp/test \
194         third_party/WebKit/Source/ThirdParty/qunit/test \
195         third_party/WebKit/Source/WTF/wtf/mac \
196         third_party/WebKit/Source/WTF/wtf/threads/win \
197         third_party/WebKit/Source/WTF/wtf/win \
198         third_party/WebKit/Source/WebCore/WebCore.gyp/mac \
199         third_party/WebKit/Source/WebCore/accessibility/mac \
200         third_party/WebKit/Source/WebCore/accessibility/win \
201         third_party/WebKit/Source/WebCore/bindings/scripts/test \
202         third_party/WebKit/Source/WebCore/editing/android \
203         third_party/WebKit/Source/WebCore/editing/mac \
204         third_party/WebKit/Source/WebCore/history/android \
205         third_party/WebKit/Source/WebCore/history/mac \
206         third_party/WebKit/Source/WebCore/loader/mac \
207         third_party/WebKit/Source/WebCore/loader/win \
208         third_party/WebKit/Source/WebCore/page/android \
209         third_party/WebKit/Source/WebCore/page/mac \
210         third_party/WebKit/Source/WebCore/page/scrolling/mac \
211         third_party/WebKit/Source/WebCore/page/win \
212         third_party/WebKit/Source/WebCore/platform/android \
213         third_party/WebKit/Source/WebCore/platform/audio/mac \
214         third_party/WebKit/Source/WebCore/platform/cf/win \
215         third_party/WebKit/Source/WebCore/platform/graphics/ca/mac \
216         third_party/WebKit/Source/WebCore/platform/graphics/ca/win \
217         third_party/WebKit/Source/WebCore/platform/graphics/gpu/mac \
218         third_party/WebKit/Source/WebCore/platform/graphics/mac \
219         third_party/WebKit/Source/WebCore/platform/graphics/surfaces/mac \
220         third_party/WebKit/Source/WebCore/platform/graphics/surfaces/win \
221         third_party/WebKit/Source/WebCore/platform/graphics/win \
222         third_party/WebKit/Source/WebCore/platform/mac \
223         third_party/WebKit/Source/WebCore/platform/network/android \
224         third_party/WebKit/Source/WebCore/platform/network/mac \
225         third_party/WebKit/Source/WebCore/platform/network/win \
226         third_party/WebKit/Source/WebCore/platform/text/android \
227         third_party/WebKit/Source/WebCore/platform/text/mac \
228         third_party/WebKit/Source/WebCore/platform/text/win \
229         third_party/WebKit/Source/WebCore/platform/win \
230         third_party/WebKit/Source/WebCore/platform/wx/wxcode/mac \
231         third_party/WebKit/Source/WebCore/platform/wx/wxcode/win \
232         third_party/WebKit/Source/WebCore/plugins/mac \
233         third_party/WebKit/Source/WebCore/plugins/win \
234         third_party/WebKit/Source/WebCore/testing_ \
235         third_party/WebKit/Source/WebKit/chromium/public/android \
236         third_party/WebKit/Source/WebKit/chromium/public/mac_ \
237         third_party/WebKit/Source/WebKit/chromium/public/platform/android \
238         third_party/WebKit/Source/WebKit/chromium/public/platform/mac \
239         third_party/WebKit/Source/WebKit/chromium/public/platform/win \
240         third_party/WebKit/Source/WebKit/chromium/public/win \
241         third_party/WebKit/Source/WebKit/chromium/src/android \
242         third_party/WebKit/Source/WebKit/chromium/src/mac \
243         third_party/WebKit/Source/WebKit/chromium/src/win \
244         third_party/WebKit/Source/WebKit/chromium/tests \
245         third_party/WebKit/Source/WebKit/efl/tests \
246         third_party/WebKit/Source/WebKit/gtk/tests \
247         third_party/WebKit/Source/WebKit/mac \
248         third_party/WebKit/Source/WebKit/qt/tests \
249         third_party/WebKit/Source/WebKit/win \
250         third_party/WebKit/Source/WebKit2/Platform/CoreIPC/mac \
251         third_party/WebKit/Source/WebKit2/Platform/CoreIPC/win \
252         third_party/WebKit/Source/WebKit2/Platform/mac \
253         third_party/WebKit/Source/WebKit2/Platform/win \
254         third_party/WebKit/Source/WebKit2/PluginProcess/mac \
255         third_party/WebKit/Source/WebKit2/Shared/API/c/mac \
256         third_party/WebKit/Source/WebKit2/Shared/API/c/win \
257         third_party/WebKit/Source/WebKit2/Shared/Plugins/Netscape/mac \
258         third_party/WebKit/Source/WebKit2/Shared/Plugins/Netscape/win \
259         third_party/WebKit/Source/WebKit2/Shared/Plugins/mac \
260         third_party/WebKit/Source/WebKit2/Shared/cg/win \
261         third_party/WebKit/Source/WebKit2/Shared/mac \
262         third_party/WebKit/Source/WebKit2/Shared/win \
263         third_party/WebKit/Source/WebKit2/UIProcess/API/C/mac \
264         third_party/WebKit/Source/WebKit2/UIProcess/API/C/win \
265         third_party/WebKit/Source/WebKit2/UIProcess/API/efl/tests \
266         third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/tests \
267         third_party/WebKit/Source/WebKit2/UIProcess/API/mac \
268         third_party/WebKit/Source/WebKit2/UIProcess/API/qt/tests \
269         third_party/WebKit/Source/WebKit2/UIProcess/Launcher/mac \
270         third_party/WebKit/Source/WebKit2/UIProcess/Launcher/win \
271         third_party/WebKit/Source/WebKit2/UIProcess/Plugins/mac \
272         third_party/WebKit/Source/WebKit2/UIProcess/Plugins/win \
273         third_party/WebKit/Source/WebKit2/UIProcess/mac \
274         third_party/WebKit/Source/WebKit2/UIProcess/win \
275         third_party/WebKit/Source/WebKit2/WebProcess/Authentication/mac \
276         third_party/WebKit/Source/WebKit2/WebProcess/Cookies/mac \
277         third_party/WebKit/Source/WebKit2/WebProcess/Downloads/cf/win \
278         third_party/WebKit/Source/WebKit2/WebProcess/Downloads/mac \
279         third_party/WebKit/Source/WebKit2/WebProcess/FullScreen/mac \
280         third_party/WebKit/Source/WebKit2/WebProcess/FullScreen/win \
281         third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/API/c/win \
282         third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/mac \
283         third_party/WebKit/Source/WebKit2/WebProcess/InjectedBundle/win \
284         third_party/WebKit/Source/WebKit2/WebProcess/Plugins/Netscape/mac \
285         third_party/WebKit/Source/WebKit2/WebProcess/Plugins/Netscape/win \
286         third_party/WebKit/Source/WebKit2/WebProcess/WebCoreSupport/mac \
287         third_party/WebKit/Source/WebKit2/WebProcess/WebCoreSupport/win \
288         third_party/WebKit/Source/WebKit2/WebProcess/WebPage/ca/mac \
289         third_party/WebKit/Source/WebKit2/WebProcess/WebPage/ca/win \
290         third_party/WebKit/Source/WebKit2/WebProcess/WebPage/mac \
291         third_party/WebKit/Source/WebKit2/WebProcess/WebPage/win \
292         third_party/WebKit/Source/WebKit2/WebProcess/mac \
293         third_party/WebKit/Source/WebKit2/WebProcess/win \
294         third_party/WebKit/Source/WebKit2/mac \
295         third_party/WebKit/Source/WebKit2/win \
296         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/mac \
297         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/win \
298         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/mac \
299         third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/win \
300         third_party/WebKit/Tools/DumpRenderTree/mac \
301         third_party/WebKit/Tools/DumpRenderTree/win \
302         third_party/WebKit/Tools/Scripts/webkitpy/test \
303         third_party/WebKit/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac \
304         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit/win \
305         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/mac \
306         third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/win \
307         third_party/WebKit/Tools/TestWebKitAPI/Tests/mac \
308         third_party/WebKit/Tools/TestWebKitAPI/mac \
309         third_party/WebKit/Tools/TestWebKitAPI/win \
310         third_party/angle/samples/gles2_book \
311         third_party/angle/tests \
312         third_party/boost \
313         third_party/bsdiff \
314         third_party/bspatch \
315         third_party/cacheinvalidation/files/src/google/cacheinvalidation/test \
316         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android \
317         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing \
318         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing/android \
319         third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android \
320         third_party/cld/encodings/compact_lang_det/win_ \
321         third_party/cros_system_api_ \
322         third_party/ffmpeg/binaries \
323         third_party/ffmpeg/chromium/binaries/Chromium/win \
324         third_party/ffmpeg/chromium/config/Chrome/mac \
325         third_party/ffmpeg/chromium/config/Chrome/win \
326         third_party/ffmpeg/chromium/config/Chromium/mac \
327         third_party/ffmpeg/chromium/config/Chromium/win \
328         third_party/ffmpeg/chromium/include/win \
329         third_party/ffmpeg/tests \
330         third_party/fuzzymatch \
331         third_party/gles2_book \
332         third_party/gles_book_examples \
333         third_party/gold \
334         third_party/harfbuzz/tests \
335         third_party/hunspell/dictionaries \
336         third_party/hunspell/tests \
337         third_party/hunspell_dictionaries \
338         third_party/hyphen/tests \
339         third_party/icu/android \
340         third_party/icu/mac \
341         third_party/lcov \
342         third_party/leveldatabase/src/port/win \
343         third_party/libexif/sources/test \
344         third_party/libjingle/source/talk/app/webrtc/test \
345         third_party/libjpeg_turbo/mac \
346         third_party/libjpeg_turbo/win \
347         third_party/libphonenumber/src/resources/test \
348         third_party/libphonenumber/src/test \
349         third_party/libsrtp/srtp/crypto/test \
350         third_party/libsrtp/srtp/test \
351         third_party/libva/va/android \
352         third_party/libvpx/source/config/mac \
353         third_party/libvpx/source/config/win \
354         third_party/libxml/mac \
355         third_party/lighttpd \
356         third_party/mesa/MesaLib/src/gallium/tests \
357         third_party/mesa/MesaLib/src/gallium/tests/python/tests \
358         third_party/mozc/chrome/chromeos_ \
359         third_party/nspr \
360         third_party/nss \
361         third_party/ocmock \
362         third_party/openssl/config/android \
363         third_party/openssl/openssl/crypto/des/t/test \
364         third_party/openssl/openssl/test \
365         third_party/ots/test \
366         third_party/protobuf/src/google/protobuf/testing \
367         third_party/pthread \
368         third_party/pyftpdlib \
369         third_party/re2/re2/testing \
370         third_party/safe_browsing/testing \
371         third_party/scons \
372         third_party/sfntly/cpp/src/test \
373         third_party/simplejson \
374         third_party/skia/include/utils/android \
375         third_party/skia/include/utils/mac \
376         third_party/skia/include/utils/win \
377         third_party/skia/include/views/android \
378         third_party/skia/src/gpu/gl/android \
379         third_party/skia/src/gpu/gl/mac \
380         third_party/skia/src/gpu/gl/win \
381         third_party/skia/src/utils/mac \
382         third_party/skia/src/utils/win \
383         third_party/skia/src/views/mac \
384         third_party/skia/src/views/win \
385         third_party/snappy/mac \
386         third_party/sqlite/src/test \
387         third_party/sqlite/test \
388         third_party/talloc/libreplace/test \
389         third_party/tcmalloc/chromium/src/tests \
390         third_party/tcmalloc/vendor/src/tests \
391         third_party/tcmalloc_ \
392         third_party/tlslite/test \
393         third_party/trace-viewer/test_data \
394         third_party/v8-i18n/tests \
395         third_party/vc_80 \
396         third_party/webdriver/pylib/test \
397         third_party/webdriver/test_data \
398         third_party/webrtc/modules/audio_device/android \
399         third_party/webrtc/modules/audio_device/main/source/mac \
400         third_party/webrtc/modules/audio_device/main/source/win \
401         third_party/webrtc/modules/audio_device/test/android \
402         third_party/webrtc/modules/audio_device/win \
403         third_party/webrtc/modules/audio_processing/test/android \
404         third_party/webrtc/modules/video_capture/main/source/android \
405         third_party/webrtc/modules/video_capture/main/test/android \
406         third_party/webrtc/modules/video_render/main/source/android \
407         third_party/webrtc/modules/video_render/main/source/mac \
408         third_party/webrtc/system_wrappers/source/android \
409         third_party/webrtc/test/testsupport/mac \
410         third_party/webrtc/video_engine/test/android \
411         third_party/webrtc/video_engine/test/auto_test/android \
412         third_party/webrtc/voice_engine/test/android \
413         third_party/xdg-utils/tests \
414         third_party/yasm/source/config/android \
415         third_party/yasm/source/config/mac \
416         third_party/yasm/source/config/win \
417         third_party/yasm/source/patched-yasm/libyasm/tests \
418         third_party/yasm/source/patched-yasm/modules/arch/lc3b/tests \
419         third_party/yasm/source/patched-yasm/modules/arch/x86/tests \
420         third_party/yasm/source/patched-yasm/modules/dbgfmts/dwarf2/tests \
421         third_party/yasm/source/patched-yasm/modules/dbgfmts/stabs/tests \
422         third_party/yasm/source/patched-yasm/modules/objfmts/bin/tests \
423         third_party/yasm/source/patched-yasm/modules/objfmts/coff/tests \
424         third_party/yasm/source/patched-yasm/modules/objfmts/elf/tests \
425         third_party/yasm/source/patched-yasm/modules/objfmts/macho/tests \
426         third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests \
427         third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests \
428         third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests \
429         third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests \
430         third_party/yasm/source/patched-yasm/modules/parsers/gas/tests \
431         third_party/yasm/source/patched-yasm/modules/parsers/nasm/tests \
432         third_party/yasm/source/patched-yasm/modules/parsers/tasm/tests \
433         third_party/yasm/source/patched-yasm/modules/preprocs/nasm/tests \
434         third_party/yasm/source/patched-yasm/modules/preprocs/raw/tests \
435         third_party/yasm/source/patched-yasm/tools/python-yasm/tests \
436         tools/android \
437         tools/clang/plugins/tests \
438         tools/gyp/test \
439         tools/mac \
440         tools/page_cycler/webpagereplay/tests \
441         tools/perf_expectations/tests \
442         tools/site_compare \
443         tools/stats_viewer \
444         tools/symsrc \
445         tools/valgrind \
446         tools/win \
447         tools/wine_valgrind \
448         ui/android \
449         ui/app_list/test \
450         ui/aura/test \
451         ui/base/ime/win \
452         ui/base/test \
453         ui/base/win_ \
454         ui/compositor/test \
455         ui/gfx/android \
456         ui/gfx/mac \
457         ui/gfx/test \
458         ui/resources/default_100_percent/cros_ \
459         ui/resources/default_200_percent/cros_ \
460         ui/test \
461         ui/views/test \
462         ui/views/win \
463         v8/test \
464         v8/test/cctest \
465         webkit/chromeos \
466         webkit/data/layout_tests \
467         webkit/media/android \
468         webkit/plugins/npapi/test \
469         webkit/tools/test/reference_build \
470         webkit/tools/test_shell/mac \
471         win8 \
472         ; do
473                 rm -vfr "$dir"
474         done
475 }
476
477 # There are directories we want to strip, but that are unnecessarily required by the build-system
478 # So we drop everything but the gyp/gypi files
479 almost_strip_dirs() {
480         local dir
481         for dir in \
482                 breakpad \
483                 chrome/test/data \
484                 courgette \
485                 testing \
486                 third_party/cros_dbus_cplusplus \
487                 ; do
488                 find $dir -depth -mindepth 1 \! \( -name '*.gyp' -o -name '*.gypi' \) -print -delete || :
489         done
490
491         find tools -type f \
492                 '!' -iname '*.gyp*' \
493                 '!' -path 'tools/build/*' \
494                 '!' -path 'tools/clang/scripts/plugin_flags.sh' \
495                 '!' -path 'tools/generate_stubs/*' \
496                 '!' -path 'tools/grit/*' \
497                 '!' -path 'tools/gritsettings/*' \
498                 '!' -path 'tools/gyp/*' \
499                 '!' -path 'tools/json_comment_eater.py' \
500                 '!' -path 'tools/json_schema_compiler/*' \
501                 '!' -path 'tools/protoc_wrapper/*' \
502                 '!' -path 'tools/uuidgen.py' \
503                 '!' -path 'tools/zip2msi.py' \
504                 -print -delete
505
506         # link headers from system dir. too many files to patch, we don't even build tests
507         install -d testing/gtest/include
508         ln -s /usr/include/gtest testing/gtest/include/gtest
509 }
510
511 # clean third party
512 # list based from archlinux PKGBUILD
513 # https://aur.archlinux.org/packages/ch/chromium-dev/PKGBUILD
514 clean_third_party() {
515         find third_party -type f \! -iname '*.gyp*' \
516                 \! -path 'third_party/WebKit/*' \
517                 \! -path 'third_party/adobe/flash/*' \
518                 \! -path 'third_party/angle/*' \
519                 \! -path 'third_party/cacheinvalidation/*' \
520                 \! -path 'third_party/cld/*' \
521                 \! -path 'third_party/cros_system_api/*' \
522                 \! -path 'third_party/ffmpeg/*' \
523                 \! -path 'third_party/flac/flac.h' \
524                 \! -path 'third_party/flot/*' \
525                 \! -path 'third_party/gpsd/*' \
526                 \! -path 'third_party/harfbuzz-ng/*' \
527                 \! -path 'third_party/harfbuzz/*' \
528                 \! -path 'third_party/hunspell/*' \
529                 \! -path 'third_party/hyphen/*' \
530                 \! -path 'third_party/iccjpeg/*' \
531                 \! -path 'third_party/jsoncpp/*' \
532                 \! -path 'third_party/khronos/*' \
533                 \! -path 'third_party/leveldatabase/*' \
534                 \! -path 'third_party/libXNVCtrl/*' \
535                 \! -path 'third_party/libjingle/*' \
536                 \! -path 'third_party/libphonenumber/*' \
537                 \! -path 'third_party/libsrtp/*' \
538                 \! -path 'third_party/libusb/libusb.h' \
539                 \! -path 'third_party/libva/*' \
540                 \! -path 'third_party/libvpx/libvpx.h' \
541                 \! -path 'third_party/libxml/chromium/*' \
542                 \! -path 'third_party/libyuv/*' \
543                 \! -path 'third_party/lss/*' \
544                 \! -path 'third_party/mesa/*' \
545                 \! -path 'third_party/modp_b64/*' \
546                 \! -path 'third_party/mongoose/*' \
547                 \! -path 'third_party/mt19937ar/*' \
548                 \! -path 'third_party/npapi/*' \
549                 \! -path 'third_party/openmax/*' \
550                 \! -path 'third_party/opus/opus.h*' \
551                 \! -path 'third_party/ots/*' \
552                 \! -path 'third_party/protobuf/*' \
553                 \! -path 'third_party/pywebsocket/*' \
554                 \! -path 'third_party/qcms/*' \
555                 \! -path 'third_party/re2/*' \
556                 \! -path 'third_party/scons-2.0.1/*' \
557                 \! -path 'third_party/sfntly/*' \
558                 \! -path 'third_party/skia/*' \
559                 \! -path 'third_party/smhasher/*' \
560                 \! -path 'third_party/speex/speex.h' \
561                 \! -path 'third_party/sqlite/*' \
562                 \! -path 'third_party/tcmalloc/*' \
563                 \! -path 'third_party/tlslite/*' \
564                 \! -path 'third_party/trace-viewer/*' \
565                 \! -path 'third_party/undoview/*' \
566                 \! -path 'third_party/v8-i18n/*' \
567                 \! -path 'third_party/v8/*' \
568                 \! -path 'third_party/webdriver/*' \
569                 \! -path 'third_party/webrtc/*' \
570                 \! -path 'third_party/widevine/*' \
571                 -print -delete
572
573         rm -vf third_party/expat/files/lib/expat.h
574 }
575
576 # parts based on ubuntu debian/rules
577 # http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules
578 remove_bin_only() {
579         find -type f \( \
580                 -iname \*.exe -o \
581                 -iname \*.dll -o \
582                 -iname \*.pdb -o \
583                 -name \*.o -o \
584                 -name \*.a -o \
585                 -name \*.dylib \
586         \) -exec rm -fv {} \;
587 }
588
589 # removes dir, if the bcond is not turned off
590 strip_system_dirs() {
591         local dir lib bcond
592         for dir in "$@"; do
593                 lib=${dir##*/}
594                 bcond=$(eval echo \$$lib)
595                 [ "${bcond:-1}" = 0 ] && continue
596
597                 # skip already removed dirs
598                 test -d $dir || continue
599
600                 find $dir -depth -mindepth 1 \! \( -name '*.gyp' -o -name '*.gypi' -o -path $dir/$lib.h \) -print -delete
601         done
602 }
603
604 remove_nonessential_dirs | tee -a REMOVED-nonessential_dirs.txt
605 almost_strip_dirs | tee -a REMOVED-stripped.txt
606 remove_bin_only | tee -a REMOVED-bin_only.txt
607
608 strip_system_dirs \
609         native_client/src/third_party_mod/jsoncpp \
610         third_party/bzip2 \
611         third_party/flac \
612         third_party/icu \
613         third_party/jsoncpp \
614         third_party/libevent \
615         third_party/libexif \
616         third_party/libjpeg \
617         third_party/libmtp \
618         third_party/libpng \
619         third_party/libsrtp \
620         third_party/libusb \
621         third_party/libvpx \
622         third_party/libwebp \
623         third_party/libxml_ \
624         third_party/libxslt \
625         third_party/opus \
626         third_party/speex \
627         third_party/yasm \
628         third_party/zlib \
629         v8 \
630 | tee -a REMOVED-system_dirs.txt
631
632 clean_third_party | tee -a REMOVED-third_party.txt
633
634 if [ "${v8:-1}" != "0" ]; then
635         # The implementation files include v8 headers with full path,
636         # like #include "v8/include/v8.h". Make sure the system headers
637         # will be used.
638         rm -rf v8/include
639         ln -s /usr/include v8/include
640 fi
641
642 if [ "${nacl:-1}" != "0" ]; then
643         # NOTE: here is always x86_64
644         rm -rf native_client/toolchain/linux_x86_newlib
645 fi
646
647 # cleanup empty dirs
648 find -type d -print0 | sort -zr | xargs -0 rmdir -v 2>/dev/null | tee -a REMOVED-dirs.txt
This page took 0.541209 seconds and 3 git commands to generate.