mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 15:11:35 +00:00
nodePackages: Update to npm2nix 2.0 format
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
483755e9ab
commit
a895082e56
File diff suppressed because it is too large
Load diff
|
@ -7,23 +7,29 @@ let
|
|||
let
|
||||
all = pkgs.lib.fold (pkg: { top-level, full }: {
|
||||
top-level = top-level ++ pkgs.lib.optional pkg.topLevel {
|
||||
name = pkg.baseName;
|
||||
value = builtins.getAttr pkg.fullName self.full;
|
||||
name = pkg.name;
|
||||
value = builtins.getAttr pkg.spec (builtins.getAttr pkg.name self.full);
|
||||
};
|
||||
full = [ {
|
||||
name = pkg.fullName;
|
||||
value = pkgs.lib.makeOverridable buildNodePackage rec {
|
||||
name = "${pkg.baseName}-${pkg.version}";
|
||||
src = (if pkg.patchLatest then patchLatest else fetchurl) {
|
||||
url = "http://registry.npmjs.org/${pkg.baseName}/-/${name}.tgz";
|
||||
sha256 = pkg.hash;
|
||||
full = full // builtins.listToAttrs [ {
|
||||
inherit (pkg) name;
|
||||
value = (if builtins.hasAttr pkg.name full
|
||||
then builtins.getAttr pkg.name full
|
||||
else {}
|
||||
) // builtins.listToAttrs [ {
|
||||
name = pkg.spec;
|
||||
value = pkgs.lib.makeOverridable buildNodePackage {
|
||||
name = "${pkg.name}-${pkg.version}";
|
||||
src = (if pkg.patchLatest then patchLatest else fetchurl) {
|
||||
url = pkg.tarball;
|
||||
sha1 = pkg.sha1 or "";
|
||||
sha256 = pkg.sha256 or "";
|
||||
};
|
||||
deps = map (dep: builtins.getAttr dep.spec (builtins.getAttr dep.name self.full)) pkg.dependencies;
|
||||
};
|
||||
deps = map (dep: builtins.getAttr "${dep.name}-${dep.range}" self.full) pkg.dependencies;
|
||||
buildInputs = if builtins.hasAttr name nativeDeps then builtins.getAttr name nativeDeps else [];
|
||||
};
|
||||
} ] ++ full;
|
||||
} ) { top-level = []; full = []; } generated;
|
||||
in builtins.listToAttrs all.top-level // { full = builtins.listToAttrs all.full; };
|
||||
} ];
|
||||
} ];
|
||||
} ) { top-level = []; full = {}; } generated;
|
||||
in builtins.listToAttrs all.top-level // { inherit (all) full; };
|
||||
in {
|
||||
inherit importGeneratedPackages;
|
||||
|
||||
|
|
Loading…
Reference in a new issue