2015-02-22 11:41:33 +00:00
|
|
|
{ stdenv, fetchurl, openssl, python, zlib, libuv, v8, utillinux, http-parser
|
2015-09-19 14:48:38 +01:00
|
|
|
, pkgconfig, runCommand, which, libtool
|
2014-11-09 15:18:45 +00:00
|
|
|
}:
|
2012-08-22 23:54:47 +01:00
|
|
|
|
2015-05-03 17:02:55 +01: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 23:38:16 +01:00
|
|
|
|
2013-05-23 22:46:07 +01:00
|
|
|
let
|
2016-03-01 12:29:31 +00:00
|
|
|
version = "4.3.1";
|
2013-05-23 22:46:07 +01:00
|
|
|
|
|
|
|
deps = {
|
2015-02-22 11:41:33 +00:00
|
|
|
inherit openssl zlib libuv;
|
2014-04-22 22:15:44 +01: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 16:51:24 +01:00
|
|
|
inherit http-parser;
|
2015-02-18 06:44:58 +00:00
|
|
|
});
|
2013-05-23 22:46:07 +01:00
|
|
|
|
|
|
|
sharedConfigureFlags = name: [
|
|
|
|
"--shared-${name}"
|
|
|
|
"--shared-${name}-includes=${builtins.getAttr name deps}/include"
|
|
|
|
"--shared-${name}-libpath=${builtins.getAttr name deps}/lib"
|
|
|
|
];
|
|
|
|
|
2013-05-28 23:38:16 +01:00
|
|
|
inherit (stdenv.lib) concatMap optional optionals maintainers licenses platforms;
|
2013-05-23 22:46:07 +01:00
|
|
|
in stdenv.mkDerivation {
|
2011-05-05 23:38:04 +01:00
|
|
|
name = "nodejs-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2011-07-31 09:56:09 +01: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 23:38:04 +01:00
|
|
|
};
|
|
|
|
|
2015-06-21 08:56:26 +01:00
|
|
|
configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps) ++ [ "--without-dtrace" ];
|
2015-09-19 14:35:59 +01:00
|
|
|
dontDisableStatic = true;
|
2012-02-25 19:36:24 +00:00
|
|
|
prePatch = ''
|
2015-07-09 23:43:01 +01:00
|
|
|
patchShebangs .
|
2015-10-02 00:34:26 +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-05 23:38:04 +01:00
|
|
|
'';
|
|
|
|
|
2016-01-30 01:51:21 +00:00
|
|
|
patches = stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
|
2013-05-28 23:38:16 +01:00
|
|
|
|
2015-10-03 13:45:56 +01:00
|
|
|
buildInputs = [ python zlib libuv openssl python ]
|
2015-10-03 15:28:06 +01:00
|
|
|
++ optionals stdenv.isLinux [ utillinux http-parser ];
|
2015-10-03 12:33:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ]
|
|
|
|
++ optional stdenv.isDarwin libtool;
|
2015-10-03 15:28:06 +01: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 23:38:04 +01:00
|
|
|
|
2015-06-21 08:56:26 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-02-23 12:24:18 +00:00
|
|
|
passthru.interpreterName = "nodejs";
|
|
|
|
|
2013-05-23 22:46:07 +01:00
|
|
|
meta = {
|
2011-05-05 23:38:04 +01: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 23:38:04 +01:00
|
|
|
};
|
|
|
|
}
|