···
{ lib, stdenv, fetchurl, openssl, python, zlib, libuv, http-parser, icu, bash
2
-
, pkg-config, which, buildPackages
2
+
, ninja, pkgconf, unixtools, runCommand, buildPackages
, writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts, nix, runtimeShell
···
(name: "${lib.getDev sharedLibDeps.${name}}/include/*")
(builtins.attrNames sharedLibDeps);
107
+
# Currently stdenv sets CC/LD/AR/etc environment variables to program names
108
+
# instead of absolute paths. If we add cctools to nativeBuildInputs, that
109
+
# would shadow stdenv’s bintools and potentially break other parts of the
110
+
# build. The correct behavior is to use absolute paths, and there is a PR for
111
+
# that, see https://github.com/NixOS/nixpkgs/pull/314920. As a temporary
112
+
# workaround, we use only a single program we need (and that is not part of
114
+
darwin-cctools-only-libtool =
115
+
# Would be nice to have onlyExe builder similar to onlyBin…
116
+
runCommand "darwin-cctools-only-libtool" { cctools = lib.getBin buildPackages.cctools; } ''
117
+
mkdir -p "$out/bin"
118
+
ln -s "$cctools/bin/libtool" "$out/bin/libtool"
package = stdenv.mkDerivation (finalAttrs:
/** the final package fixed point, after potential overrides */
···
# NB: technically, we do not need bash in build inputs since all scripts are
# wrappers over the corresponding JS scripts. There are some packages though
# that use bash wrappers, e.g. polaris-web.
131
-
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ]
145
+
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices ApplicationServices ]
++ [ zlib libuv openssl http-parser icu bash ];
134
-
nativeBuildInputs = [ installShellFiles pkg-config python which ]
135
-
++ lib.optionals stdenv.isDarwin [ xcbuild ];
148
+
nativeBuildInputs =
155
+
++ lib.optionals stdenv.buildPlatform.isDarwin [
156
+
# gyp checks `sysctl -n hw.memsize` if `sys.platform == "darwin"`.
159
+
++ lib.optionals stdenv.hostPlatform.isDarwin [
160
+
# For gyp-mac-tool if `flavor == "mac"`.
161
+
darwin-cctools-only-libtool
164
+
# We currently rely on Makefile and stdenv for build phases, so do not let
165
+
# ninja’s setup hook to override default stdenv phases.
166
+
dontUseNinjaBuild = true;
167
+
dontUseNinjaCheck = true;
168
+
dontUseNinjaInstall = true;
outputs = [ "out" "libv8" ];
···
177
+
"--with-intl=system-icu"
178
+
"--openssl-use-def-ca-store"
···
FIXME: the statement above is outdated, we have to include pkg-config
in build inputs for system-icu.
170
-
]) (builtins.attrNames sharedLibDeps)
172
-
"--with-intl=system-icu"
173
-
"--openssl-use-def-ca-store"
206
+
]) (builtins.attrNames sharedLibDeps);
configurePlatforms = [ ];
···
enableParallelBuilding = true;
219
+
# Tell ninja to avoid ANSI sequences, otherwise we don’t see build
220
+
# progress in Nix logs.
# Don't allow enabling content addressed conversion as `nodejs`
# checksums it's image before conversion happens and image loading
···
# assemble a static v8 library and put it in the 'libv8' output
302
-
pushd out/Release/obj.target
340
+
pushd out/Release/obj
find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" | sort -u >files
$AR -cqs $libv8/lib/libv8.a @files