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