+ third_party/sqlite/src/doc \
+ third_party/tcmalloc/vendor/doc \
+ third_party/trace-viewer/examples \
+ third_party/trace-viewer/third_party/pywebsocket/src/example \
+ third_party/vc_80 \
+ third_party/webdriver/pylib/docs \
+ third_party/webrtc/modules/audio_device/android \
+ third_party/webrtc/modules/audio_device/ios \
+ third_party/webrtc/modules/audio_device/main/source/mac \
+ third_party/webrtc/modules/audio_device/main/source/win \
+ third_party/webrtc/modules/audio_device/win \
+ third_party/webrtc/modules/video_capture/android/java \
+ third_party/webrtc/modules/video_capture/main/source/android \
+ third_party/webrtc/modules/video_render/android/java \
+ third_party/webrtc/modules/video_render/main/source/android \
+ third_party/webrtc/modules/video_render/main/source/mac \
+ third_party/webrtc/system_wrappers/source/android \
+ third_party/yasm/source/config/android \
+ third_party/yasm/source/config/mac \
+ third_party/yasm/source/config/win \
+ tools/android \
+ tools/gyp/samples \
+ tools/gyp/samples/samples \
+ tools/gyp/tools \
+ tools/mac \
+ tools/site_compare \
+ tools/stats_viewer \
+ tools/symsrc \
+ tools/valgrind \
+ tools/win \
+ tools/wine_valgrind \
+ ui/android \
+ ui/base/cocoa \
+ ui/base/ime/win \
+ ui/gfx/android \
+ ui/gfx/mac \
+ ui/resources/default_100_percent/cros_ \
+ ui/resources/default_200_percent/cros_ \
+ ui/views/examples_ \
+ ui/views/win \
+ v8/samples \
+ webkit/chromeos \
+ webkit/media/android \
+ webrtc/modules/video_capture/windows \
+ webrtc/modules/video_render/windows \
+ win8 \
+ ; do
+ rm -vfr "$dir"
+ done
+
+ find $(ls -d \
+ base/mac \
+ base/win \
+ build/android \
+ chrome/browser/chromeos_ \
+ v8/src/d8* \
+ chrome/browser/component/web_contents_delegate_android \
+ chrome/tools \
+ chromeos_ \
+ cloud_print/service/win \
+ content/browser/renderer_host/java \
+ content/common/mac \
+ content/renderer/java \
+ gpu/tools \
+ media/base/android_ \
+ native_client/src/include/win \
+ native_client/src/trusted/service_runtime/win \
+ net/tools \
+ remoting/tools \
+ sandbox/win \
+ third_party/WebKit/Source/WebKit/chromium/public/mac \
+ third_party/WebKit/Tools \
+ third_party/cld/encodings/compact_lang_det/win \
+ third_party/cros_system_api \
+ third_party/mozc/chrome/chromeos \
+ third_party/sfntly/cpp/src/sample \
+ third_party/tcmalloc \
+ third_party/v8-i18n/tools \
+ third_party/webrtc/modules/video_coding/codecs/tools \
+ third_party/webrtc/tools \
+ ui/base/win \
+ v8/tools_ \
+ webkit/tools \
+ ) '!' -type d '(' \
+ '!' -name '*.grd' \
+ '!' -name '*.gyp*' \
+ '!' -name '*.isolate' \
+ '!' -path 'base/mac/bundle_locations.h' \
+ '!' -path 'base/mac/crash_logging.h' \
+ '!' -path 'base/win/windows_version.h' \
+ '!' -path 'chrome/browser/chromeos/attestation/platform_verification_flow.h' \
+ '!' -path 'chrome/browser/chromeos/contacts/contact.proto' \
+ '!' -path 'chrome/browser/chromeos/extensions/*.h' \
+ '!' -path 'chrome/browser/chromeos/extensions/echo_private_api.h' \
+ '!' -path 'chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h' \
+ '!' -path 'chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_functions.h' \
+ '!' -path 'chrome/browser/chromeos/extensions/info_private_api.h' \
+ '!' -path 'chrome/browser/chromeos/extensions/media_player_api.h' \
+ '!' -path 'chrome/browser/chromeos/extensions/networking_private_api.h' \
+ '!' -path 'chrome/browser/chromeos/extensions/wallpaper_api.h' \
+ '!' -path 'chrome/browser/chromeos/extensions/wallpaper_private_api.h' \
+ '!' -path 'chrome/browser/chromeos/settings/cros_settings.h' \
+ '!' -path 'chrome/browser/chromeos/settings/cros_settings_names.h' \
+ '!' -path 'chrome/browser/chromeos/settings/cros_settings_provider.h' \
+ '!' -path 'chrome/browser/chromeos/settings/device_settings_service.h' \
+ '!' -path 'chrome/browser/chromeos/system_logs/*.h' \
+ '!' -path 'chrome/tools/build/generate_policy_source.py' \
+ '!' -path 'chrome/tools/build/linux/sed.sh' \
+ '!' -path 'chrome/tools/build/make_version_cc.py' \
+ '!' -path 'chrome/tools/build/repack_locales.py' \
+ '!' -path 'chrome/tools/build/version.py' \
+ '!' -path 'chromeos/chromeos_constants.h' \
+ '!' -path 'chromeos/chromeos_export.h' \
+ '!' -path 'chromeos/chromeos_switches.h' \
+ '!' -path 'chromeos/dbus/dbus_client_implementation_type.h' \
+ '!' -path 'chromeos/dbus/dbus_method_call_status.h' \
+ '!' -path 'chromeos/dbus/session_manager_client.h' \
+ '!' -path 'chromeos/network/network_state_handler_observer.h' \
+ '!' -path 'chromeos/network/onc/onc_constants.h' \
+ '!' -path 'content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h' \
+ '!' -path 'content/common/mac/attributed_string_coder.h' \
+ '!' -path 'content/common/mac/font_descriptor.h' \
+ '!' -path 'content/renderer/java/java_bridge_dispatcher.h' \
+ '!' -path 'media/base/android/demuxer_android.h' \
+ '!' -path 'native_client/src/include/win/mman.h' \
+ '!' -path 'native_client/src/trusted/service_runtime/win/debug_exception_handler.h' \
+ '!' -path 'native_client/src/trusted/service_runtime/win/exception_patch/ntdll_patch.h' \
+ '!' -path 'net/tools/tld_cleanup/*' \
+ '!' -path 'remoting/tools/build/*' \
+ '!' -path 'remoting/tools/verify_resources.py' \
+ '!' -path 'sandbox/win/src/sandbox_types.h' \
+ '!' -path 'third_party/WebKit/Source/WebKit/chromium/public/mac/WebSubstringUtil.h' \
+ '!' -path 'third_party/cld/encodings/compact_lang_det/win/cld_*.cc' \
+ '!' -path 'third_party/cld/encodings/compact_lang_det/win/cld_*.h' \
+ '!' -path 'third_party/cros_system_api/dbus/*.proto' \
+ '!' -path 'third_party/cros_system_api/dbus/service_constants.h' \
+ '!' -path 'third_party/sfntly/cpp/src/sample/chromium/*' \
+ '!' -path 'third_party/tcmalloc/chromium/*' \
+ '!' -path 'third_party/v8-i18n/tools/js2c.py' \
+ '!' -path 'third_party/webrtc/tools/tools_unittests.isolate' \
+ '!' -path 'ui/base/win/dpi.h' \
+ '!' -path 'ui/webui/resources/js/webui_resource_test.js' \
+ '!' -path 'v8/tools/js2c.py' \
+ '!' -path 'v8/tools/jsmin.py' \
+ '!' -path 'webkit/tools/test_shell/*.h' \
+ ')' \
+ -print -delete
+}
+# }}}
+# {{{ almost_strip_dirs
+# There are directories we want to strip, but that are unnecessarily required by the build-system
+# So we drop everything but the gyp/gypi files
+almost_strip_dirs() {
+ local dir
+ for dir in \
+ breakpad_ \
+ build/ios \
+ courgette_ \
+ third_party/cros_dbus_cplusplus \
+ ; do
+ find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
+ done
+
+ find tools -type f \
+ '!' -iname '*.gyp*' \
+ '!' -path 'tools/build/*' \
+ '!' -path 'tools/clang/scripts/plugin_flags.sh' \
+ '!' -path 'tools/compile_test/compile_test.py' \
+ '!' -path 'tools/generate_library_loader/*' \
+ '!' -path 'tools/generate_shim_headers/generate_shim_headers.py' \
+ '!' -path 'tools/generate_stubs/*' \
+ '!' -path 'tools/grit/*' \
+ '!' -path 'tools/gritsettings/*' \
+ '!' -path 'tools/gyp/*' \
+ '!' -path 'tools/idl_parser/*' \
+ '!' -path 'tools/json_comment_eater/json_comment_eater.py' \
+ '!' -path 'tools/json_schema_compiler/*' \
+ '!' -path 'tools/json_to_struct/*' \
+ '!' -path 'tools/licenses.py' \
+ '!' -path 'tools/protoc_wrapper/*' \
+ '!' -path 'tools/usb_ids/*' \
+ '!' -path 'tools/uuidgen.py' \
+ '!' -path 'tools/zip2msi.py' \
+ -print -delete
+}
+# }}}
+# {{{ clean third party
+# list based from archlinux PKGBUILD
+# https://aur.archlinux.org/packages/ch/chromium-dev/PKGBUILD
+clean_third_party() {
+
+ # NOTE: don't forget to sync remove_bundled_libraries() {
+
+ local dir
+ for dir in \
+ third_party/ashmem \
+ third_party/eyesfree \
+ third_party/guava \
+ third_party/iaccessible2 \
+ third_party/icon_family \
+ third_party/isimpledom \
+ third_party/jsr-305 \
+ third_party/mach_override \
+ third_party/npapi/npspy \
+ third_party/re2/benchlog \
+ third_party/sqlite/*.patch \
+ third_party/sqlite/src/*.patch \
+ third_party/sudden_motion_sensor \
+ ; do
+ rm -vfr "$dir"
+ done
+
+ find third_party -type f \
+ '!' -iname '*.gyp*' \
+ '!' -iname '*.isolate' \
+ '!' -path 'third_party/WebKit/*' \
+ '!' -path 'third_party/adobe/flash/*' \
+ '!' -path 'third_party/angle/enumerate_files.py' \
+ '!' -path 'third_party/angle/include/EGL/*' \
+ '!' -path 'third_party/angle/include/GLSLANG/*' \
+ '!' -path 'third_party/angle/include/*.h' \
+ '!' -path 'third_party/angle/src/*' \
+ '!' -path 'third_party/angle/src/common/*' \
+ '!' -path 'third_party/angle/src/compiler/*' \
+ '!' -path 'third_party/angle/src/enumerate_files.py' \
+ '!' -path 'third_party/angle/src/third_party/compiler/*' \
+ '!' -path 'third_party/brotli/*' \
+ '!' -path 'third_party/cacheinvalidation/*' \
+ '!' -path 'third_party/cld/*' \
+ '!' -path 'third_party/cld_2/*' \
+ '!' -path 'third_party/cros_system_api/*' \
+ '!' -path 'third_party/cython/python_flags.py' \
+ '!' -path 'third_party/dom_distiller_js/*' \
+ '!' -path 'third_party/ffmpeg/*' \
+ '!' -path 'third_party/fips181/*' \
+ '!' -path 'third_party/flot/*.js' \
+ '!' -path 'third_party/google_input_tools/*' \
+ '!' -path 'third_party/hunspell/*' \
+ '!' -path 'third_party/hyphen/*' \
+ '!' -path 'third_party/iccjpeg/*' \
+ '!' -path 'third_party/icu/icu.isolate' \
+ '!' -path 'third_party/jinja2/*' \
+ '!' -path 'third_party/jstemplate/*' \
+ '!' -path 'third_party/khronos/*' \
+ '!' -path 'third_party/leveldatabase/*' \
+ '!' -path 'third_party/libXNVCtrl/*' \
+ '!' -path 'third_party/libaddressinput/*' \
+ '!' -path 'third_party/libjingle/*' \
+ '!' -path 'third_party/libphonenumber/*' \
+ '!' -path 'third_party/libusb/*' \
+ '!' -path 'third_party/libva/*' \
+ '!' -path 'third_party/libvpx/*' \
+ '!' -path 'third_party/libwebm/*' \
+ '!' -path 'third_party/libwebp/*' \
+ '!' -path 'third_party/libxml/chromium/*' \
+ '!' -path 'third_party/libyuv/*' \
+ '!' -path 'third_party/lss/*.h' \
+ '!' -path 'third_party/lzma_sdk/*' \
+ '!' -path 'third_party/markupsafe/*' \
+ '!' -path 'third_party/mesa/src/include/GL/gl.h' \
+ '!' -path 'third_party/mesa/src/include/GL/glext.h' \
+ '!' -path 'third_party/mesa/src/include/GL/glx.h' \
+ '!' -path 'third_party/mesa/src/include/GL/glxext.h' \
+ '!' -path 'third_party/mesa/src/include/GL/osmesa.h' \
+ '!' -path 'third_party/modp_b64/*' \
+ '!' -path 'third_party/mt19937ar/*' \
+ '!' -path 'third_party/npapi/*' \
+ '!' -path 'third_party/openmax_dl/*' \
+ '!' -path 'third_party/ots/*' \
+ '!' -path 'third_party/pdfium/*' \
+ '!' -path 'third_party/ply/*' \
+ '!' -path 'third_party/polymer/*' \
+ '!' -path 'third_party/polymer_legacy/*' \
+ '!' -path 'third_party/protobuf/*' \
+ '!' -path 'third_party/qcms/*' \
+ '!' -path 'third_party/re2/*' \
+ '!' -path 'third_party/readability/*' \
+ '!' -path 'third_party/sfntly/*' \
+ '!' -path 'third_party/skia/*' \
+ '!' -path 'third_party/smhasher/*' \
+ '!' -path 'third_party/snappy/*' \
+ '!' -path 'third_party/sqlite/amalgamation/*' \
+ '!' -path 'third_party/sqlite/sqlite3.h' \
+ '!' -path 'third_party/sqlite/src/ext/*' \
+ '!' -path 'third_party/tcmalloc/*' \
+ '!' -path 'third_party/trace-viewer/*' \
+ '!' -path 'third_party/undoview/*' \
+ '!' -path 'third_party/usrsctp/*' \
+ '!' -path 'third_party/v8-i18n/*' \
+ '!' -path 'third_party/v8/*' \
+ '!' -path 'third_party/webrtc/*' \
+ '!' -path 'third_party/widevine/*' \
+ '!' -path 'third_party/x86inc/*' \
+ '!' -path 'third_party/zlib/google/*' \
+ '!' -path 'third_party/zlib/zlib.h' \
+ \
+ '!' -path 'third_party/jinja2/*' \
+ '!' -path 'third_party/libvpx/*' \
+ '!' -path 'third_party/markupsafe/*' \
+ '!' -path 'third_party/opus/*' \
+ '!' -path 'third_party/libudev/*' \
+ -print -delete
+
+ rm -vf third_party/expat/files/lib/expat.h
+}
+# }}}
+# {{{ remove_bin_only
+# parts based on ubuntu debian/rules
+# http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-browser.head/view/head:/debian/rules
+remove_bin_only() {
+ # preserve: ui/keyboard/resources/roboto_bold.ttf
+ find -type f \( \
+ -iname \*.exe -o \
+ -iname \*.nexe -o \
+ -iname \*.fon -o \
+ -iname \*.ttf_ -o \
+ -iname \*.dll -o \
+ -iname \*.pdb -o \
+ -name \*.o -o \
+ -name \*.a -o \
+ -name \*.dylib \
+ \) -exec rm -fv {} \;
+}
+# }}}
+# {{{ strip_system_dirs
+# removes dir, if the bcond is not turned off
+strip_system_dirs() {
+ local dir lib bcond args
+ # prevent "*" from being expanded in $args
+ set -f
+ for dir in "$@"; do
+ args=${dir#* }
+ test "$args" = "$dir" && args=
+ dir=${dir%% *}
+ lib=${dir##*/}
+ bcond=$(eval echo \$$lib)
+ [ "${bcond:-1}" = 0 ] && continue
+
+ # skip already removed dirs
+ test -d $dir || continue
+
+ find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' -o -name '*.isolate' -o -path $dir/$lib.h $args ')' -print -delete || :
+ done
+ set +f
+}
+# }}}
+# {{{ remove_tests
+# remove test data and files
+# some scanned with find -name tests -o -name test -o -name test_data -o name testdata
+# and find -iname *test*
+remove_tests() {
+ local dir
+
+ echo '> full remove'
+ for dir in \
+ ash/test \
+ base/test_ \
+ breakpad/src/client/windows/tests \
+ breakpad/src/common/linux/tests \
+ breakpad/src/common/tests \
+ cc/test \
+ chrome/browser/chromeos/bluetooth/test \
+ chrome/browser/component_updater/test \
+ chrome/browser/extensions/api/test_ \
+ chrome/browser/printing/cloud_print/test \
+ chrome/browser/resources/gaia_auth/test_ \
+ chrome/browser/resources/tracing/tests \
+ chrome/browser/sync/test \
+ chrome/browser/ui/cocoa/test \
+ chrome/browser/ui/gtk/test \
+ chrome/browser/ui/tests \
+ chrome/browser/ui/views/test \
+ chrome/installer/test \
+ chrome/test/chromeos \
+ chrome/test/data/firefox2_nss_mac \
+ chrome/test/data/safe_browsing/old \
+ chrome/test/logging/win \
+ chrome/test/pyautolib/chromeos \
+ chrome/test/webdriver/test \
+ chrome/test_ \
+ chrome/tools/test \
+ chrome_frame/test \
+ chrome_frame/tools/test \
+ content/browser/worker_host/test \
+ content/common/gpu/testdata \
+ content/public/test_ \
+ content/test \
+ courgette/testdata \
+ device/bluetooth/test \
+ device/test \
+ gpu/command_buffer/tests \
+ media/test \
+ media/tools/layout_tests/test_data \
+ native_client/buildbot \
+ native_client/src/shared/platform/testdata \
+ native_client/src/trusted/gio/testdata \
+ native_client/src/trusted/interval_multiset/testdata \
+ native_client/src/trusted/service_runtime/testdata \
+ native_client/src/trusted/validator/x86/decoder/generator/testdata \
+ native_client/src/trusted/validator/x86/testing \
+ native_client/src/trusted/validator_arm/testdata \
+ native_client/src/trusted/validator_mips/testdata \
+ native_client/src/trusted/validator_x86/testdata \
+ native_client/tests \
+ native_client/tools/testdata \
+ native_client/tools/tests \
+ native_client_sdk/src/build_tools/tests \
+ native_client_sdk/src/libraries/c_salt/test \
+ net/test \
+ o3d/tests \
+ ppapi/native_client/tests \
+ ppapi/tests_ \
+ printing/test \
+ rlz/test \
+ sandbox/linux/seccomp-legacy/tests \
+ sandbox/linux/tests \
+ sandbox/tests \
+ sandbox/win/tests \
+ sdch/open-vcdiff/testdata \
+ seccompsandbox/tests \
+ sync/internal_api/public/test \
+ sync/internal_api/test \
+ sync/test \
+ testing/android \
+ testing/gmock/scripts/test \
+ testing/gmock/test \
+ testing/gtest/scripts/test \
+ testing/gtest/test \
+ third_party/WebKit/LayoutTests \
+ third_party/WebKit/Source/JavaScriptCore/API/tests \
+ third_party/WebKit/Source/JavaScriptCore/qt/tests \
+ third_party/WebKit/Source/JavaScriptCore/tests \
+ third_party/WebKit/Source/ThirdParty/gtest/scripts/test \
+ third_party/WebKit/Source/ThirdParty/gtest/test \
+ third_party/WebKit/Source/ThirdParty/gyp/test \
+ third_party/WebKit/Source/ThirdParty/qunit/test \
+ third_party/WebKit/Source/WebCore/bindings/scripts/test \
+ third_party/WebKit/Source/WebCore/testing_ \
+ third_party/WebKit/Source/WebKit/chromium/tests \
+ third_party/WebKit/Source/WebKit/efl/tests \
+ third_party/WebKit/Source/WebKit/gtk/tests \
+ third_party/WebKit/Source/WebKit/qt/tests \
+ third_party/WebKit/Source/WebKit2/UIProcess/API/efl/tests \
+ third_party/WebKit/Source/WebKit2/UIProcess/API/gtk/tests \
+ third_party/WebKit/Source/WebKit2/UIProcess/API/qt/tests \
+ third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/mac \
+ third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/win \
+ third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/mac \
+ third_party/WebKit/Tools/DumpRenderTree/TestNetscapePlugIn/win \
+ third_party/WebKit/Tools/Scripts/webkitpy/test \
+ third_party/WebKit/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac \
+ third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit/win \
+ third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/mac \
+ third_party/WebKit/Tools/TestWebKitAPI/Tests/WebKit2/win \
+ third_party/WebKit/Tools/TestWebKitAPI/Tests/mac \
+ third_party/WebKit/Tools/TestWebKitAPI/mac \
+ third_party/WebKit/Tools/TestWebKitAPI/win \
+ third_party/angle_dx11/tests \
+ third_party/cacheinvalidation/files/src/google/cacheinvalidation/test \
+ third_party/cacheinvalidation/src/google/cacheinvalidation/test \
+ third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing \
+ third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/testing/android \
+ third_party/ffmpeg/tests_ \
+ third_party/harfbuzz/tests \
+ third_party/hunspell/tests \
+ third_party/hyphen/tests \
+ third_party/libexif/sources/test \
+ third_party/libjingle/source/talk/app/webrtc/test \
+ third_party/libjingle/source/talk/media/testdata \
+ third_party/libphonenumber/src/resources/test \
+ third_party/libphonenumber/src/test \
+ third_party/libsrtp/srtp/crypto/test \
+ third_party/libsrtp/srtp/test \
+ third_party/libyuv/unit_test/testdata \
+ third_party/mesa/MesaLib/src/gallium/tests \
+ third_party/openssl/openssl/crypto/des/t/test \
+ third_party/openssl/openssl/test \
+ third_party/ots/test \
+ third_party/protobuf/src/google/protobuf/testdata \
+ third_party/protobuf/src/google/protobuf/testing_ \
+ third_party/re2/re2/testing \
+ third_party/safe_browsing/testing \
+ third_party/sfntly/cpp/src/test \