This repository has been archived by the owner on May 16, 2022. It is now read-only.
forked from blazerod/v8-prebuilt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-v8.sh
executable file
·106 lines (94 loc) · 2.18 KB
/
build-v8.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
set -euo pipefail
PATH="$PWD/depot_tools:$PATH"
platform=$1
version=${2#"v"}
spec=`cat <<EOF
solutions = [{
'name': 'v8',
'url': 'https://chromium.googlesource.com/v8/v8.git',
'deps_file': 'DEPS',
'managed': False,
'custom_deps': {
'v8/test/benchmarks/data': None,
'v8/test/mozilla/data': None,
'v8/test/test262/data': None,
'v8/test/test262/harness': None,
'v8/test/wasm-js': None,
'v8/testing/gmock': None,
'v8/third_party/android_tools': None,
'v8/third_party/catapult': None,
'v8/third_party/colorama/src': None,
'v8/third_party/instrumented_libraries': None,
'v8/tools/gyp': None,
'v8/tools/luci-go': None,
'v8/tools/swarming_client': None
},
'custom_vars': {
'build_for_node': True
}
}]
EOF
`
spec="${spec//$'\n'/}"
build_args=`cat <<EOF
clang_use_chrome_plugins=false
is_component_build=false
is_debug=false
linux_use_bundled_binutils=false
strip_debug_info=true
symbol_level=0
treat_warnings_as_errors=false
use_custom_libcxx=false
use_sysroot=false
v8_enable_gdbjit=false
v8_enable_i18n_support=false
v8_enable_test_features=false
v8_enable_pointer_compression=true
v8_extra_library_files=[]
v8_monolithic=true
v8_untrusted_code_mitigations=false
v8_use_external_startup_data=false
v8_use_snapshot=true
EOF
`
build_args="${build_args//$'\n'/}"
# Resolve platform name
case $platform in
Linux)
platform=linux
;;
macOS)
platform=darwin
;;
*)
echo "Invalid platform $platform"
exit 1
;;
esac
# Acquire V8 source
if [ ! -d v8 ]; then
fetch v8
fi
# Prepare build directory
rm -rf build
mkdir build
# Prepare solution
gclient sync -R -D --revision $version --spec "$spec"
# Generate build config
cd v8
gn gen ../build --args="$build_args"
cd ..
# Build V8
cd v8
ninja -v -C ../build v8_monolith
cd ..
# Create package
rm -rf package
mkdir package
cp build/obj/libv8_monolith.a package/libv8.a
cp -r v8/include package/include
tar czf build/v8-v$version-$platform.tar.gz -C package .
# Output package metadata for GitHub actions
echo "::set-output name=package::v8-v$version-$platform"
echo "::set-output name=package_path::build/v8-v$version-$platform.tar.gz"