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