From 2cedd7021bf0ba25964363470a09933a4244515a Mon Sep 17 00:00:00 2001 From: Mathijs Kwik Date: Thu, 5 Jul 2012 08:14:24 +0200 Subject: [PATCH] node.js: copy v8 headers most npm's that want to build binary stuff (bindings) look for the v8 headers at NODE_BINARY_PATH/../include Ideally, we get something like npm2nix someday and fix these build scripts. Until then, this little hack does the trick. --- pkgs/development/web/nodejs/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/web/nodejs/default.nix b/pkgs/development/web/nodejs/default.nix index 98e4736b4f1..ef45825a584 100644 --- a/pkgs/development/web/nodejs/default.nix +++ b/pkgs/development/web/nodejs/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, openssl, python, zlib, v8 }: +{ stdenv, fetchurl, openssl, python, zlib, v8, linkV8Headers ? false }: stdenv.mkDerivation rec { version = "0.6.19"; @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { postInstall = '' sed -e 's|^#!/usr/bin/env node$|#!'$out'/bin/node|' -i $out/lib/node_modules/npm/bin/npm-cli.js + '' + stdenv.lib.optionalString linkV8Headers '' # helps binary npms + ln -s ${v8}/include/* $out/include '' + stdenv.lib.optionalString stdenv.isDarwin '' install_name_tool -change libv8.dylib ${v8}/lib/libv8.dylib $out/bin/node '';