Skip to content

Commit 06893fc

Browse files
committed
fixup! squash! pass same configure flags to sub derivation
1 parent b424a41 commit 06893fc

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

node.gyp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,21 @@
659659
],
660660
},
661661
}],
662-
['OS != "aix" and OS != "os400" and OS != "mac" and OS != "ios"', {
662+
['node_use_bundled_v8=="true" and OS != "aix" and OS != "os400" and OS != "mac" and OS != "ios"', {
663663
'ldflags': [
664664
'-Wl,--whole-archive',
665665
'<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
666666
'<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
667667
'-Wl,--no-whole-archive',
668668
],
669669
}],
670+
['node_use_bundled_v8!="true" and OS != "aix" and OS != "os400" and OS != "mac" and OS != "ios"', {
671+
'ldflags': [
672+
'-Wl,--whole-archive',
673+
'<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
674+
'-Wl,--no-whole-archive',
675+
],
676+
}],
670677
[ 'OS=="win"', {
671678
'sources': [ 'src/res/node.rc' ],
672679
}],

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pkgs.mkShell {
112112
]
113113
);
114114
CONFIG_FLAGS = builtins.toString (
115-
configureFlags ++ pkgs.lib.optional useSeparateDerivationForV8 "--without-bundled-v8"
115+
configureFlags ++ pkgs.lib.optional (useSeparateDerivationForV8 != false) "--without-bundled-v8"
116116
);
117117
NOSQLITE = pkgs.lib.optionalString (!withSQLite) "1";
118118
}

tools/nix/v8.nix

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,23 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
8888
ninja -v -C out/Release v8_snapshot v8_libplatform
8989
'';
9090
installPhase = ''
91-
install -Dm644 out/Release/${pkgs.lib.optionalString (pkgs.stdenv.buildPlatform.isLinux) "obj/tools/v8_gypfiles/"}lib* -t $out/lib
91+
${
92+
if pkgs.stdenv.buildPlatform.isDarwin then
93+
# On Darwin, there are no thin archive
94+
"install -Dm644 out/Release/lib* -t $out/lib"
95+
else
96+
''
97+
for a in out/Release/obj/tools/v8_gypfiles/lib*.a; do
98+
name=$(basename "$a")
99+
tmpdir=$(mktemp -d)
100+
pushd "$tmpdir"
101+
"$AR" x "$a"
102+
"$AR" rcs "$out/lib/$name" *.o
103+
popd
104+
rm -rf "$tmpdir"
105+
done
106+
''
107+
}
92108
libs=$(for f in $out/lib/lib*.a; do
93109
b=$(basename "$f" .a)
94110
printf " -l%s" "''${b#lib}"

0 commit comments

Comments
 (0)