2013-11-14 19:36:08 +01:00
|
|
|
{ pkgs, stdenv, nodejs, fetchurl, fetchgit, neededNatives, self, generated ? ./node-packages-generated.nix }:
|
2012-07-25 23:46:21 +02:00
|
|
|
|
2013-11-14 19:36:08 +01:00
|
|
|
rec {
|
2013-05-31 18:50:28 +02:00
|
|
|
nativeDeps = {
|
2013-11-06 00:02:16 +01:00
|
|
|
"node-expat" = [ pkgs.expat ];
|
2014-10-30 19:58:18 +01:00
|
|
|
"node-stringprep" = [ pkgs.icu pkgs.which ];
|
2013-11-06 00:02:16 +01:00
|
|
|
"rbytes" = [ pkgs.openssl ];
|
|
|
|
"phantomjs" = [ pkgs.phantomjs ];
|
2013-12-11 00:53:45 +01:00
|
|
|
"node-protobuf" = [ pkgs.protobuf ];
|
2013-05-31 18:50:28 +02:00
|
|
|
};
|
2013-05-29 17:22:18 +02:00
|
|
|
|
2013-05-31 18:50:28 +02:00
|
|
|
buildNodePackage = import ../development/web/nodejs/build-node-package.nix {
|
|
|
|
inherit stdenv nodejs neededNatives;
|
|
|
|
inherit (pkgs) runCommand;
|
|
|
|
};
|
2013-05-29 17:22:18 +02:00
|
|
|
|
2013-11-14 19:36:08 +01:00
|
|
|
patchSource = fn: srcAttrs:
|
|
|
|
let src = fn srcAttrs; in pkgs.runCommand src.name {} ''
|
2013-05-31 18:50:28 +02:00
|
|
|
mkdir unpack
|
|
|
|
cd unpack
|
2013-11-14 19:36:08 +01:00
|
|
|
unpackFile ${src}
|
2013-11-14 20:11:53 +01:00
|
|
|
chmod -R +w */
|
2013-05-31 18:50:28 +02:00
|
|
|
mv */ package 2>/dev/null || true
|
2013-11-19 21:59:22 +01:00
|
|
|
sed -i -e "s/:\s*\"latest\"/: \"*\"/" -e "s/:\s*\"\(https\?\|git\(\+\(ssh\|http\|https\)\)\?\):\/\/[^\"]*\"/: \"*\"/" package/package.json
|
2013-11-14 20:11:53 +01:00
|
|
|
mv */ $out
|
2013-05-31 18:50:28 +02:00
|
|
|
'';
|
2013-05-28 04:29:00 +02:00
|
|
|
|
2013-11-14 19:36:08 +01:00
|
|
|
# Backwards compat
|
|
|
|
patchLatest = patchSource fetchurl;
|
|
|
|
|
2013-05-31 18:50:28 +02:00
|
|
|
/* Put manual packages below here (ideally eventually managed by npm2nix */
|
2013-11-14 19:36:08 +01:00
|
|
|
} // import generated { inherit self fetchurl fetchgit; inherit (pkgs) lib; }
|