2015-02-22 12:41:33 +01:00
|
|
|
{ stdenv, fetchurl, openssl, python, zlib, libuv, v8, utillinux, http-parser
|
2015-09-19 15:48:38 +02:00
|
|
|
, pkgconfig, runCommand, which, libtool
|
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
|
2016-02-27 17:04:01 +01:00
|
|
|
version = "4.3.0";
|
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";
|
2016-02-27 17:04:01 +01:00
|
|
|
sha256 = "1f86jy71mi01g4xd411l5w8pi80nlk6sz7d2c0ghdk83v734ll0q";
|
2011-05-06 00:38:04 +02:00
|
|
|
};
|
|
|
|
|
2015-06-21 09:56:26 +02:00
|
|
|
configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps) ++ [ "--without-dtrace" ];
|
2015-09-19 15:35:59 +02:00
|
|
|
dontDisableStatic = true;
|
2012-02-25 20:36:24 +01:00
|
|
|
prePatch = ''
|
2015-07-10 00:43:01 +02:00
|
|
|
patchShebangs .
|
2015-11-14 21:32:51 +01:00
|
|
|
sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' tools/gyp/pylib/gyp/xcode_emulation.py
|
2011-05-06 00:38:04 +02:00
|
|
|
'';
|
|
|
|
|
2016-01-30 02:51:21 +01:00
|
|
|
patches = stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
|
2015-06-21 09:56:26 +02:00
|
|
|
|
2016-01-08 06:51:58 +01:00
|
|
|
postFixup = ''
|
|
|
|
sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' $out/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
|
|
|
|
'';
|
|
|
|
|
2015-11-14 21:32:51 +01:00
|
|
|
buildInputs = [ python which zlib libuv openssl python ]
|
|
|
|
++ optionals stdenv.isLinux [ utillinux http-parser ]
|
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-11-19 22:32:43 +01:00
|
|
|
maintainers = [ maintainers.havvy ];
|
2013-12-17 11:13:55 +01:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2011-05-06 00:38:04 +02:00
|
|
|
};
|
|
|
|
}
|