1 #!/usr/bin/env nix-shell
2 #! nix-shell -i bash -p curl -p nix-prefetch-git
3 VERSION_OVERVIEW
=https
://omahaproxy.appspot.com
/all?os
=linux
9 v8_version
=$
(curl
-s "$VERSION_OVERVIEW" |
awk -F "," "\$2 ~ /${TARGET_CHANNEL}/ { print \$11 }")
11 echo "Using V8 version --> $v8_version"
12 sed -e "s#\\(version = \\)\"[0-9\.]*\"#\1\"$v8_version\"#" -i ${FILE_PATH}
14 sha256
=$
(nix-prefetch-git
--no-deepClone https
://github.com
/v
8/v8.git
"refs/tags/${v8_version}" \
15 |
sed -ne '/sha256/ { s#.*: "\(.*\)".*#\1#; p }')
16 sed -e "/repo = \"v8\"/ { n;n; s#\".*\"#\"${sha256}\"# }" -i ${FILE_PATH}
20 curl
-s -o "$deps" "https://raw.githubusercontent.com/v8/v8/${v8_version}/DEPS"
23 sed -ne '/= fetchgit {/ { s/.*"\(.*\)".*/\1/; p }' < ${FILE_PATH} |
while read dep
; do
24 echo "Processing dependency --> $dep"
25 escaped_dep
=$
(echo "$dep" |
sed -e 's#/#\\/#g')
26 dep_rev
=$
(sed -ne "/\"v8\/${escaped_dep}\":/ { n; s#.*+ \"##; s#\".*##; p }" "$deps")
28 if [ "$dep_rev" = "" ]; then
29 echo "Failed to resolve dependency $dep, not listed in DEPS file"
34 repo_url
=$
(sed -ne "/\"${escaped_dep}\" = fetchgit/ { n; s/.*\"\(.*\)\".*/\1/; s#\${git_url}#https://chromium.googlesource.com#; p }" ${FILE_PATH})
35 sha256
=$
(nix-prefetch-git
--no-deepClone "$repo_url" "$dep_rev" 2>/dev
/null |
sed -ne '/sha256/ { s#.*: "\(.*\)".*#\1#; p }')
37 if [ "$sha256" = "" ]; then
38 echo "Failed to get sha256 via nix-prefetch-git $repo_url $dep_rev"
43 sed -e "/\"${escaped_dep}\" = fetchgit/ { n; n; s/\".*\"/\"${dep_rev}\"/; n; s/\".*\"/\"${sha256}\"/ }" -i ${FILE_PATH}