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