tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
v8: Fix darwin build
talyz
4 years ago
360abc8e
1fe6ed37
+26
-4
1 changed file
expand all
collapse all
unified
split
pkgs
development
libraries
v8
default.nix
+26
-4
pkgs/development/libraries/v8/default.nix
···
1
1
{ stdenv, lib, fetchgit, fetchFromGitHub
2
2
-
, gn, ninja, python, glib, pkg-config, icu
2
2
+
, gn, ninja, python, pythonPackages, glib, pkg-config, icu
3
3
, xcbuild, darwin
4
4
, fetchpatch
5
5
}:
···
55
55
doCheck = true;
56
56
57
57
patches = [
58
58
+
# Remove unrecognized clang debug flags
59
59
+
(fetchpatch {
60
60
+
url = "https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/663dbfc492fd2f8ba28d9af40fb3b1327e6aa56e/debian/patches/revert-Xclang-instcombine-lower-dbg-declare.patch";
61
61
+
sha256 = "07qp4bjgbwbdrzqslvl2bgbzr3v97b9isbp0539x3lc8cy3h02g1";
62
62
+
})
58
63
./darwin.patch
59
64
./gcc_arm.patch # Fix building zlib with gcc on aarch64, from https://gist.github.com/Adenilson/d973b6fd96c7709d33ddf08cf1dcb149
60
65
];
···
78
83
postPatch = lib.optionalString stdenv.isAarch64 ''
79
84
substituteInPlace build/toolchain/linux/BUILD.gn \
80
85
--replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
86
86
+
'' + lib.optionalString stdenv.isDarwin ''
87
87
+
substituteInPlace build/config/compiler/compiler.gni \
88
88
+
--replace 'strip_absolute_paths_from_debug_symbols = true' \
89
89
+
'strip_absolute_paths_from_debug_symbols = false'
90
90
+
substituteInPlace build/config/compiler/BUILD.gn \
91
91
+
--replace 'current_toolchain == host_toolchain || !use_xcode_clang' \
92
92
+
'false'
81
93
'';
82
94
83
95
gnFlags = [
···
85
97
"is_clang=${lib.boolToString stdenv.cc.isClang}"
86
98
"use_sysroot=false"
87
99
# "use_system_icu=true"
100
100
+
"clang_use_chrome_plugins=false"
88
101
"is_component_build=false"
89
102
"v8_use_external_startup_data=false"
90
103
"v8_monolithic=true"
···
93
106
"treat_warnings_as_errors=false"
94
107
"v8_enable_i18n_support=true"
95
108
"use_gold=false"
96
96
-
"use_system_xcode=true"
109
109
+
"init_stack_vars=false"
97
110
# ''custom_toolchain="//build/toolchain/linux/unbundle:default"''
98
111
''host_toolchain="//build/toolchain/linux/unbundle:default"''
99
112
''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"''
100
113
] ++ lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"'';
101
114
102
115
NIX_CFLAGS_COMPILE = "-O2";
116
116
+
FORCE_MAC_SDK_MIN = stdenv.targetPlatform.sdkVer or "10.12";
103
117
104
104
-
nativeBuildInputs = [ gn ninja pkg-config python ]
105
105
-
++ lib.optionals stdenv.isDarwin [ xcbuild darwin.DarwinTools ];
118
118
+
nativeBuildInputs = [
119
119
+
gn
120
120
+
ninja
121
121
+
pkg-config
122
122
+
python
123
123
+
] ++ lib.optionals stdenv.isDarwin [
124
124
+
xcbuild
125
125
+
darwin.DarwinTools
126
126
+
pythonPackages.setuptools
127
127
+
];
106
128
buildInputs = [ glib icu ];
107
129
108
130
ninjaFlags = [ ":d8" "v8_monolith" ];