mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 07:46:09 +01:00
03858122be
Signed-off-by: Shea Levy <shea@shealevy.com>
30 lines
990 B
Nix
30 lines
990 B
Nix
{ pkgs, stdenv, nodejs, fetchurl, fetchgit, neededNatives, self, generated ? ./node-packages-generated.nix }:
|
|
|
|
rec {
|
|
nativeDeps = {
|
|
"node-expat" = [ pkgs.expat ];
|
|
"rbytes" = [ pkgs.openssl ];
|
|
"phantomjs" = [ pkgs.phantomjs ];
|
|
};
|
|
|
|
buildNodePackage = import ../development/web/nodejs/build-node-package.nix {
|
|
inherit stdenv nodejs neededNatives;
|
|
inherit (pkgs) runCommand;
|
|
};
|
|
|
|
patchSource = fn: srcAttrs:
|
|
let src = fn srcAttrs; in pkgs.runCommand src.name {} ''
|
|
mkdir unpack
|
|
cd unpack
|
|
unpackFile ${src}
|
|
chmod -R +w */
|
|
mv */ package 2>/dev/null || true
|
|
sed -i -e "s/:\s*\"latest\"/: \"*\"/" -e "s/:\s*\"git\(\+\(ssh\|http\|https\)\)\?\:\/\/[^\"]*\"/: \"*\"/" package/package.json
|
|
mv */ $out
|
|
'';
|
|
|
|
# Backwards compat
|
|
patchLatest = patchSource fetchurl;
|
|
|
|
/* Put manual packages below here (ideally eventually managed by npm2nix */
|
|
} // import generated { inherit self fetchurl fetchgit; inherit (pkgs) lib; }
|