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