v8: 8.4.255 -> 9.7.106.18

* Fix update.sh;
* Use specific gn revision;
* Install icudtl.dat.

+95 -99
+62 -48
pkgs/development/libraries/v8/default.nix
··· 1 { stdenv, lib, fetchgit, fetchFromGitHub 2 - , gn, ninja, python, pythonPackages, glib, pkg-config, icu 3 , xcbuild, darwin 4 , fetchpatch 5 }: 6 7 let 8 git_url = "https://chromium.googlesource.com"; 9 10 - # This data is from the DEPS file in the root of a V8 checkout 11 deps = { 12 "base/trace_event/common" = fetchgit { 13 url = "${git_url}/chromium/src/base/trace_event/common.git"; 14 - rev = "dab187b372fc17e51f5b9fad8201813d0aed5129"; 15 - sha256 = "0dmpj9hj4xv3xb0fl1kb9hm4bhpbs2s5csx3z8cgjd5vwvhdzig4"; 16 }; 17 - build = fetchgit { 18 url = "${git_url}/chromium/src/build.git"; 19 - rev = "26e9d485d01d6e0eb9dadd21df767a63494c8fea"; 20 - sha256 = "1jjvsgj0cs97d26i3ba531ic1f9gqan8x7z4aya8yl8jx02l342q"; 21 }; 22 "third_party/googletest/src" = fetchgit { 23 url = "${git_url}/external/github.com/google/googletest.git"; 24 - rev = "e3f0319d89f4cbf32993de595d984183b1a9fc57"; 25 - sha256 = "18xz71l2xjrqsc0q317whgw4xi1i5db24zcj7v04f5g6r1hyf1a5"; 26 }; 27 "third_party/icu" = fetchgit { 28 url = "${git_url}/chromium/deps/icu.git"; 29 - rev = "f2223961702f00a8833874b0560d615a2cc42738"; 30 - sha256 = "0z5p53kbrjfkjn0i12dpk55cp8976j2zk7a4wk88423s2c5w87zl"; 31 }; 32 "third_party/jinja2" = fetchgit { 33 url = "${git_url}/chromium/src/third_party/jinja2.git"; 34 - rev = "b41863e42637544c2941b574c7877d3e1f663e25"; 35 - sha256 = "1qgilclkav67m6cl2xq2kmzkswrkrb2axc2z8mw58fnch4j1jf1r"; 36 }; 37 "third_party/markupsafe" = fetchgit { 38 url = "${git_url}/chromium/src/third_party/markupsafe.git"; 39 - rev = "8f45f5cfa0009d2a70589bcda0349b8cb2b72783"; 40 - sha256 = "168ppjmicfdh4i1l0l25s86mdbrz9fgxmiq1rx33x79mph41scfz"; 41 - }; 42 - "third_party/zlib" = fetchgit { 43 - url = "${git_url}/chromium/src/third_party/zlib.git"; 44 - rev = "156be8c52f80cde343088b4a69a80579101b6e67"; 45 - sha256 = "0hxbkkzmlv714fjq2jlp5dd2jc339xyh6gkjx1sz3srwv33mlk92"; 46 }; 47 }; 48 49 in 50 51 stdenv.mkDerivation rec { 52 pname = "v8"; 53 - version = "8.4.255"; 54 55 doCheck = true; 56 57 patches = [ 58 - # Remove unrecognized clang debug flags 59 - (fetchpatch { 60 - url = "https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/663dbfc492fd2f8ba28d9af40fb3b1327e6aa56e/debian/patches/revert-Xclang-instcombine-lower-dbg-declare.patch"; 61 - sha256 = "07qp4bjgbwbdrzqslvl2bgbzr3v97b9isbp0539x3lc8cy3h02g1"; 62 - }) 63 ./darwin.patch 64 - ./gcc_arm.patch # Fix building zlib with gcc on aarch64, from https://gist.github.com/Adenilson/d973b6fd96c7709d33ddf08cf1dcb149 65 ]; 66 67 - src = fetchFromGitHub { 68 - owner = "v8"; 69 - repo = "v8"; 70 - rev = version; 71 - sha256 = "07ymw4kqbz7kv311gpk5bs5q90wj73n2q7jkyfhqk4hvhs1q5bw7"; 72 - }; 73 74 postUnpack = '' 75 ${lib.concatStringsSep "\n" ( ··· 80 chmod u+w -R . 81 ''; 82 83 - postPatch = lib.optionalString stdenv.isAarch64 '' 84 - substituteInPlace build/toolchain/linux/BUILD.gn \ 85 - --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""' 86 - '' + lib.optionalString stdenv.isDarwin '' 87 - substituteInPlace build/config/compiler/compiler.gni \ 88 - --replace 'strip_absolute_paths_from_debug_symbols = true' \ 89 - 'strip_absolute_paths_from_debug_symbols = false' 90 - substituteInPlace build/config/compiler/BUILD.gn \ 91 - --replace 'current_toolchain == host_toolchain || !use_xcode_clang' \ 92 - 'false' 93 ''; 94 95 gnFlags = [ ··· 106 "treat_warnings_as_errors=false" 107 "v8_enable_i18n_support=true" 108 "use_gold=false" 109 - "init_stack_vars=false" 110 # ''custom_toolchain="//build/toolchain/linux/unbundle:default"'' 111 ''host_toolchain="//build/toolchain/linux/unbundle:default"'' 112 ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"'' ··· 116 FORCE_MAC_SDK_MIN = stdenv.targetPlatform.sdkVer or "10.12"; 117 118 nativeBuildInputs = [ 119 - gn 120 ninja 121 pkg-config 122 - python 123 ] ++ lib.optionals stdenv.isDarwin [ 124 xcbuild 125 darwin.DarwinTools 126 - pythonPackages.setuptools 127 ]; 128 buildInputs = [ glib icu ]; 129 ··· 133 134 installPhase = '' 135 install -D d8 $out/bin/d8 136 - install -D obj/libv8_monolith.a $out/lib/libv8.a 137 cp -r ../../include $out 138 139 mkdir -p $out/lib/pkgconfig
··· 1 { stdenv, lib, fetchgit, fetchFromGitHub 2 + , gn, ninja, python3, glib, pkg-config, icu 3 , xcbuild, darwin 4 , fetchpatch 5 }: 6 + 7 + # Use update.sh to update all checksums. 8 9 let 10 + version = "9.7.106.18"; 11 + v8Src = fetchgit { 12 + url = "https://chromium.googlesource.com/v8/v8"; 13 + rev = version; 14 + sha256 = "0cb3w733w1xn6zq9dsr43nx6llcg9hrmb2dkxairarj9c0igpzyh"; 15 + }; 16 + 17 git_url = "https://chromium.googlesource.com"; 18 19 + # This data is from the DEPS file in the root of a V8 checkout. 20 deps = { 21 "base/trace_event/common" = fetchgit { 22 url = "${git_url}/chromium/src/base/trace_event/common.git"; 23 + rev = "7f36dbc19d31e2aad895c60261ca8f726442bfbb"; 24 + sha256 = "01b2fhbxznqbakxv42ivrzg6w8l7i9yrd9nf72d6p5xx9dm993j4"; 25 }; 26 + "build" = fetchgit { 27 url = "${git_url}/chromium/src/build.git"; 28 + rev = "cf325916d58a194a935c26a56fcf6b525d1e2bf4"; 29 + sha256 = "1ix4h1cpx9bvgln8590xh7lllhsd9w1hd5k9l1gx5yxxrmywd3s4"; 30 }; 31 "third_party/googletest/src" = fetchgit { 32 url = "${git_url}/external/github.com/google/googletest.git"; 33 + rev = "16f637fbf4ffc3f7a01fa4eceb7906634565242f"; 34 + sha256 = "11012k3c3mxzdwcw2iparr9lrckafpyhqzclsj26hmfbgbdi0rrh"; 35 }; 36 "third_party/icu" = fetchgit { 37 url = "${git_url}/chromium/deps/icu.git"; 38 + rev = "eedbaf76e49d28465d9119b10c30b82906e606ff"; 39 + sha256 = "0mppvx7wf9zlqjsfaa1cf06brh1fjb6nmiib0lhbb9hd55mqjdjj"; 40 + }; 41 + "third_party/zlib" = fetchgit { 42 + url = "${git_url}/chromium/src/third_party/zlib.git"; 43 + rev = "6da1d53b97c89b07e47714d88cab61f1ce003c68"; 44 + sha256 = "0v7ylmbwfwv6w6wp29qdf77kjjnfr2xzin08n0v1yvbhs01h5ppy"; 45 }; 46 "third_party/jinja2" = fetchgit { 47 url = "${git_url}/chromium/src/third_party/jinja2.git"; 48 + rev = "ee69aa00ee8536f61db6a451f3858745cf587de6"; 49 + sha256 = "1fsnd5h0gisfp8bdsfd81kk5v4mkqf8z368c7qlm1qcwc4ri4x7a"; 50 }; 51 "third_party/markupsafe" = fetchgit { 52 url = "${git_url}/chromium/src/third_party/markupsafe.git"; 53 + rev = "1b882ef6372b58bfd55a3285f37ed801be9137cd"; 54 + sha256 = "1jnjidbh03lhfaawimkjxbprmsgz4snr0jl06630dyd41zkdw5kr"; 55 }; 56 }; 57 58 + # See `gn_version` in DEPS. 59 + gnSrc = fetchgit { 60 + url = "https://gn.googlesource.com/gn"; 61 + rev = "8926696a4186279489cc2b8d768533e61bba73d7"; 62 + sha256 = "1084lnyb0a1khbgjvak05fcx6jy973wqvsf77n0alxjys18sg2yk"; 63 + }; 64 + 65 + myGn = gn.overrideAttrs (oldAttrs: { 66 + version = "for-v8"; 67 + src = gnSrc; 68 + }); 69 + 70 in 71 72 stdenv.mkDerivation rec { 73 pname = "v8"; 74 + inherit version; 75 76 doCheck = true; 77 78 patches = [ 79 ./darwin.patch 80 ]; 81 82 + src = v8Src; 83 84 postUnpack = '' 85 ${lib.concatStringsSep "\n" ( ··· 90 chmod u+w -R . 91 ''; 92 93 + postPatch = '' 94 + ${lib.optionalString stdenv.isAarch64 '' 95 + substituteInPlace build/toolchain/linux/BUILD.gn \ 96 + --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""' 97 + ''} 98 + ${lib.optionalString stdenv.isDarwin '' 99 + substituteInPlace build/config/compiler/compiler.gni \ 100 + --replace 'strip_absolute_paths_from_debug_symbols = true' \ 101 + 'strip_absolute_paths_from_debug_symbols = false' 102 + substituteInPlace build/config/compiler/BUILD.gn \ 103 + --replace 'current_toolchain == host_toolchain || !use_xcode_clang' \ 104 + 'false' 105 + ''} 106 + touch build/config/gclient_args.gni 107 ''; 108 109 gnFlags = [ ··· 120 "treat_warnings_as_errors=false" 121 "v8_enable_i18n_support=true" 122 "use_gold=false" 123 # ''custom_toolchain="//build/toolchain/linux/unbundle:default"'' 124 ''host_toolchain="//build/toolchain/linux/unbundle:default"'' 125 ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"'' ··· 129 FORCE_MAC_SDK_MIN = stdenv.targetPlatform.sdkVer or "10.12"; 130 131 nativeBuildInputs = [ 132 + myGn 133 ninja 134 pkg-config 135 + python3 136 ] ++ lib.optionals stdenv.isDarwin [ 137 xcbuild 138 darwin.DarwinTools 139 + python3.pkgs.setuptools 140 ]; 141 buildInputs = [ glib icu ]; 142 ··· 146 147 installPhase = '' 148 install -D d8 $out/bin/d8 149 + install -D -m644 obj/libv8_monolith.a $out/lib/libv8.a 150 + install -D -m644 icudtl.dat $out/share/v8/icudtl.dat 151 cp -r ../../include $out 152 153 mkdir -p $out/lib/pkgconfig
-31
pkgs/development/libraries/v8/gcc_arm.patch
··· 1 - diff --git a/third_party/zlib/contrib/optimizations/insert_string.h b/third_party/zlib/contrib/optimizations/insert_string.h 2 - index 1826601..d123305 100644 3 - --- a/third_party/zlib/contrib/optimizations/insert_string.h 4 - +++ b/third_party/zlib/contrib/optimizations/insert_string.h 5 - @@ -26,15 +26,23 @@ 6 - #define _cpu_crc32_u32 _mm_crc32_u32 7 - 8 - #elif defined(CRC32_ARMV8_CRC32) 9 - - #if defined(__clang__) 10 - + #if defined(__GNUC__) || defined(__clang__) 11 - #undef TARGET_CPU_WITH_CRC 12 - - #define __crc32cw __builtin_arm_crc32cw 13 - + #if defined(__clang__) 14 - + #define __crc32cw __builtin_arm_crc32cw 15 - + #elif defined(__GNUC__) 16 - + #define __crc32cw __builtin_aarch64_crc32cw 17 - + #endif 18 - #endif 19 - 20 - #define _cpu_crc32_u32 __crc32cw 21 - 22 - #if defined(__aarch64__) 23 - - #define TARGET_CPU_WITH_CRC __attribute__((target("crc"))) 24 - + #if defined(__clang__) 25 - + #define TARGET_CPU_WITH_CRC __attribute__((target("crc"))) 26 - + #elif defined(__GNUC__) 27 - + #define TARGET_CPU_WITH_CRC __attribute__((target("+crc"))) 28 - + #endif 29 - #else // !defined(__aarch64__) 30 - #define TARGET_CPU_WITH_CRC __attribute__((target("armv8-a,crc"))) 31 - #endif // defined(__aarch64__)
···
+32 -17
pkgs/development/libraries/v8/update.sh
··· 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 4 - TARGET_CHANNEL=beta 5 - FILE_PATH=6_x.nix 6 7 set -eo pipefail 8 9 - v8_version=$(curl -s "$VERSION_OVERVIEW" | awk -F "," "\$2 ~ /${TARGET_CHANNEL}/ { print \$11 }") 10 11 echo "Using V8 version --> $v8_version" 12 - sed -e "s#\\(version = \\)\"[0-9\.]*\"#\1\"$v8_version\"#" -i ${FILE_PATH} 13 14 - sha256=$(nix-prefetch-git --no-deepClone https://github.com/v8/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} 17 18 - deps="$(mktemp)" 19 20 - curl -s -o "$deps" "https://raw.githubusercontent.com/v8/v8/${v8_version}/DEPS" 21 - echo $deps 22 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") 27 28 if [ "$dep_rev" = "" ]; then 29 echo "Failed to resolve dependency $dep, not listed in DEPS file" ··· 31 exit 2 32 fi 33 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 }') 36 37 if [ "$sha256" = "" ]; then 38 echo "Failed to get sha256 via nix-prefetch-git $repo_url $dep_rev" ··· 40 exit 2 41 fi 42 43 - sed -e "/\"${escaped_dep}\" = fetchgit/ { n; n; s/\".*\"/\"${dep_rev}\"/; n; s/\".*\"/\"${sha256}\"/ }" -i ${FILE_PATH} 44 done 45 46 - rm -f "$deps" 47 echo done.
··· 1 #!/usr/bin/env nix-shell 2 + #! nix-shell -i bash -p curl -p nix-prefetch-git -p jq 3 VERSION_OVERVIEW=https://omahaproxy.appspot.com/all?os=linux 4 + TARGET_CHANNEL=stable 5 6 set -eo pipefail 7 8 + if [ -n "$1" ]; then 9 + v8_version="$1" 10 + shift 11 + else 12 + v8_version=$(curl -s "$VERSION_OVERVIEW" | awk -F "," "\$2 ~ /${TARGET_CHANNEL}/ { print \$11 }") 13 + fi 14 + 15 + if [ -n "$1" ]; then 16 + file_path="$1" 17 + else 18 + file_path=default.nix 19 + fi 20 21 echo "Using V8 version --> $v8_version" 22 + 23 + prefetched=$(nix-prefetch-git --no-deepClone https://chromium.googlesource.com/v8/v8 "refs/tags/${v8_version}") 24 + 25 + path=$(echo "$prefetched" | jq -r .path) 26 + sha256=$(echo "$prefetched" | jq -r .sha256) 27 + sed -e "s#\\(version = \\)\"[0-9\.]*\"#\1\"$v8_version\"#" -i ${file_path} 28 + sed -e "/v8Src = fetchgit/ { n; n; n; s/\".*\"/\"${sha256}\"/ }" -i ${file_path} 29 30 + deps="$path/DEPS" 31 32 + echo "$deps" 33 34 + echo "Processing gn" 35 + gn_rev=$(sed -ne "s/.*'gn_version': 'git_revision:\([^']*\).*/\1/p" < "$deps") 36 + gn_sha256=$(nix-prefetch-git --no-deepClone https://gn.googlesource.com/gn "$gn_rev" 2>/dev/null | jq -r .sha256) 37 + sed -e "/gnSrc = fetchgit/ { n; n; s/\".*\"/\"${gn_rev}\"/; n; s/\".*\"/\"${gn_sha256}\"/ }" -i ${file_path} 38 39 + sed -ne '/" = fetchgit {/ { s/.*"\(.*\)".*/\1/; p }' < ${file_path} | while read dep; do 40 echo "Processing dependency --> $dep" 41 escaped_dep=$(echo "$dep" | sed -e 's#/#\\/#g') 42 + dep_rev=$(sed -ne "/'${escaped_dep}':/ { n; s#.*+ '##; s#'.*##; p }" "$deps") 43 44 if [ "$dep_rev" = "" ]; then 45 echo "Failed to resolve dependency $dep, not listed in DEPS file" ··· 47 exit 2 48 fi 49 50 + repo_url=$(sed -ne "/\"${escaped_dep}\" = fetchgit/ { n; s/.*\"\(.*\)\".*/\1/; s#\${git_url}#https://chromium.googlesource.com#; p }" ${file_path}) 51 + sha256=$(nix-prefetch-git --no-deepClone "$repo_url" "$dep_rev" 2>/dev/null | jq -r .sha256) 52 53 if [ "$sha256" = "" ]; then 54 echo "Failed to get sha256 via nix-prefetch-git $repo_url $dep_rev" ··· 56 exit 2 57 fi 58 59 + sed -e "/\"${escaped_dep}\" = fetchgit/ { n; n; s/\".*\"/\"${dep_rev}\"/; n; s/\".*\"/\"${sha256}\"/ }" -i ${file_path} 60 done 61 62 echo done.
+1 -3
pkgs/top-level/all-packages.nix
··· 20194 stdenv = gcc6Stdenv; 20195 }); 20196 20197 - v8 = callPackage ../development/libraries/v8 { 20198 - inherit (python2Packages) python; 20199 - }; 20200 20201 vaapiIntel = callPackage ../development/libraries/vaapi-intel { }; 20202
··· 20194 stdenv = gcc6Stdenv; 20195 }); 20196 20197 + v8 = callPackage ../development/libraries/v8 { }; 20198 20199 vaapiIntel = callPackage ../development/libraries/vaapi-intel { }; 20200