about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/v8/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-06-22 15:01:47 +0000
committerAlyssa Ross <hi@alyssa.is>2021-06-22 16:57:59 +0000
commit633cab0ecb07627706c6b523e219490f019eaab5 (patch)
tree4fb472bdfe2723037dad53dc1b8a87c939015f5e /nixpkgs/pkgs/development/libraries/v8/default.nix
parentffb691c199e7e0cbc4e45e5310779c9e3f7c2a73 (diff)
parent432fc2d9a67f92e05438dff5fdc2b39d33f77997 (diff)
downloadnixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.gz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.bz2
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.lz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.xz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.zst
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.zip
Merge commit '432fc2d9a67f92e05438dff5fdc2b39d33f77997'
# Conflicts:
#	nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-generated.nix
#	nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/default.nix
#	nixpkgs/pkgs/applications/window-managers/sway/default.nix
#	nixpkgs/pkgs/build-support/rust/default.nix
#	nixpkgs/pkgs/development/go-modules/generic/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/v8/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/default.nix32
1 files changed, 27 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/development/libraries/v8/default.nix b/nixpkgs/pkgs/development/libraries/v8/default.nix
index d513e01b7a35..7c463aa01228 100644
--- a/nixpkgs/pkgs/development/libraries/v8/default.nix
+++ b/nixpkgs/pkgs/development/libraries/v8/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchgit, fetchFromGitHub
-, gn, ninja, python, glib, pkg-config, icu
+, gn, ninja, python, pythonPackages, glib, pkg-config, icu
 , xcbuild, darwin
 , fetchpatch
 }:
@@ -55,6 +55,11 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   patches = [
+    # Remove unrecognized clang debug flags
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/663dbfc492fd2f8ba28d9af40fb3b1327e6aa56e/debian/patches/revert-Xclang-instcombine-lower-dbg-declare.patch";
+      sha256 = "07qp4bjgbwbdrzqslvl2bgbzr3v97b9isbp0539x3lc8cy3h02g1";
+    })
     ./darwin.patch
     ./gcc_arm.patch  # Fix building zlib with gcc on aarch64, from https://gist.github.com/Adenilson/d973b6fd96c7709d33ddf08cf1dcb149
   ];
@@ -78,6 +83,13 @@ stdenv.mkDerivation rec {
   postPatch = lib.optionalString stdenv.isAarch64 ''
     substituteInPlace build/toolchain/linux/BUILD.gn \
       --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace build/config/compiler/compiler.gni \
+      --replace 'strip_absolute_paths_from_debug_symbols = true' \
+                'strip_absolute_paths_from_debug_symbols = false'
+    substituteInPlace build/config/compiler/BUILD.gn \
+      --replace 'current_toolchain == host_toolchain || !use_xcode_clang' \
+                'false'
   '';
 
   gnFlags = [
@@ -85,6 +97,7 @@ stdenv.mkDerivation rec {
     "is_clang=${lib.boolToString stdenv.cc.isClang}"
     "use_sysroot=false"
     # "use_system_icu=true"
+    "clang_use_chrome_plugins=false"
     "is_component_build=false"
     "v8_use_external_startup_data=false"
     "v8_monolithic=true"
@@ -93,16 +106,25 @@ stdenv.mkDerivation rec {
     "treat_warnings_as_errors=false"
     "v8_enable_i18n_support=true"
     "use_gold=false"
-    "use_system_xcode=true"
+    "init_stack_vars=false"
     # ''custom_toolchain="//build/toolchain/linux/unbundle:default"''
     ''host_toolchain="//build/toolchain/linux/unbundle:default"''
     ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"''
   ] ++ lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"'';
 
   NIX_CFLAGS_COMPILE = "-O2";
-
-  nativeBuildInputs = [ gn ninja pkg-config python ]
-    ++ lib.optionals stdenv.isDarwin [ xcbuild darwin.DarwinTools ];
+  FORCE_MAC_SDK_MIN = stdenv.targetPlatform.sdkVer or "10.12";
+
+  nativeBuildInputs = [
+    gn
+    ninja
+    pkg-config
+    python
+  ] ++ lib.optionals stdenv.isDarwin [
+    xcbuild
+    darwin.DarwinTools
+    pythonPackages.setuptools
+  ];
   buildInputs = [ glib icu ];
 
   ninjaFlags = [ ":d8" "v8_monolith" ];