# Strip tarball from some big directories not needed on the linux platform
# https://code.google.com/p/chromium/wiki/LinuxPackaging
# initial list from src/tools/export_tarball/export_tarball.py
-# also removed non-linux files: find -name win -o -name mac -o name android
+# also removed non-linux files: find -name win -o -name mac -o name android -o name windows
# find -type d -name 'android' -o -name 'chromeos' -o -name 'cros'
# find -type d -name *doc*
# find -type d -name *example*
# find -type d -name java
# find -type d -name tools
+# find -type d -name samples
# suffix with _ those that we can't remove (just yet) because of the gclient
# hooks (see build/all.gyp) or of some unneeded deps/includes
remove_nonessential_dirs() {
+ find -type f '(' \
+ -name 'Android.mk' -o \
+ -name '*.vcproj' -o \
+ -name '*.sln' -o \
+ -name '*.mm' -o \
+ -name '*.m' \
+ ')' | xargs rm -vf
+
+ find -regextype posix-extended \
+ -regex '.*_(win|cros|mac)_.*.xtb' \
+ -print -delete
+
local dir
for dir in \
+ v8/benchmarks \
+ v8/src/arm \
+ v8/src/d8* \
+ third_party/chromite \
android_webview \
ash/resources/default_100_percent/cros_ \
ash/resources/default_200_percent/cros_ \
base/android \
base/chromeos \
base/ios \
- base/mac_ \
- base/win_ \
breakpad/src/client/mac \
breakpad/src/common/android \
breakpad/src/common/mac \
breakpad/src/tools/mac \
- build/android_ \
build/mac \
- build/win \
+ build/win_ \
chrome/android \
chrome/app/android \
chrome/app/resources/terms/chromeos \
chrome/app/theme/default_100_percent/cros_ \
- chrome/app/theme/default_100_percent/mac \
+ chrome/app/theme/default_100_percent/mac_ \
chrome/app/theme/default_100_percent/win \
chrome/app/theme/default_200_percent/cros_ \
chrome/app/theme/default_200_percent/mac \
chrome/app/theme/touch_180_percent/win \
chrome/browser/android \
chrome/browser/chromeos/cros \
- chrome/browser/chromeos_ \
- chrome/browser/component/web_contents_delegate_android_ \
chrome/browser/extensions/docs \
chrome/browser/history/android \
chrome/browser/mac \
chrome/installer/mac/third_party/xz/config/mac \
chrome/installer/tools \
chrome/third_party/jstemplate/tutorial_examples \
+ third_party/jstemplate/tutorial_examples \
chrome/third_party/mock4js/examples \
chrome/third_party/wtl/ \
chrome/tools/build/chromeos \
chrome/tools/build/mac \
chrome/tools/build/win \
- chrome/tools_ \
chrome_frame \
- chromeos_ \
- cloud_print/service/win \
cloud_print/virtual_driver/win \
content/app/android \
content/browser/android \
- content/browser/renderer_host/java_ \
content/common/android \
- content/common/mac_ \
content/components/navigation_interception/java \
content/components/web_contents_delegate_android/java \
content/public/android \
content/public/browser/android \
content/renderer/android \
- content/renderer/java_ \
content/shell/android \
content/shell/mac \
data \
google_update \
gpu/command_buffer/docs \
gpu/demos \
- gpu/tools_ \
media/audio/android \
media/audio/ios \
media/audio/mac \
media/video/capture/mac \
media/video/capture/win \
media/webm/chromeos \
+ mesa/MesaLib/src/mesa/drivers/windows \
native_client/build/mac \
native_client/documentation \
- native_client/src/include/win_ \
native_client/src/shared/imc/win \
native_client/src/shared/platform/win \
native_client/src/tools \
native_client/src/trusted/desc/win \
native_client/src/trusted/nonnacl_util/win \
native_client/src/trusted/platform_qualify/win \
- native_client/src/trusted/service_runtime/win_ \
native_client/tools \
native_client/tools/trusted_cross_toolchains \
native_client_sdk \
net/android \
net/tools \
net/tools/testserver \
+ npapi/npspy/windows \
o3d \
o3d/documentation \
o3d/samples \
remoting/host/mac \
remoting/host/setup/win \
remoting/host/win \
- remoting/tools_ \
rlz/examples \
rlz/mac \
rlz/win \
sandbox/win/tools \
- sandbox/win_ \
sdch/ios \
sdch/mac \
skia/config/win \
sync/tools \
+ tcmalloc/chromium/src/windows \
+ tcmalloc/vendor/src/windows \
third_party/WebKit/Source/JavaScriptCore/docs \
third_party/WebKit/Source/JavaScriptCore/tools \
third_party/WebKit/Source/Platform/chromium/public/android \
third_party/WebKit/Source/Platform/chromium/public/mac \
third_party/WebKit/Source/Platform/chromium/public/win \
+ third_party/WebKit/Source/ThirdParty/gtest/samples \
+ third_party/WebKit/Source/ThirdParty/gyp/samples \
+ third_party/WebKit/Source/ThirdParty/gyp/samples/samples \
third_party/WebKit/Source/ThirdParty/gyp/tools \
third_party/WebKit/Source/WTF/wtf/mac \
third_party/WebKit/Source/WTF/wtf/qt \
third_party/WebKit/Source/WebCore/plugins/qt \
third_party/WebKit/Source/WebCore/plugins/win \
third_party/WebKit/Source/WebKit/chromium/public/android \
- third_party/WebKit/Source/WebKit/chromium/public/mac_ \
third_party/WebKit/Source/WebKit/chromium/public/platform/android \
third_party/WebKit/Source/WebKit/chromium/public/platform/mac \
third_party/WebKit/Source/WebKit/chromium/public/platform/win \
third_party/WebKit/Source/WebKit/qt/docs \
third_party/WebKit/Source/WebKit/qt/examples \
third_party/WebKit/Source/WebKit/win \
+ third_party/WebKit/Source/WebKit/wx/bindings/python/samples \
third_party/WebKit/Source/WebKit2/Platform/CoreIPC/mac \
third_party/WebKit/Source/WebKit2/Platform/CoreIPC/win \
third_party/WebKit/Source/WebKit2/Platform/mac \
third_party/WebKit/Source/WebKit2/WebProcess/win \
third_party/WebKit/Source/WebKit2/mac \
third_party/WebKit/Source/WebKit2/win \
- third_party/WebKit/Tools_ \
third_party/WebKit/Tools/DumpRenderTree/mac \
third_party/WebKit/Tools/DumpRenderTree/qt \
third_party/WebKit/Tools/DumpRenderTree/win \
+ third_party/angle/extensions \
+ third_party/angle/samples \
third_party/angle/samples/gles2_book \
third_party/boost \
third_party/bsdiff \
third_party/cacheinvalidation/src/java \
third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android \
third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android \
- third_party/cld/encodings/compact_lang_det/win_ \
- third_party/cros_system_api_ \
third_party/ffmpeg/binaries \
third_party/ffmpeg/chromium/binaries/Chromium/win \
third_party/ffmpeg/chromium/config/Chrome/mac \
third_party/lighttpd \
third_party/mesa/MesaLib/docs \
third_party/mesa/MesaLib/src/gallium/docs \
- third_party/mozc/chrome/chromeos_ \
third_party/npapi/npspy/extern/java \
third_party/nspr \
third_party/nss \
third_party/snappy/mac \
third_party/sqlite/src/doc \
third_party/tcmalloc/vendor/doc \
- third_party/tcmalloc_ \
third_party/trace-viewer/examples \
third_party/trace-viewer/third_party/pywebsocket/src/example \
- third_party/v8-i18n/tools_ \
third_party/vc_80 \
third_party/webdriver/pylib/docs \
third_party/webrtc/modules/audio_device/android \
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_coding/codecs/tools_ \
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/webrtc/tools_ \
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 \
ui/android \
ui/base/cocoa \
ui/base/ime/win \
- ui/base/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/tools_ \
+ v8/samples \
webkit/chromeos \
webkit/media/android \
- webkit/tools_ \
+ 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 \
+ 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 \
+ native_client/src/include/win \
+ native_client/src/trusted/service_runtime/win \
+ 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*' \
+ '!' -path 'base/mac/bundle_locations.h' \
+ '!' -path 'base/mac/crash_logging.h' \
+ '!' -path 'base/win/windows_version.h' \
+ '!' -path 'build/android/cpufeatures.gypi' \
+ '!' -path 'chrome/browser/chromeos/contacts/contact.proto' \
+ '!' -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/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_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/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_export.h' \
+ '!' -path 'chromeos/chromeos_switches.h' \
+ '!' -path 'chromeos/dbus/dbus_client_implementation_type.h' \
+ '!' -path 'chromeos/dbus/session_manager_client.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 '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 '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 'ui/base/win/dpi.h' \
+ '!' -path 'v8/tools/js2c.py' \
+ '!' -path 'v8/tools/jsmin.py' \
+ '!' -path 'webkit/tools/test_shell/*.h' \
+ ')' \
+ -print -delete
}
# There are directories we want to strip, but that are unnecessarily required by the build-system
almost_strip_dirs() {
local dir
for dir in \
- breakpad \
+ breakpad_ \
build/ios \
courgette \
third_party/cros_dbus_cplusplus \
; do
- find $dir -depth -mindepth 1 \! \( -name '*.gyp' -o -name '*.gypi' \) -print -delete || :
+ 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/json_comment_eater.py' \
+ '!' -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' \
- '!' -path 'tools/usb_ids/*' \
-print -delete
}
# list based from archlinux PKGBUILD
# https://aur.archlinux.org/packages/ch/chromium-dev/PKGBUILD
clean_third_party() {
- find third_party -type f \! -iname '*.gyp*' \
+ 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/libexif \
+ 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*' \
\! -path 'third_party/WebKit/*' \
\! -path 'third_party/adobe/flash/*' \
- \! -path 'third_party/angle/*' \
+ \! -path 'third_party/angle/include/EGL/*' \
+ \! -path 'third_party/angle/include/GLSLANG/*' \
+ \! -path 'third_party/angle/src/common/*' \
+ \! -path 'third_party/angle/src/compiler/*' \
+ \! -path 'third_party/angle/src/third_party/compiler/*' \
\! -path 'third_party/cacheinvalidation/*' \
\! -path 'third_party/cld/*' \
\! -path 'third_party/cros_system_api/*' \
- \! -path 'third_party/ffmpeg/*' \
- \! -path 'third_party/flac/flac.h' \
- \! -path 'third_party/flot/*' \
- \! -path 'third_party/harfbuzz-ng/*' \
- \! -path 'third_party/harfbuzz/*' \
+ \! -path 'third_party/flot/*.js' \
\! -path 'third_party/hunspell/*' \
\! -path 'third_party/hyphen/*' \
\! -path 'third_party/iccjpeg/*' \
+ \! -path 'third_party/jstemplate/*' \
\! -path 'third_party/khronos/*' \
\! -path 'third_party/leveldatabase/*' \
\! -path 'third_party/libXNVCtrl/*' \
\! -path 'third_party/libjingle/*' \
\! -path 'third_party/libphonenumber/*' \
- \! -path 'third_party/libusb/libusb.h' \
\! -path 'third_party/libva/*' \
- \! -path 'third_party/libvpx/libvpx.h' \
+ \! -path 'third_party/libvpx/*' \
\! -path 'third_party/libxml/chromium/*' \
\! -path 'third_party/libyuv/*' \
- \! -path 'third_party/lss/*' \
- \! -path 'third_party/mesa/*' \
+ \! -path 'third_party/lss/*.h' \
+ \! -path 'third_party/mesa/MesaLib/include/GL/gl.h' \
+ \! -path 'third_party/mesa/MesaLib/include/GL/glext.h' \
+ \! -path 'third_party/mesa/MesaLib/include/GL/glx.h' \
+ \! -path 'third_party/mesa/MesaLib/include/GL/glxext.h' \
+ \! -path 'third_party/mesa/MesaLib/include/GL/osmesa.h' \
\! -path 'third_party/modp_b64/*' \
\! -path 'third_party/mt19937ar/*' \
\! -path 'third_party/npapi/*' \
- \! -path 'third_party/opus/opus.h*' \
\! -path 'third_party/ots/*' \
\! -path 'third_party/protobuf/*' \
\! -path 'third_party/qcms/*' \
\! -path 'third_party/sfntly/*' \
\! -path 'third_party/skia/*' \
\! -path 'third_party/smhasher/*' \
- \! -path 'third_party/speex/speex.h' \
- \! -path 'third_party/sqlite/*' \
+ \! -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/v8/*' \
\! -path 'third_party/webrtc/*' \
\! -path 'third_party/widevine/*' \
+ \! -path 'third_party/x86inc/*' \
+ \! -path 'third_party/zlib/google/*' \
-print -delete
rm -vf third_party/expat/files/lib/expat.h
# removes dir, if the bcond is not turned off
strip_system_dirs() {
- local dir lib bcond
+ 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 -path $dir/$lib.h \) -print -delete
+ find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' -o -path $dir/$lib.h $args ')' -print -delete || :
done
+ set +f
}
# remove test data and files
third_party/webrtc/modules/utility/test \
third_party/webrtc/modules/video_capture/main/test/android \
third_party/webrtc/system_wrappers/test \
- third_party/webrtc/test \
+ third_party/webrtc/test/manual \
third_party/webrtc/test/testsupport/mac \
- third_party/webrtc/video_engine/test/android \
third_party/webrtc/video_engine/test/auto_test/android \
third_party/webrtc/voice_engine/test/android \
third_party/xdg-utils/tests \
# delete unittest files
find . '(' \
-name '*_unittest*.*' \
- -name '*_unittest.*' \
- -name '*_unittest' \
+ -o -name '*_unittest.*' \
+ -o -name '*_unittest' \
+ -o -name 'test_*.*' \
-o -name '*_test.*' \
')' '!' -name '*.gyp*' \
- '!' -path './native_client/src/trusted/service_runtime/env_cleanser_test.h' \
+ '!' -name '*.isolate' \
+ '!' -name '*.grd' \
'!' -path './chrome/browser/diagnostics/diagnostics_test.*' \
- '!' -path './chrome/test/perf/perf_test.*' \
+ '!' -path './chrome/browser/extensions/api/declarative/test_rules_registry.*' \
+ '!' -path './chrome/browser/extensions/api/test/test_api.*' \
+ '!' -path './chrome/browser/resources/net_internals/*' \
+ '!' -path './chrome/browser/storage_monitor/test_media_transfer_protocol_manager_linux.*' \
+ '!' -path './chrome/browser/ui/webui/test_chrome_web_ui_controller_factory*' \
+ '!' -path './chrome/common/net/test_server_locations.*' \
+ '!' -path './chrome/renderer/resources/extensions/test_custom_bindings.js' \
+ '!' -path './chrome/test/base/test_switches.*' \
'!' -path './chrome/test/perf/browser_perf_test.*' \
+ '!' -path './chrome/test/perf/perf_test.*' \
+ '!' -path './native_client/src/trusted/fault_injection/test_injection.*' \
+ '!' -path './native_client/src/trusted/service_runtime/env_cleanser_test.h' \
+ '!' -path './net/base/test_completion_callback.*' \
+ '!' -path './net/base/test_data_stream.*' \
+ '!' -path './net/cert/test_root_certs*' \
'!' -path './remoting/base/resources_unittest.*' \
- -print -delete
+ '!' -path './third_party/skia/src/gpu/gr_unittests.*' \
+ '!' -path './tools/compile_test/compile_test.py' \
+ '!' -path './ui/compositor/test_web_graphics_context_3d.*' \
+ '!' -path './webkit/fileapi/test_mount_point_provider.*' \
+ '!' -path './webkit/gpu/test_context_provider_factory.*' \
+ '!' -path './webkit/support/test_webkit_platform_support.h' \
+ '!' -path './webkit/tools/test_shell/*.h' \
+ -print -delete || :
}
-remove_nonessential_dirs > REMOVED-nonessential_dirs.txt
-almost_strip_dirs > REMOVED-stripped.txt
-remove_bin_only > REMOVED-bin_only.txt
-remove_tests > REMOVED-tests.txt
-
strip_system_dirs \
native_client/src/third_party_mod/jsoncpp \
third_party/bzip2 \
+ third_party/ffmpeg \
third_party/flac \
third_party/icu \
third_party/jsoncpp \
third_party/libusb \
third_party/libvpx \
third_party/libwebp \
- third_party/libxml_ \
third_party/libxslt \
+ third_party/mesa \
third_party/opus \
third_party/protobuf \
+ third_party/re2 \
+ third_party/snappy \
third_party/speex \
+ third_party/sqlite \
third_party/yasm \
- third_party/zlib \
+ "third_party/zlib -o -path third_party/zlib/google/*" \
v8 \
> REMOVED-system_dirs.txt
+remove_nonessential_dirs > REMOVED-nonessential_dirs.txt
+almost_strip_dirs > REMOVED-stripped.txt
+remove_bin_only > REMOVED-bin_only.txt
+remove_tests > REMOVED-tests.txt
+
+if [ "${sqlite:-1}" = 1 ]; then
+ # some code does not pass -DUSE_SYSTEM_SQLITE properly
+ ln -sf /usr/include/sqlite3.h third_party/sqlite/sqlite3.h
+fi
clean_third_party > REMOVED-third_party.txt