v8: fix darwin build

authored by Stanisław Pitucha and committed by Stanisław Pitucha 099df1f9 cc9c837a

+14 -7
+7 -4
pkgs/development/libraries/v8/default.nix
··· 2 , gn, ninja, python3, glib, pkg-config, icu 3 , xcbuild, darwin 4 , fetchpatch 5 }: 6 7 # Use update.sh to update all checksums. ··· 106 touch build/config/gclient_args.gni 107 ''; 108 109 gnFlags = [ 110 "use_custom_libcxx=false" 111 "is_clang=${lib.boolToString stdenv.cc.isClang}" ··· 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"'' 126 - ] ++ lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"''; 127 128 NIX_CFLAGS_COMPILE = "-O2"; 129 FORCE_MAC_SDK_MIN = stdenv.targetPlatform.sdkVer or "10.12"; ··· 135 python3 136 ] ++ lib.optionals stdenv.isDarwin [ 137 xcbuild 138 - darwin.DarwinTools 139 python3.pkgs.setuptools 140 ]; 141 buildInputs = [ glib icu ]; ··· 166 maintainers = with maintainers; [ cstrahan proglodyte matthewbauer ]; 167 platforms = platforms.unix; 168 license = licenses.bsd3; 169 - # Fails to build on Darwin, see https://github.com/NixOS/nixpkgs/issues/158076 170 - broken = stdenv.isDarwin; 171 }; 172 }
··· 2 , gn, ninja, python3, glib, pkg-config, icu 3 , xcbuild, darwin 4 , fetchpatch 5 + , llvmPackages 6 + , symlinkJoin 7 }: 8 9 # Use update.sh to update all checksums. ··· 108 touch build/config/gclient_args.gni 109 ''; 110 111 + llvmCcAndBintools = symlinkJoin { name = "llvmCcAndBintools"; paths = [ stdenv.cc llvmPackages.llvm ]; }; 112 + 113 gnFlags = [ 114 "use_custom_libcxx=false" 115 "is_clang=${lib.boolToString stdenv.cc.isClang}" ··· 127 # ''custom_toolchain="//build/toolchain/linux/unbundle:default"'' 128 ''host_toolchain="//build/toolchain/linux/unbundle:default"'' 129 ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"'' 130 + ] ++ lib.optional stdenv.cc.isClang ''clang_base_path="${llvmCcAndBintools}"'' 131 + ++ lib.optional stdenv.isDarwin ''use_lld=false''; 132 133 NIX_CFLAGS_COMPILE = "-O2"; 134 FORCE_MAC_SDK_MIN = stdenv.targetPlatform.sdkVer or "10.12"; ··· 140 python3 141 ] ++ lib.optionals stdenv.isDarwin [ 142 xcbuild 143 + llvmPackages.llvm 144 python3.pkgs.setuptools 145 ]; 146 buildInputs = [ glib icu ]; ··· 171 maintainers = with maintainers; [ cstrahan proglodyte matthewbauer ]; 172 platforms = platforms.unix; 173 license = licenses.bsd3; 174 }; 175 }
+6
pkgs/development/ruby-modules/gem-config/default.nix
··· 361 buildInputs = [ which v8 python2 ]; 362 buildFlags = [ "--with-system-v8=true" ]; 363 dontBuild = false; 364 postPatch = '' 365 substituteInPlace ext/libv8/extconf.rb \ 366 --replace "location = Libv8::Location::Vendor.new" \
··· 361 buildInputs = [ which v8 python2 ]; 362 buildFlags = [ "--with-system-v8=true" ]; 363 dontBuild = false; 364 + # The gem includes broken symlinks which are ignored during unpacking, but 365 + # then fail during build. Since the content is missing anyway, touching the 366 + # files is enough to unblock the build. 367 + preBuild = '' 368 + touch vendor/depot_tools/cbuildbot vendor/depot_tools/chrome_set_ver vendor/depot_tools/cros_sdk 369 + ''; 370 postPatch = '' 371 substituteInPlace ext/libv8/extconf.rb \ 372 --replace "location = Libv8::Location::Vendor.new" \
+1 -3
pkgs/top-level/all-packages.nix
··· 15260 inherit (darwin) libobjc; 15261 }; 15262 defaultGemConfig = callPackage ../development/ruby-modules/gem-config { 15263 - # recent v8 doesn't build on nixpkgs Darwin yet. https://github.com/NixOS/nixpkgs/issues/158076 15264 - v8 = if stdenv.isDarwin then v8_8_x else v8; 15265 inherit (darwin) DarwinTools cctools; 15266 inherit (darwin.apple_sdk.frameworks) CoreServices; 15267 }; ··· 21813 21814 ucommon = callPackage ../development/libraries/ucommon { }; 21815 21816 - v8 = callPackage ../development/libraries/v8 { }; 21817 21818 v8_8_x = callPackage ../development/libraries/v8/8_x.nix { }; 21819
··· 15260 inherit (darwin) libobjc; 15261 }; 15262 defaultGemConfig = callPackage ../development/ruby-modules/gem-config { 15263 inherit (darwin) DarwinTools cctools; 15264 inherit (darwin.apple_sdk.frameworks) CoreServices; 15265 }; ··· 21811 21812 ucommon = callPackage ../development/libraries/ucommon { }; 21813 21814 + v8 = darwin.apple_sdk_11_0.callPackage ../development/libraries/v8 { }; 21815 21816 v8_8_x = callPackage ../development/libraries/v8/8_x.nix { }; 21817