2015-02-22 12:41:33 +01:00
|
|
|
{ stdenv, fetchurl, openssl, python, zlib, libuv, v8, utillinux, http-parser
|
2015-06-21 09:56:26 +02:00
|
|
|
, pkgconfig, runCommand, which, libtool, unstableVersion ? false
|
2014-11-09 16:18:45 +01:00
|
|
|
}:
|
2012-08-23 00:54:47 +02:00
|
|
|
|
2015-05-03 18:02:55 +02:00
|
|
|
# nodejs 0.12 can't be built on armv5tel. Armv6 with FPU, minimum I think.
|
|
|
|
# Related post: http://zo0ok.com/techfindings/archives/1820
|
|
|
|
assert stdenv.system != "armv5tel-linux";
|
|
|
|
|
2013-05-23 23:46:07 +02:00
|
|
|
let
|
2015-07-12 21:37:40 +02:00
|
|
|
version = "0.12.7";
|
2013-05-23 23:46:07 +02:00
|
|
|
|
|
|
|
deps = {
|
2015-02-22 12:41:33 +01:00
|
|
|
inherit openssl zlib libuv;
|
2014-04-22 23:15:44 +02:00
|
|
|
|
|
|
|
# disabled system v8 because v8 3.14 no longer receives security fixes
|
|
|
|
# we fall back to nodejs' internal v8 copy which receives backports for now
|
|
|
|
# inherit v8
|
2014-11-09 16:18:45 +01:00
|
|
|
} // (stdenv.lib.optionalAttrs (!stdenv.isDarwin) {
|
2014-10-22 17:51:24 +02:00
|
|
|
inherit http-parser;
|
2015-02-18 07:44:58 +01:00
|
|
|
});
|
2013-05-23 23:46:07 +02:00
|
|
|
|
|
|
|
sharedConfigureFlags = name: [
|
|
|
|
"--shared-${name}"
|
|
|
|
"--shared-${name}-includes=${builtins.getAttr name deps}/include"
|
|
|
|
"--shared-${name}-libpath=${builtins.getAttr name deps}/lib"
|
|
|
|
];
|
|
|
|
|
2013-05-29 00:38:16 +02:00
|
|
|
inherit (stdenv.lib) concatMap optional optionals maintainers licenses platforms;
|
2013-05-23 23:46:07 +02:00
|
|
|
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";
|
2015-07-12 21:37:40 +02:00
|
|
|
sha256 = "17gk29zbw58l0sjjfw86acp39pkiblnq0gsq1jdrd70w0pgn8gdj";
|
2011-05-06 00:38:04 +02:00
|
|
|
};
|
|
|
|
|
2015-06-21 09:56:26 +02:00
|
|
|
configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps) ++ [ "--without-dtrace" ];
|
2013-03-14 13:52:45 +01:00
|
|
|
|
2012-02-25 20:36:24 +01:00
|
|
|
prePatch = ''
|
2015-07-10 00:43:01 +02:00
|
|
|
patchShebangs .
|
2011-05-06 00:38:04 +02:00
|
|
|
'';
|
|
|
|
|
2015-07-10 00:43:01 +02:00
|
|
|
patches = stdenv.lib.optional stdenv.isDarwin ./no-xcode.patch;
|
2015-06-21 09:56:26 +02:00
|
|
|
|
2014-04-29 11:37:51 +02:00
|
|
|
buildInputs = [ python which ]
|
2013-05-29 00:38:16 +02:00
|
|
|
++ (optional stdenv.isLinux utillinux)
|
2015-06-21 09:56:26 +02:00
|
|
|
++ optionals stdenv.isDarwin [ pkgconfig openssl libtool ];
|
2013-02-04 15:21:33 +01:00
|
|
|
setupHook = ./setup-hook.sh;
|
2011-05-06 00:38:04 +02:00
|
|
|
|
2015-06-21 09:56:26 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-02-23 13:24:18 +01:00
|
|
|
passthru.interpreterName = "nodejs";
|
|
|
|
|
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;
|
2015-07-01 14:11:05 +02:00
|
|
|
maintainers = [ maintainers.goibhniu maintainers.havvy ];
|
2013-12-17 11:13:55 +01:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2011-05-06 00:38:04 +02:00
|
|
|
};
|
|
|
|
}
|