2021-06-29 20:42:56 +00:00
#!/bin/bash
2022-02-24 17:21:01 +00:00
# shellcheck disable=2181
#
2021-06-29 20:42:56 +00:00
# Copyright (c) 2021 Andreas Schneider <asn@cryptomilk.org>
# License: GPLv3
Accepting request 975750 from home:dziobian:electron-17.4
- Update to 17.4.3:
* Fixed child_process.spawn ENOENT error with cwd option.
* Apply senderFrame details to ipcMain port event.
* Added BrowserWindow method to change the button color,
symbol color, and height of a window with WCO enabled.
* Fixed a potential crash in Browser.getFocusedWindow() when child windows are closed.
* Fixed an issue where the the window bounds would incorrectly change
if BrowserWindow.unmaximize was called on a window whose user bounds were maximized.
* Fixed incorrect return value of app.requestSingleInstanceLock()
when setting non-existent user data folder.
* Fixed issues with frameless window animations and styling.
* Backported security fixes: CVE-2022-1478, CVE-2022-1479,
CVE-2022-1480, CVE-2022-1482, CVE-2022-1483, CVE-2022-1485,
CVE-2022-1492, CVE-2022-1305, CVE-2022-1308, CVE-2022-1310,
CVE-2022-1314, CVE-2022-1364, CVE-2022-1306, CVE-2022-1134,
CVE-2022-1138, CVE-2022-23308.
OBS-URL: https://build.opensuse.org/request/show/975750
OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=15
2022-05-09 09:26:11 +00:00
#
2023-03-10 06:02:08 +00:00
# dnf install python3-base file findutils git-core tar yarn moreutils zstd
2021-06-29 20:42:56 +00:00
2022-07-04 09:07:38 +00:00
ELECTRON_PKGVERSION = " $( rpmspec -P ./*.spec | grep ^\s *Version | sed -e 's/Version:[ ]*//g' ) "
2021-06-29 20:42:56 +00:00
ELECTRON_PKGNAME = "electron"
ELECTRON_PKGDIR = " $( pwd ) "
2022-02-24 17:21:01 +00:00
ELECTRON_TMPDIR = " $( mktemp --tmpdir -d electron-XXXXXXXX) "
2022-07-04 09:07:38 +00:00
ELECTRON_PATH = " ${ ELECTRON_TMPDIR } /src "
2021-06-29 20:42:56 +00:00
echo " NAME: $ELECTRON_PKGNAME "
echo " VERSION: $ELECTRON_PKGVERSION "
echo " PATH: $ELECTRON_PATH "
2022-04-12 19:50:41 +00:00
echo -n " This script will download about 60G to $ELECTRON_TMPDIR , continue? "
read $ans
2021-06-29 20:42:56 +00:00
cleanup_tmpdir( ) {
2022-02-24 17:21:01 +00:00
popd 2>/dev/null || true
rm -rf " $ELECTRON_TMPDIR "
2021-06-29 20:42:56 +00:00
}
trap cleanup_tmpdir SIGINT
cleanup_and_exit( ) {
cleanup_tmpdir
if test " $1 " = 0 -o -z " $1 " ; then
exit 0
else
2022-02-24 17:21:01 +00:00
exit " $1 "
2021-06-29 20:42:56 +00:00
fi
}
2021-11-04 15:09:34 +00:00
pushd " $ELECTRON_TMPDIR " || cleanup_and_exit 1
2021-06-29 20:42:56 +00:00
echo ">>>>>> Downloading depot tools"
git clone --depth= 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
if [ $? -ne 0 ] ; then
echo "ERROR: git clone depot_tools failed"
cleanup_and_exit 1
fi
2021-11-04 15:09:34 +00:00
PATH = " $( pwd ) /depot_tools: $PATH "
export PATH
2021-06-29 20:42:56 +00:00
2022-07-04 09:07:38 +00:00
# HACK to make gclient much faster, do not download entire history
2022-09-09 08:50:38 +00:00
sed -i " s/, '--progress'] $/, '--progress', '--filter=tree:0']/ " depot_tools/gclient_scm.py
2024-04-04 20:44:56 +00:00
# googlesource these days likes to error out on tree:0 but it should not be needed
sed -i 's/remote or self.remote,$/remote or self.remote, "--depth=1"/' depot_tools/gclient_scm.py
2022-09-09 08:50:38 +00:00
# HACK I want to see progress from git checkout to ensure it does not hang
sed -i 's/if quiet is None:$/if True:/' depot_tools/gclient_scm.py
2022-07-04 09:07:38 +00:00
2021-06-29 20:42:56 +00:00
echo ">>>>>> Create gclient config"
cat >.gclient <<EOF
solutions = [
{
"name" : "src/electron" ,
"url" : "https://github.com/electron/electron" ,
"deps_file" : "DEPS" ,
"managed" : False,
} ,
]
EOF
2023-11-10 18:29:28 +00:00
export DEPOT_TOOLS_UPDATE = 0
2021-06-29 20:42:56 +00:00
echo " >>>>>> Downloading electron- ${ ELECTRON_PKGVERSION } "
2025-05-17 09:23:17 +00:00
gclient sync -v --jobs 15 --nohooks --no-history --shallow --revision= v" ${ ELECTRON_PKGVERSION } "
2021-06-29 20:42:56 +00:00
if [ $? -ne 0 ] ; then
echo "ERROR: gclient sync failed"
cleanup_and_exit 1
fi
2022-07-04 09:07:38 +00:00
pushd src || cleanup_and_exit 1
echo ">>>>>> Create LASTCHANGE(.committime) file"
echo -n " LASTCHANGE= $( git log -1 --format= format:%H HEAD) " > build/util/LASTCHANGE
# shellcheck disable=1091
source build/util/LASTCHANGE
2023-01-13 05:29:42 +00:00
echo -n " $( git log -1 --date= unix --format= format:%cd $LASTCHANGE ) " > build/util/LASTCHANGE.committime
2022-07-04 09:07:38 +00:00
2022-09-15 04:57:08 +00:00
2021-06-29 20:42:56 +00:00
echo ">>>>>> Generate GPU_LISTS_VERSION"
2023-04-15 17:03:47 +00:00
# Make git all commits in chromium history visible to the script
git fetch --filter= tree:0 --unshallow origin $( git rev-parse HEAD)
2022-09-15 04:57:08 +00:00
python3 build/util/lastchange.py -m GPU_LISTS_VERSION \
--revision-id-only --header gpu/config/gpu_lists_version.h
2021-06-29 20:42:56 +00:00
if [ $? -ne 0 ] ; then
echo "ERROR: lastchange.py -m GPU_LISTS_VERSION failed"
cleanup_and_exit 1
fi
echo ">>>>>> Generate SKIA_COMMIT_HASH"
2022-09-15 04:57:08 +00:00
python3 build/util/lastchange.py -m SKIA_COMMIT_HASH \
-s third_party/skia --header skia/ext/skia_commit_hash.h
2021-06-29 20:42:56 +00:00
if [ $? -ne 0 ] ; then
echo "ERROR: lastchange.py -m SKIA_COMMIT_HASH failed"
cleanup_and_exit 1
fi
2024-04-19 21:15:15 +00:00
echo '>>>>>> Generate DAWN_VERSION'
python3 build/util/lastchange.py \
-s third_party/dawn --revision gpu/webgpu/DAWN_VERSION
if [ $? -ne 0 ] ; then
echo 'ERROR: lastchange.py -s third_party/dawn failed'
cleanup_and_exit 1
fi
2022-09-15 04:57:08 +00:00
popd
2022-07-04 09:07:38 +00:00
echo " >>>>>> Apply electron- ${ ELECTRON_PKGVERSION } patches "
python3 src/electron/script/apply_all_patches.py \
src/electron/patches/config.json
if [ $? -ne 0 ] ; then
echo "ERROR: apply_all_patches.py failed"
cleanup_and_exit 1
fi
2021-06-29 20:42:56 +00:00
echo ">>>>>> Download optimization profile"
python3 src/tools/download_optimization_profile.py \
--newest_state= src/chrome/android/profiles/newest.txt \
--local_state= src/chrome/android/profiles/local.txt \
--output_name= src/chrome/android/profiles/afdo.prof \
--gs_url_base= chromeos-prebuilt/afdo-job/llvm
2023-09-13 04:57:45 +00:00
# it hangs as of electron 23 and we don't use it anyway (needs clang)
#echo ">>>>>> Download pgo profiles"
#python3 src/tools/update_pgo_profiles.py \
# --target=linux \
# update \
# --gs-url-base=chromium-optimization-profiles/pgo_profiles
2022-01-27 22:16:50 +00:00
2022-05-20 08:19:40 +00:00
2021-06-29 20:42:56 +00:00
# Needed to get typescript compiler
2022-08-29 08:58:56 +00:00
echo ">>>>>> Download and unpack webui-node-modules tarball for third_party/node"
python3 src/third_party/depot_tools/download_from_google_storage.py \
2025-01-12 20:37:55 +00:00
--no_resume --no_auth --bucket chromium-nodejs \
2022-08-29 08:58:56 +00:00
-s src/third_party/node/node_modules.tar.gz.sha1
2021-06-29 20:42:56 +00:00
if [ $? -ne 0 ] ; then
2022-08-29 08:58:56 +00:00
echo "ERROR: download_from_google_storage failed"
2021-06-29 20:42:56 +00:00
cleanup_and_exit 1
fi
2025-01-12 20:37:55 +00:00
mkdir -pv src/third_party/node/node_modules
pushd src/third_party/node/node_modules
tar -xvvf ../node_modules.tar.gz
if [ $? -ne 0 ] ; then
echo "ERROR: tar extract failed"
cleanup_and_exit 1
fi
popd
2022-08-29 08:58:56 +00:00
# we don't need the orig tarball
2022-05-20 08:19:40 +00:00
rm -v src/third_party/node/node_modules.tar.gz
2021-06-29 20:42:56 +00:00
echo ">>>>>> Get node modules for electron"
2021-11-04 15:09:34 +00:00
pushd src/electron || cleanup_and_exit 1
2023-12-22 14:28:07 +00:00
yarn install --frozen-lockfile --ignore-engines --ignore-platform --ignore-scripts --link-duplicates
2021-06-29 20:42:56 +00:00
if [ $? -ne 0 ] ; then
echo "ERROR: yarn install failed"
cleanup_and_exit 1
fi
2021-11-04 15:09:34 +00:00
popd || cleanup_and_exit 1
2021-06-29 20:42:56 +00:00
2021-11-04 15:09:34 +00:00
pushd " ${ ELECTRON_PATH } " || cleanup_and_exit 1
2021-06-29 20:42:56 +00:00
2022-08-01 08:25:54 +00:00
2022-08-08 08:46:02 +00:00
# For every entry on this list either remove it, or add an explanation why it's needed.
2021-06-29 20:42:56 +00:00
echo ">>>>>> Remove bundled libs"
keeplibs = (
2022-08-01 08:25:54 +00:00
base/third_party/cityhash #Derived code, not vendored dependency.
2022-08-08 08:46:02 +00:00
base/third_party/cityhash_v103 #Derived code, not vendored dep
2022-08-01 08:25:54 +00:00
base/third_party/icu #Derived code, not vendored dependency.
base/third_party/superfasthash #Not a shared library.
base/third_party/symbolize #Derived code, not vendored dependency.
base/third_party/xdg_user_dirs #Derived code, not vendored dependency.
chrome/third_party/mozilla_security_manager #Derived code, not vendored dependency.
net/third_party/mozilla_security_manager #Derived code, not vendored dependency.
net/third_party/nss #Derived code, not vendored dependency.
2022-08-08 08:46:02 +00:00
net/third_party/quiche #Not available as a shared library yet. An old version is in Factory (google-quiche-source)
2022-08-01 08:25:54 +00:00
net/third_party/uri_template #Derived code, not vendored dependency.
2023-10-16 22:04:02 +00:00
third_party/abseil-cpp #Leap and fc36 too old.
2022-08-08 08:46:02 +00:00
third_party/angle # ANGLE is an integral part of chrome and is not available as a shared library.
2023-09-13 04:57:45 +00:00
third_party/angle/src/third_party/ceval #not in any distro
2022-08-01 08:25:54 +00:00
third_party/blink #Integral part of chrome
third_party/boringssl #Factory has an ancient version, but upstream seems to have gave up on making it a shared library
2022-08-08 08:46:02 +00:00
third_party/boringssl/src/third_party/fiat #Not in any distro
2022-08-01 08:25:54 +00:00
# We don't need it (disable-catapult.patch)
#third_party/catapult
#third_party/catapult/common/py_vulcanize/third_party/rcssmin
#third_party/catapult/common/py_vulcanize/third_party/rjsmin
#third_party/catapult/third_party/beautifulsoup4
2022-08-08 08:46:02 +00:00
#third_party/catapult/third_party/html5lib-1.1
2022-08-01 08:25:54 +00:00
#third_party/catapult/third_party/html5lib-python
#third_party/catapult/third_party/polymer
#third_party/catapult/third_party/six
#third_party/catapult/tracing/third_party/d3
#third_party/catapult/tracing/third_party/gl-matrix
#third_party/catapult/tracing/third_party/jpeg-js
#third_party/catapult/tracing/third_party/jszip
#third_party/catapult/tracing/third_party/mannwhitneyu
#third_party/catapult/tracing/third_party/oboe
#third_party/catapult/tracing/third_party/pako
2022-08-08 08:46:02 +00:00
third_party/ced #not in any distro
third_party/cld_3 #not in any distro. We have cld2 but not cld3
third_party/closure_compiler #the python scripts are not available separately
2022-08-01 08:25:54 +00:00
third_party/crashpad #Integral part of chrome
third_party/crashpad/crashpad/third_party/lss #Derived code, not vendored dependency.
third_party/crashpad/crashpad/third_party/zlib #Derived code, not vendored dependency.
third_party/cros_system_api #Integral part of Chrome. Needed.
2023-10-19 17:09:42 +00:00
third_party/d3 #javascript
2022-08-08 08:46:02 +00:00
third_party/dawn #Integral part of chrome, Needed even if you're building chrome without webgpu
third_party/dawn/third_party/gn/webgpu-cts #Integral part of chrome, Needed even if you're building chrome without webgpu
2022-09-15 04:57:08 +00:00
third_party/devtools-frontend #Javascript code, integral part of chrome
third_party/devtools-frontend/src/front_end/third_party #various javascript code compiled into chrome, see README.md
2023-09-13 04:57:45 +00:00
third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt
2025-01-12 20:37:55 +00:00
third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/parsel-js
2023-10-19 17:09:42 +00:00
third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs
2023-09-13 04:57:45 +00:00
third_party/devtools-frontend/src/third_party/i18n #javascript
2022-08-08 08:46:02 +00:00
third_party/dom_distiller_js #javascript
2022-08-01 08:25:54 +00:00
#third_party/eigen3 #Used only by tflite which is not used in electron
third_party/electron_node #Integral part of electron
2022-08-08 08:46:02 +00:00
third_party/emoji-segmenter #not available as a shared library
2025-01-12 20:37:55 +00:00
third_party/fast_float #Header-only library thus we're not debundling it rn.
2022-08-08 08:46:02 +00:00
third_party/fdlibm #derived code, not vendored dep
2024-07-12 10:45:39 +00:00
third_party/fp16 #Fedora 41 has it (but an old version?) Not in openSUSE. Header-only library thus we're not debundling it rn.
2022-08-01 08:25:54 +00:00
third_party/hunspell #heavily forked version
2022-08-08 08:46:02 +00:00
third_party/inspector_protocol #integral part of chrome
2022-10-04 19:13:55 +00:00
third_party/ipcz #not in any distro
2022-08-08 08:46:02 +00:00
third_party/khronos #Modified to add ANGLE definitions
2022-08-01 08:25:54 +00:00
third_party/leveldatabase #use of private headers
2025-08-23 18:33:03 +00:00
third_party/libaom #15.6 too old
third_party/libaom/source/libaom/third_party/fastfeat
third_party/libaom/source/libaom/third_party/SVT-AV1
third_party/libaom/source/libaom/third_party/vector
third_party/libaom/source/libaom/third_party/x86inc
2024-04-19 21:15:15 +00:00
third_party/libgav1 #Usage of private headers (ObuFrameHeader from utils/types.h)
2023-11-02 18:54:04 +00:00
third_party/libsrtp #Needs to be built against boringssl, not openssl
2022-08-08 08:46:02 +00:00
third_party/libsync #not yet in any distro
third_party/liburlpattern #Derived code, not vendored dep.
third_party/libva_protected_content #ChromeOS header not available separately. needed for build.
2023-09-13 04:57:45 +00:00
third_party/libvpx #15.5/FC37 too old
third_party/libvpx/source/libvpx/third_party/x86inc
2022-09-15 04:57:08 +00:00
third_party/libwebm #Usage of private headers (mkvparser/mkvmuxer)
2022-08-08 08:46:02 +00:00
third_party/libx11 #Derived code, not vendored dep
third_party/libxcb-keysyms #Derived code, not vendored dep
third_party/libxml/chromium #added chromium code
2022-08-01 08:25:54 +00:00
third_party/libyuv #The version in Fedora is too old
2024-04-19 21:15:15 +00:00
third_party/lit #javacript
2022-08-08 08:46:02 +00:00
third_party/lottie #javascript
third_party/lss #Wrapper for linux ABI
2022-08-01 08:25:54 +00:00
#third_party/maldoca #integral part of chrome, but not used in electron.
#third_party/maldoca/src/third_party
2023-09-13 04:57:45 +00:00
third_party/material_color_utilities #not in any distro
2022-08-08 08:46:02 +00:00
third_party/mesa_headers #ui/gl/gl_bindings.cc depends on GL_KHR_robustness not being defined.
third_party/metrics_proto #integral part of chrome
2023-03-10 06:02:08 +00:00
third_party/modp_b64 #not in Factory or Rawhide. pkgconfig(stringencoders) Mageia, AltLinux, Debian have it
2022-08-01 08:25:54 +00:00
third_party/node #javascript code
2022-08-08 08:46:02 +00:00
third_party/one_euro_filter #not in any distro
third_party/ots #not available as a shared library. Fedora has the cli version as opentype-sanitizer
2023-08-30 11:57:02 +00:00
#we don't build pdf support, removing it from tarball to save space
#third_party/pdfium #Part of chrome, not available separately.
#third_party/pdfium/third_party/agg23 #Heavily patched version. Fedora has it as agg
#third_party/pdfium/third_party/base #derived code, not vendored dependency
#third_party/pdfium/third_party/bigint #not on any distro
#third_party/pdfium/third_party/freetype #Copy of private headers
#third_party/pdfium/third_party/skia_shared #Skia is not available as a shared library yet.
2022-08-08 08:46:02 +00:00
third_party/perfetto #Seems not to be available as a shared library, despite the presence of a `debian` directory.
third_party/perfetto/protos/third_party/chromium #derived code, not vendored dep
2025-01-12 20:37:55 +00:00
third_party/perfetto/protos/third_party/simpleperf #not available in any distro
2022-08-08 08:46:02 +00:00
third_party/pffft #not in any distro, also heavily patched
third_party/polymer #javascript
third_party/protobuf #Heavily forked. Apparently was officially unbundlable back in the GYP days, and may be again in the future.
2025-08-23 18:33:03 +00:00
third_party/protobuf/third_party/utf8_range # Integral part of protobuf
2025-01-12 20:37:55 +00:00
third_party/rapidhash #Fork
2024-04-19 21:15:15 +00:00
third_party/re2 # fedora too old
2022-08-01 08:25:54 +00:00
third_party/rnnoise #use of private headers
2025-04-26 10:14:41 +00:00
third_party/search_engines_data #integral part of chromium (but should not be?). was under components/ before E35, see https://github.com/chromium/chromium/commit/b8a327a1aa0227cf96dbbe0ad55f1c2773b23c23
third_party/simdutf #Not in Factory
2022-08-01 08:25:54 +00:00
third_party/skia #integral part of chrome
2022-09-15 04:57:08 +00:00
third_party/speech-dispatcher #Headers for a delay-loaded optional dependency
2025-04-26 10:14:41 +00:00
third_party/spirv-headers #15.6 too old
2022-08-01 08:25:54 +00:00
third_party/sqlite #heavily forked version
2022-08-08 08:46:02 +00:00
third_party/swiftshader #not available as a shared library
third_party/swiftshader/third_party/astc-encoder #not in rawhide or factory. Debian has it (astc-encoder)
third_party/swiftshader/third_party/llvm-subzero #heavily forked version of libLLVM for use in subzero
third_party/swiftshader/third_party/marl #not on any distro
third_party/swiftshader/third_party/subzero #integral part of swiftshader
2022-08-01 08:25:54 +00:00
#third_party/tflite #Not used by electron, but chrome needs it.
#third_party/tflite/src/third_party/eigen3
#third_party/tflite/src/third_party/fft2d
2025-01-12 20:37:55 +00:00
third_party/vulkan-headers #15.6 too old
2024-01-17 22:28:47 +00:00
third_party/vulkan_memory_allocator #not in Factory
2022-08-08 08:46:02 +00:00
third_party/webgpu-cts #Javascript code. Needed even if you're building chrome without webgpu
2022-08-01 08:25:54 +00:00
third_party/webrtc #Integral part of chrome
2022-08-08 08:46:02 +00:00
third_party/webrtc/common_audio/third_party/ooura #derived code, not vendored dep
third_party/webrtc/common_audio/third_party/spl_sqrt_floor #derived code, not vendored dep
third_party/webrtc/modules/third_party/fft #derived code, not vendored dep
2024-10-25 04:44:39 +00:00
third_party/webrtc/modules/third_party/g711 #Fork. Original is from spandsp. Might be debundled if upstream ever accepts WebRTC's patches.
third_party/webrtc/modules/third_party/g722 #Fork. Original is from spandsp.
2022-08-08 08:46:02 +00:00
third_party/webrtc/rtc_base/third_party/sigslot #derived code, not vendored dep
third_party/webrtc_overrides #Integral part of chrome
2022-08-01 08:25:54 +00:00
third_party/widevine #Integral part of chrome. Needed.
2022-08-08 08:46:02 +00:00
third_party/wayland/wayland_scanner_wrapper.py #wrapper script
third_party/wayland-protocols/gtk/gdk/wayland/protocol #Imagine downloading 100MB of gtk source just to get one file.
2024-01-17 22:28:47 +00:00
third_party/wayland-protocols/mesa #egl-wayland-devel (Fedora) / libnvidia-egl-wayland1 (Tumbleweed). 15.6 has an old version that misses the file we need.
2022-08-08 08:46:02 +00:00
third_party/wayland-protocols/unstable #unknown origin. not in wayland-protocol-devel or elsewhere
third_party/wuffs #not in any distro
third_party/x11proto #derived code, not vendored dep
third_party/zlib/google #derived code, not vendored dep
url/third_party/mozilla #derived code, not vendored dep
v8/third_party/inspector_protocol #integral part of chrome
2025-04-26 10:14:41 +00:00
v8/third_party/rapidhash-v8 #derived code, not vendored dep
v8/third_party/siphash #derived code, not vendored dep
v8/third_party/utf8-decoder #derived code, not vendored dep
2022-08-08 08:46:02 +00:00
v8/third_party/v8 #derived code, not vendored dep
2025-04-26 10:14:41 +00:00
v8/third_party/valgrind #incompatible definition of VALGRIND_DISCARD_TRANSLATIONS
2021-06-29 20:42:56 +00:00
)
build/linux/unbundle/remove_bundled_libraries.py " ${ keeplibs [@] } " --do-remove
if [ $? -ne 0 ] ; then
echo "ERROR: remove_bundled_libraries.py failed"
cleanup_and_exit 1
fi
2022-08-08 08:46:02 +00:00
# Now remove additional bundled/duplicate libraries in node/deps
2024-09-14 08:17:25 +00:00
rm -rf third_party/electron_node/deps/{ googletest/{ include,src} ,icu-small,corepack} #292MB and vendored
#rm -rf third_party/electron_node/tools/gyp 15.6 has too old gyp, not unbundling for now.
rm -rf third_party/electron_node/tools/inspector_protocol/jinja2
2022-08-08 08:46:02 +00:00
find third_party/electron_node/deps/brotli -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
find third_party/electron_node/deps/cares -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2022-09-21 09:00:14 +00:00
find third_party/electron_node/deps/nghttp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2024-07-20 10:06:30 +00:00
find third_party/electron_node/deps/ngtcp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2022-08-08 08:46:02 +00:00
find third_party/electron_node/deps/openssl -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2025-04-26 10:14:41 +00:00
find third_party/electron_node/deps/simdutf -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2025-06-26 19:00:03 +00:00
find third_party/electron_node/deps/sqlite -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2022-08-08 08:46:02 +00:00
find third_party/electron_node/deps/v8 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2025-05-17 09:23:17 +00:00
rm -rvf third_party/electron_node/deps/v8/{ tools,include}
2024-04-19 21:15:15 +00:00
ln -srv v8/tools -t third_party/electron_node/deps/v8/
2025-05-17 09:23:17 +00:00
ln -srv v8/include -t third_party/electron_node/deps/v8/
2022-08-08 08:46:02 +00:00
find third_party/electron_node/deps/zlib -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2025-05-17 09:23:17 +00:00
find third_party/electron_node/deps/zstd -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
2022-08-08 08:46:02 +00:00
2024-09-16 18:02:24 +00:00
# vendored system headers
rm -rf build/linux/debian*sysroot
2022-08-08 08:46:02 +00:00
#Some more chonkers
rm -rf components/test/data #21MB
rm -rf docs #30MB
rm -rf media/test/data #62MB
rm -rf native_client_sdk/doc_generated #21MB
rm -rf third_party/blink/{ manual,perf} _tests #70MB
rm -rf third_party/electron_node/{ doc,test} #42MB
rm -rf third_party/libaom/fuzz #44MB
rm -rf third_party/perfetto/docs #11MB
rm -rf third_party/protobuf/{ csharp,java,js,objectivec,php,ruby} #22MB
rm -rf third_party/skia/{ bench,docs,gm,platform_tools,resources,site,test,tools} #67MB
rm -rf third_party/sqlite/fuzz #61MB
rm -rf third_party/swiftshader/tests/regres #381MB
rm -rf third_party/webrtc/data #27MB
rm -rf tools/disable_tests #6MB
rm -rf tools/perf/{ page_sets,testdata} #55MB
2021-11-04 15:09:34 +00:00
rm -rf third_party/blink/web_tests # 1.6GB
rm -rf third_party/catapult/tracing/test_data # 200MB
2022-12-03 23:54:17 +00:00
rm -rf third_party/sqlite/src/test #86MB
2022-09-09 08:50:38 +00:00
find chrome/test/data -type f ! -name "*.gn" -a ! -name "*.gni" -delete #249MB, thanks Mageia
2023-08-30 11:57:02 +00:00
find third_party/hunspell_dictionaries -type f ! -name "*.gn" -a ! -name "*.gni" -delete #262MB
2022-08-08 08:46:02 +00:00
2022-12-03 23:54:17 +00:00
#see electron/.circleci/config/base.yml
rm -rf android_webview
rm -rf ios/chrome
2022-08-08 08:46:02 +00:00
2021-11-04 15:09:34 +00:00
find . -type d -name .git -print0 | xargs -0 rm -rf
2022-05-20 08:19:40 +00:00
# Remove generatted python bytecode
find . -type d -name __pycache__ -print0 | xargs -0 rm -rvf
find . -type f -name '*.pyc' -print -delete
2022-08-01 08:25:54 +00:00
echo ">>>>>> Remove non-free binaries"
2023-01-13 05:29:42 +00:00
find . -type f -name "*.wasm" -print -delete
2022-08-08 08:46:02 +00:00
find . -type f -name "*.jar" -print -delete
find . -type f -name "*.exe" -print -delete
2022-08-01 08:25:54 +00:00
find . -type f -name "*.node" -print -delete
find . -type f -name "*.dll" -print -delete
find . -type f -name "*.dylib" -print -delete
find . -type f -name "*.so" -print -delete
find . -type f -name "*.o" -print -delete
find . -type f -name "*.a" -print -delete
2022-08-08 08:46:02 +00:00
#We use sponge to avoid a race condition between find and rm
2023-01-26 08:36:20 +00:00
find -type f | sponge | xargs -P$( nproc) -- sh -c 'file -S "$@" | grep -v ' \' ' .*script' \' ' | grep ' \' ' .*executable' \' ' | tee /dev/stderr | sed ' \' 's/: .*//' \' ' | xargs rm -fv'
2022-08-01 08:25:54 +00:00
2022-07-04 09:07:38 +00:00
# Remove empty directories
2022-09-21 09:00:14 +00:00
echo ">>>>>> Remove empty directories"
2022-07-04 09:07:38 +00:00
find . -type d -empty -print -delete
2021-11-04 15:09:34 +00:00
popd || cleanup_and_exit 1
2021-06-29 20:42:56 +00:00
2023-03-10 06:02:08 +00:00
#echo ">>>>>> Hardlink duplicate files to reduce extraction time"
#Disabled this — it fails to link sometimes causing tarball nondeterminism
#/usr/lib/rpm/fdupes_wrapper src
2022-09-21 09:00:14 +00:00
2021-06-29 20:42:56 +00:00
echo ">>>>>> Create tarball"
2023-02-09 18:41:02 +00:00
ZSTD_CLEVEL = 19 ZSTD_NBTHREADS = $( nproc) tar --zstd --sort= name -vvScf " ${ ELECTRON_PKGDIR } / ${ ELECTRON_PKGNAME } - ${ ELECTRON_PKGVERSION } .tar.zst " src
2021-06-29 20:42:56 +00:00
if [ $? -ne 0 ] ; then
2022-08-08 08:46:02 +00:00
echo "ERROR: tar cf failed"
2021-06-29 20:42:56 +00:00
cleanup_and_exit 1
fi
2021-11-04 15:09:34 +00:00
popd || cleanup_and_exit 1
2021-06-29 20:42:56 +00:00
cleanup_and_exit 0