2013-05-28 22:38:16 +00:00
|
|
|
{ stdenv, fetchurl, openssl, python, zlib, v8, utillinux, http_parser, c-ares, pkgconfig, runCommand }:
|
2012-08-22 22:54:47 +00:00
|
|
|
|
2013-05-23 21:46:07 +00:00
|
|
|
let
|
2013-05-28 22:38:16 +00:00
|
|
|
dtrace = runCommand "dtrace-native" {} ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -sv /usr/sbin/dtrace $out/bin
|
|
|
|
'';
|
|
|
|
|
2013-11-25 05:08:09 +00:00
|
|
|
version = "0.10.22";
|
2013-05-23 21:46:07 +00:00
|
|
|
|
|
|
|
# !!! Should we also do shared libuv?
|
|
|
|
deps = {
|
|
|
|
inherit v8 openssl zlib;
|
|
|
|
cares = c-ares;
|
|
|
|
http-parser = http_parser;
|
|
|
|
};
|
|
|
|
|
|
|
|
sharedConfigureFlags = name: [
|
|
|
|
"--shared-${name}"
|
|
|
|
"--shared-${name}-includes=${builtins.getAttr name deps}/include"
|
|
|
|
"--shared-${name}-libpath=${builtins.getAttr name deps}/lib"
|
|
|
|
];
|
|
|
|
|
2013-05-28 22:38:16 +00:00
|
|
|
inherit (stdenv.lib) concatMap optional optionals maintainers licenses platforms;
|
2013-05-23 21:46:07 +00:00
|
|
|
in stdenv.mkDerivation {
|
2011-05-05 22:38:04 +00:00
|
|
|
name = "nodejs-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2011-07-31 08:56:09 +00:00
|
|
|
url = "http://nodejs.org/dist/v${version}/node-v${version}.tar.gz";
|
2013-11-25 05:08:09 +00:00
|
|
|
sha1 = "d7c6a39dfa714eae1f8da7a00c9a07efd74a03b3";
|
2011-05-05 22:38:04 +00:00
|
|
|
};
|
|
|
|
|
2013-05-23 21:46:07 +00:00
|
|
|
configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps);
|
2013-03-14 12:52:45 +00:00
|
|
|
|
2012-02-25 19:36:24 +00:00
|
|
|
prePatch = ''
|
2013-05-23 21:46:07 +00:00
|
|
|
sed -e 's|^#!/usr/bin/env python$|#!${python}/bin/python|g' -i configure
|
2011-05-05 22:38:04 +00:00
|
|
|
'';
|
|
|
|
|
2013-05-28 22:38:16 +00:00
|
|
|
patches = if stdenv.isDarwin then [ ./no-xcode.patch ] else null;
|
|
|
|
|
|
|
|
postPatch = if stdenv.isDarwin then ''
|
|
|
|
(cd tools/gyp; patch -Np1 -i ${../../python-modules/gyp/no-darwin-cflags.patch})
|
|
|
|
'' else null;
|
|
|
|
|
2013-05-23 21:46:07 +00:00
|
|
|
buildInputs = [ python ]
|
2013-05-28 22:38:16 +00:00
|
|
|
++ (optional stdenv.isLinux utillinux)
|
|
|
|
++ optionals stdenv.isDarwin [ pkgconfig openssl dtrace ];
|
2013-02-04 14:21:33 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
2011-05-05 22:38:04 +00:00
|
|
|
|
2013-05-23 21:46:07 +00:00
|
|
|
meta = {
|
2011-05-05 22:38:04 +00:00
|
|
|
description = "Event-driven I/O framework for the V8 JavaScript engine";
|
|
|
|
homepage = http://nodejs.org;
|
|
|
|
license = licenses.mit;
|
2013-05-23 21:46:07 +00:00
|
|
|
maintainers = [ maintainers.goibhniu maintainers.shlevy ];
|
2011-05-05 22:38:04 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|