2015-01-24 22:54:03 +01:00
|
|
|
{
|
|
|
|
stdenv, pkgs, nodejs
|
|
|
|
|
|
|
|
# Self-reference
|
|
|
|
, self
|
|
|
|
|
|
|
|
# Needed natives for installation
|
|
|
|
, neededNatives ? [pkgs.python] ++ stdenv.lib.optionals stdenv.isLinux [ pkgs.utillinux ]
|
|
|
|
|
|
|
|
# Attribute set of generated packages
|
|
|
|
, generated ? pkgs.callPackage ./node-packages-generated.nix { inherit self; }
|
|
|
|
|
|
|
|
# Attribute set of overrides
|
|
|
|
, overrides ? {}
|
|
|
|
, ...
|
|
|
|
} @ args:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2012-07-25 23:46:21 +02:00
|
|
|
|
2013-11-14 19:36:08 +01:00
|
|
|
rec {
|
2015-01-24 22:54:03 +01:00
|
|
|
overrides = {
|
|
|
|
phantomjs.buildInputs = [ pkgs.phantomjs ];
|
|
|
|
"node-expat".buildInputs = [ pkgs.expat ];
|
|
|
|
"node-stringprep".buildInputs = [ pkgs.icu pkgs.which ];
|
|
|
|
"node-protobuf".buildInputs = [ pkgs.protobuf ];
|
|
|
|
"rbytes".buildInputs = [ pkgs.openssl ];
|
2015-01-25 00:33:41 +01:00
|
|
|
|
|
|
|
bipio.patchPhase = ''
|
|
|
|
${self.json}/bin/json -I -f package.json -e 'this.scripts.install=""'
|
|
|
|
'';
|
2015-01-26 02:05:57 +01:00
|
|
|
bip-pod.patchPhase = ''
|
|
|
|
substituteInPlace index.js --replace \
|
|
|
|
"__dirname + (literal ? '/' : '/../bip-pod-') + podName" \
|
|
|
|
"(literal ? __dirname + '/' : \"bip-pod-\") + podName"
|
|
|
|
'';
|
2015-01-24 22:54:03 +01:00
|
|
|
} // args.overrides or {};
|
2013-05-29 17:22:18 +02:00
|
|
|
|
2015-01-24 22:54:03 +01:00
|
|
|
# Apply overrides and back compatiblity transformations
|
|
|
|
buildNodePackage = {...} @ args:
|
|
|
|
let
|
|
|
|
pkg = makeOverridable (
|
|
|
|
pkgs.callPackage ../development/web/nodejs/build-node-package.nix {
|
|
|
|
inherit nodejs neededNatives;
|
|
|
|
}
|
2015-01-25 01:41:39 +01:00
|
|
|
) (args // (optionalAttrs (isList args.src) {
|
2015-01-24 22:54:03 +01:00
|
|
|
# Backwards compatibility
|
2015-01-25 01:41:39 +01:00
|
|
|
src = head args.src;
|
|
|
|
}) // (optionalAttrs (attrByPath ["passthru" "names"] null args != null) {
|
|
|
|
pkgName = head args.passthru.names;
|
|
|
|
}));
|
2015-01-24 22:54:03 +01:00
|
|
|
|
|
|
|
override = overrides.${args.name} or overrides.${pkg.pkgName} or {};
|
2013-05-28 04:29:00 +02:00
|
|
|
|
2015-01-24 22:54:03 +01:00
|
|
|
in pkg.override override;
|
|
|
|
|
|
|
|
# Backwards compatibility
|
|
|
|
patchSource = fn: srcAttrs: fn srcAttrs;
|
|
|
|
patchLatest = patchSource pkgs.fetchurl;
|
2013-11-14 19:36:08 +01:00
|
|
|
|
2013-05-31 18:50:28 +02:00
|
|
|
/* Put manual packages below here (ideally eventually managed by npm2nix */
|
2015-01-24 22:54:03 +01:00
|
|
|
} // (
|
|
|
|
if isAttrs generated then generated
|
|
|
|
|
|
|
|
# Backwards compatiblity
|
|
|
|
else pkgs.callPackage generated { inherit self; }
|
|
|
|
)
|