-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtools
More file actions
219 lines (191 loc) · 8.28 KB
/
Copy pathtools
File metadata and controls
219 lines (191 loc) · 8.28 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#!/bin/bash
if [ ! -z ${VCINSTALLDIR+x} ]; then
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
fi
export TOP_LEVEL_DIR=`git rev-parse --show-toplevel`
export PATH=$(echo ${PATH} | sed "s,${TOP_LEVEL_DIR}/bin,,g" | sed 's/:*$//')
export PATH=$PATH:$TOP_LEVEL_DIR/bin
export DEPOT_TOOLS_WIN_TOOLCHAIN=0
download-zip(){
pushd . > /dev/null
cd $TOP_LEVEL_DIR
curl $1 -L --output $2
mkdir -p bin
cd bin
unzip -o $TOP_LEVEL_DIR/$2
popd > /dev/null
}
git-clone(){
pushd . > /dev/null
if [ ! -d "$TOP_LEVEL_DIR/$2" ]; then
git clone $1 $TOP_LEVEL_DIR/$2
cd $TOP_LEVEL_DIR/$2
git config advice.detachedHead false
git checkout $3
fi
popd > /dev/null
}
update-gn-files(){
mkdir -p $TOP_LEVEL_DIR/v8/third_party/zlib
mkdir -p $TOP_LEVEL_DIR/v8/third_party/icu
cp -u $TOP_LEVEL_DIR/$1/zlib.gn $TOP_LEVEL_DIR/v8/third_party/zlib/BUILD.gn
cp -u $TOP_LEVEL_DIR/$1/icu.gn $TOP_LEVEL_DIR/v8/third_party/icu/BUILD.gn
cp -u $TOP_LEVEL_DIR/$1/config.gni $TOP_LEVEL_DIR/v8/third_party/icu/
touch $TOP_LEVEL_DIR/v8/third_party/icu/sources.gni
cp -u $TOP_LEVEL_DIR/gclient_args.gni $TOP_LEVEL_DIR/v8/build/config/gclient_args.gni
}
fetch(){
. VERSION
download-zip https://chrome-infra-packages.appspot.com/dl/gn/gn/windows-amd64/+/"${GN_WINDOWS_VERSION}" gn-windows.zip
download-zip https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/"${GN_LINUX_VERSION}" gn-linux.zip
git-clone "${V8_REPO}" v8
git-clone "${BUILD_REPO}" v8/build
git-clone https://chromium.googlesource.com/chromium/src/base/trace_event/common.git v8/base/trace_event/common "${COMMON_HASH}"
git-clone https://chromium.googlesource.com/external/github.com/google/googletest.git v8/third_party/googletest/src "${GOOGLETEST_HASH}"
git-clone https://chromium.googlesource.com/chromium/src/third_party/jinja2.git v8/third_party/jinja2 "${JINJA2_HASH}"
git-clone https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git v8/third_party/markupsafe "${MARKUPSAFE_HASH}"
git-clone https://chromium.googlesource.com/chromium/src/third_party/zlib.git v8/third_party/zlib "${ZLIB_HASH}"
#find $TOP_LEVEL_DIR/v8/third_party/zlib -maxdepth 1 -not -name "google" -not -name ".git" -not -name "zlib" -exec rm -rf {} \;
python v8/build/util/lastchange.py -o v8/build/util/LASTCHANGE
}
checkout-main(){
pushd . > /dev/null
cd "$TOP_LEVEL_DIR"/v8
git checkout main
cd "$TOP_LEVEL_DIR"/v8/build
git checkout main
cd "$TOP_LEVEL_DIR"/v8/base/trace_event/common
git checkout main
cd "$TOP_LEVEL_DIR"/v8/third_party/googletest/src
git checkout main
cd "$TOP_LEVEL_DIR"/v8/third_party/jinja2
git checkout main
cd "$TOP_LEVEL_DIR"/v8/third_party/markupsafe
git checkout main
cd "$TOP_LEVEL_DIR"/v8/third_party/zlib
git checkout main
#python "$TOP_LEVEL_DIR"/v8/build/util/lastchange.py -o "$TOP_LEVEL_DIR"/v8/build/util/LASTCHANGE
popd > /dev/null
}
# Usage build-mingw-shared <arch> <debug>
# example build-mingw-shared x64 true
build-mingw-shared(){
update-gn-files mingw
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8
gn gen "${TOP_LEVEL_DIR}/out/mingw-shared-$1-$2" --args="is_debug=$2 is_component_build=true target_cpu=\"$1\" is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false zlib_use_system_library=true icu_use_system_library=true enable_iterator_debugging=$2 v8_use_external_startup_data=true"
ninja -C "${TOP_LEVEL_DIR}/out/mingw-shared-$1-$2"
popd > /dev/null
}
# Usage build-mingw-static <arch> <debug>
# example build-mingw-static x64 true
build-mingw-static(){
update-gn-files mingw
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8
gn gen "${TOP_LEVEL_DIR}/out/mingw-static-$1-$2" --args="is_debug=$2 is_component_build=false v8_monolithic=true target_cpu=\"$1\" is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false zlib_use_system_library=true icu_use_system_library=true enable_iterator_debugging=$2 v8_use_external_startup_data=false"
ninja -C "${TOP_LEVEL_DIR}/out/mingw-static-$1-$2"
popd > /dev/null
}
# Usage build-msvc-shared <arch> <debug> <pkg_config_libdir>
# example build-msvc-shared x64 false C:\\Code\\vcpkg\\installed\\x64-windows\\lib\\pkgconfig
build-msvc-shared(){
update-gn-files msvc
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8
gn gen "${TOP_LEVEL_DIR}/out/msvc-shared-${1}-${2}" --args="is_debug=$2 pkg_config_libdir=\"$3\" is_component_build=true target_cpu=\"$1\" is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false zlib_use_system_library=true icu_use_system_library=true enable_iterator_debugging=${2} v8_use_external_startup_data=true use_sysroot=false"
ninja -C "${TOP_LEVEL_DIR}/out/msvc-shared-${1}-${2}"
popd > /dev/null
}
# Usage build-msvc-static <arch> <debug> <pkg_config_libdir>
# example build-msvc-static x64 false C:\\Code\\vcpkg\\installed\\x64-windows\\lib\\pkgconfig
build-msvc-static(){
update-gn-files msvc
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8
gn gen "${TOP_LEVEL_DIR}/out/msvc-static-${1}-${2}" --args="is_debug=$2 pkg_config_libdir=\"$3\" is_component_build=false v8_monolithic=true target_cpu=\"$1\" is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false icu_use_system_library=true enable_iterator_debugging=$2 v8_use_external_startup_data=false use_sysroot=false"
ninja -C "${TOP_LEVEL_DIR}/out/msvc-static-${1}-${2}"
popd > /dev/null
}
# Usage build-linux-shared <arch> <debug>
# example build-linux-shared x64 true
build-linux-shared(){
update-gn-files mingw
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8
gn gen "${TOP_LEVEL_DIR}/out/linux-shared-$1-$2" --args="is_debug=$2 use_sysroot=false is_component_build=true target_cpu=\"$1\" is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false zlib_use_system_library=true icu_use_system_library=true enable_iterator_debugging=$2 v8_use_external_startup_data=true"
ninja -C "${TOP_LEVEL_DIR}/out/linux-shared-$1-$2"
popd > /dev/null
}
# Usage build-linux_static <arch> <debug>
# example build-linux-static x64 true
build-linux-static(){
update-gn-files
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8
gn gen "${TOP_LEVEL_DIR}/out/linux-static-$1-$2" --args="is_debug=$2 use_sysroot=false is_component_build=false v8_monolithic=true target_cpu=\"$1\" is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false icu_disable_thin_archive=false zlib_use_system_library=true icu_use_data_file=false enable_iterator_debugging=$2 v8_use_external_startup_data=false"
ninja -C "${TOP_LEVEL_DIR}/out/linux-static-$1-$2"
popd > /dev/null
}
gitk-build(){
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8/build
gitk "$@"
popd > /dev/null
}
git-build(){
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8/build
git "$@"
popd > /dev/null
}
gitk-v8(){
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8
gitk "$@"
popd > /dev/null
}
git-v8(){
pushd . > /dev/null
cd $TOP_LEVEL_DIR/v8
git "$@"
popd > /dev/null
}
print-versions(){
. VERSION
echo V8_VERSION = ${V8_VERSION}
echo V8_REPO = ${V8_REPO}
echo BUILD_REPO = ${BUILD_REPO}
echo GN_VERSION = ${GN_VERSION}
echo COMMON_HASH = ${COMMON_HASH}
echo GOOGLETEST_HASH = ${GOOGLETEST_HASH}
echo JINJA2_HASH = ${JINJA2_HASH}
echo MARKUPSAFE_HASH = ${MARKUPSAFE_HASH}
echo ZLIB_HASH = ${ZLIB_HASH}
}
write-build-patch(){
. VERSION
git-build diff ${V8_VERSION} > ${TOP_LEVEL_DIR}/build.patch
sed -i 's/[ \t]*$//' ${TOP_LEVEL_DIR}/build.patch
sed -i 's/100755/100644/' ${TOP_LEVEL_DIR}/build.patch
sha256sum ${TOP_LEVEL_DIR}/build.patch
}
write-v8-patch(){
. VERSION
git-v8 diff ${V8_VERSION} > ${TOP_LEVEL_DIR}/v8.patch
sed -i 's/[ \t]*$//' ${TOP_LEVEL_DIR}/v8.patch
sed -i 's/100755/100644/' ${TOP_LEVEL_DIR}/v8.patch
sha256sum ${TOP_LEVEL_DIR}/v8.patch
}
add-remote-upstreams(){
git-build remote add upstream https://chromium.googlesource.com/chromium/src/build.git
git-v8 remote add upstream https://github.com/v8/v8.git
}
update-upstreams(){
git-build fetch upstream
git-v8 fetch upstream
}
setup-depot-tools(){
git-clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools
export PATH=${TOP_LEVEL_DIR}/depot_tools:$PATH
}