2013-11-14 18:36:08 +00:00
|
|
|
{ pkgs, stdenv, nodejs, fetchurl, fetchgit, neededNatives, self, generated ? ./node-packages-generated.nix }:
|
2012-07-25 21:46:21 +00:00
|
|
|
|
2013-11-14 18:36:08 +00:00
|
|
|
rec {
|
2013-05-31 16:50:28 +00:00
|
|
|
nativeDeps = {
|
2013-11-05 23:02:16 +00:00
|
|
|
"node-expat" = [ pkgs.expat ];
|
|
|
|
"rbytes" = [ pkgs.openssl ];
|
|
|
|
"phantomjs" = [ pkgs.phantomjs ];
|
2013-05-31 16:50:28 +00:00
|
|
|
};
|
2013-05-29 15:22:18 +00:00
|
|
|
|
2013-05-31 16:50:28 +00:00
|
|
|
buildNodePackage = import ../development/web/nodejs/build-node-package.nix {
|
|
|
|
inherit stdenv nodejs neededNatives;
|
|
|
|
inherit (pkgs) runCommand;
|
|
|
|
};
|
2013-05-29 15:22:18 +00:00
|
|
|
|
2013-11-14 18:36:08 +00:00
|
|
|
patchSource = fn: srcAttrs:
|
|
|
|
let src = fn srcAttrs; in pkgs.runCommand src.name {} ''
|
2013-05-31 16:50:28 +00: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 16:50:28 +00: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 16:50:28 +00:00
|
|
|
'';
|
2013-05-28 02:29:00 +00:00
|
|
|
|
2013-11-14 18:36:08 +00:00
|
|
|
# Backwards compat
|
|
|
|
patchLatest = patchSource fetchurl;
|
|
|
|
|
2013-05-31 16:50:28 +00: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; }
|