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