v8: Fix darwin build

talyz 360abc8e 1fe6ed37

+26 -4
+26 -4
pkgs/development/libraries/v8/default.nix
··· 1 { stdenv, lib, fetchgit, fetchFromGitHub 2 - , gn, ninja, python, glib, pkg-config, icu 3 , xcbuild, darwin 4 , fetchpatch 5 }: ··· 55 doCheck = true; 56 57 patches = [ 58 ./darwin.patch 59 ./gcc_arm.patch # Fix building zlib with gcc on aarch64, from https://gist.github.com/Adenilson/d973b6fd96c7709d33ddf08cf1dcb149 60 ]; ··· 78 postPatch = lib.optionalString stdenv.isAarch64 '' 79 substituteInPlace build/toolchain/linux/BUILD.gn \ 80 --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""' 81 ''; 82 83 gnFlags = [ ··· 85 "is_clang=${lib.boolToString stdenv.cc.isClang}" 86 "use_sysroot=false" 87 # "use_system_icu=true" 88 "is_component_build=false" 89 "v8_use_external_startup_data=false" 90 "v8_monolithic=true" ··· 93 "treat_warnings_as_errors=false" 94 "v8_enable_i18n_support=true" 95 "use_gold=false" 96 - "use_system_xcode=true" 97 # ''custom_toolchain="//build/toolchain/linux/unbundle:default"'' 98 ''host_toolchain="//build/toolchain/linux/unbundle:default"'' 99 ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"'' 100 ] ++ lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"''; 101 102 NIX_CFLAGS_COMPILE = "-O2"; 103 104 - nativeBuildInputs = [ gn ninja pkg-config python ] 105 - ++ lib.optionals stdenv.isDarwin [ xcbuild darwin.DarwinTools ]; 106 buildInputs = [ glib icu ]; 107 108 ninjaFlags = [ ":d8" "v8_monolith" ];
··· 1 { stdenv, lib, fetchgit, fetchFromGitHub 2 + , gn, ninja, python, pythonPackages, glib, pkg-config, icu 3 , xcbuild, darwin 4 , fetchpatch 5 }: ··· 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 ]; ··· 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 = [ ··· 97 "is_clang=${lib.boolToString stdenv.cc.isClang}" 98 "use_sysroot=false" 99 # "use_system_icu=true" 100 + "clang_use_chrome_plugins=false" 101 "is_component_build=false" 102 "v8_use_external_startup_data=false" 103 "v8_monolithic=true" ··· 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"'' 113 ] ++ lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"''; 114 115 NIX_CFLAGS_COMPILE = "-O2"; 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 130 ninjaFlags = [ ":d8" "v8_monolith" ];