2013-05-23 23:46:07 +02:00
|
|
|
{ stdenv, fetchurl, openssl, python, zlib, v8, utillinux, http_parser, c-ares }:
|
2012-08-23 00:54:47 +02:00
|
|
|
|
2013-05-23 23:46:07 +02:00
|
|
|
let
|
|
|
|
version = "0.10.8";
|
|
|
|
|
|
|
|
# !!! 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"
|
|
|
|
];
|
|
|
|
|
|
|
|
inherit (stdenv.lib) concatMap optional maintainers licenses platforms;
|
|
|
|
in stdenv.mkDerivation {
|
2011-05-06 00:38:04 +02:00
|
|
|
name = "nodejs-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2011-07-31 10:56:09 +02:00
|
|
|
url = "http://nodejs.org/dist/v${version}/node-v${version}.tar.gz";
|
2013-05-23 23:46:07 +02:00
|
|
|
sha256 = "0m43y7ipd6d89dl97nvrwkx1zss3fdb9835509dyziycr1kggxpd";
|
2011-05-06 00:38:04 +02:00
|
|
|
};
|
|
|
|
|
2013-05-23 23:46:07 +02:00
|
|
|
configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps);
|
2013-03-14 13:52:45 +01:00
|
|
|
|
2012-02-25 20:36:24 +01:00
|
|
|
prePatch = ''
|
2013-05-23 23:46:07 +02:00
|
|
|
sed -e 's|^#!/usr/bin/env python$|#!${python}/bin/python|g' -i configure
|
2011-05-06 00:38:04 +02:00
|
|
|
'';
|
|
|
|
|
2013-05-23 23:46:07 +02:00
|
|
|
buildInputs = [ python ]
|
|
|
|
++ optional stdenv.isLinux utillinux;
|
2013-02-04 15:21:33 +01:00
|
|
|
setupHook = ./setup-hook.sh;
|
2011-05-06 00:38:04 +02:00
|
|
|
|
2013-05-23 23:46:07 +02:00
|
|
|
meta = {
|
2011-05-06 00:38:04 +02:00
|
|
|
description = "Event-driven I/O framework for the V8 JavaScript engine";
|
|
|
|
homepage = http://nodejs.org;
|
|
|
|
license = licenses.mit;
|
2013-05-23 23:46:07 +02:00
|
|
|
maintainers = [ maintainers.goibhniu maintainers.shlevy ];
|
2011-05-06 00:38:04 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|