2015-02-22 11:41:33 +00:00
|
|
|
{ stdenv, fetchurl, openssl, python, zlib, libuv, v8, utillinux, http-parser
|
2015-09-19 13:48:38 +00:00
|
|
|
, pkgconfig, runCommand, which, libtool
|
2014-11-09 15:18:45 +00:00
|
|
|
}:
|
2012-08-22 22:54:47 +00:00
|
|
|
|
2015-05-03 16:02:55 +00: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-28 22:38:16 +00:00
|
|
|
|
2013-05-23 21:46:07 +00:00
|
|
|
let
|
2016-03-01 12:29:31 +00:00
|
|
|
version = "4.3.1";
|
2013-05-23 21:46:07 +00:00
|
|
|
|
|
|
|
deps = {
|
2015-02-22 11:41:33 +00:00
|
|
|
inherit openssl zlib libuv;
|
2014-04-22 21:15:44 +00: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 15:18:45 +00:00
|
|
|
} // (stdenv.lib.optionalAttrs (!stdenv.isDarwin) {
|
2014-10-22 15:51:24 +00:00
|
|
|
inherit http-parser;
|
2015-02-18 06:44:58 +00:00
|
|
|
});
|
2013-05-23 21:46:07 +00:00
|
|
|
|
|
|
|
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";
|
2016-03-01 12:29:31 +00:00
|
|
|
sha256 = "0wzf5sirbph5kaik3pm9i2dxbjwqh5qlnqn71azrsv0vhs7dbqk1";
|
2011-05-05 22:38:04 +00:00
|
|
|
};
|
|
|
|
|
2015-06-21 07:56:26 +00:00
|
|
|
configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps) ++ [ "--without-dtrace" ];
|
2015-09-19 13:35:59 +00:00
|
|
|
dontDisableStatic = true;
|
2012-02-25 19:36:24 +00:00
|
|
|
prePatch = ''
|
2015-07-09 22:43:01 +00:00
|
|
|
patchShebangs .
|
2015-10-01 23:34:26 +00:00
|
|
|
sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' tools/gyp/pylib/gyp/xcode_emulation.py
|
2011-05-05 22:38:04 +00:00
|
|
|
'';
|
|
|
|
|
2016-01-30 01:51:21 +00:00
|
|
|
patches = stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
|
2013-05-28 22:38:16 +00:00
|
|
|
|
2015-10-03 12:45:56 +00:00
|
|
|
buildInputs = [ python zlib libuv openssl python ]
|
2015-10-03 14:28:06 +00:00
|
|
|
++ optionals stdenv.isLinux [ utillinux http-parser ];
|
2015-10-03 11:33:13 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig ]
|
|
|
|
++ optional stdenv.isDarwin libtool;
|
2015-10-03 14:28:06 +00:00
|
|
|
|
2016-01-08 05:51:58 +00: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
|
|
|
|
'';
|
2013-02-04 14:21:33 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
2011-05-05 22:38:04 +00:00
|
|
|
|
2015-06-21 07:56:26 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-02-23 12:24:18 +00:00
|
|
|
passthru.interpreterName = "nodejs";
|
|
|
|
|
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;
|
2015-11-19 21:32:43 +00:00
|
|
|
maintainers = [ maintainers.havvy ];
|
2013-12-17 10:13:55 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2011-05-05 22:38:04 +00:00
|
|
|
};
|
|
|
|
}
|