3
0
Fork 0
forked from mirrors/nixpkgs

nodePackages: fix back compatibility

This commit is contained in:
Jaka Hudoklin 2015-01-25 01:41:39 +01:00
parent 5ff19db127
commit fffc0c793c
2 changed files with 8 additions and 7 deletions

View file

@ -3,6 +3,9 @@
{ {
name, src, name, src,
# Node package name
pkgName ? (builtins.parseDrvName name).name,
# List or attribute set of dependencies # List or attribute set of dependencies
deps ? {}, deps ? {},
@ -38,9 +41,6 @@ let
mv *node* $out mv *node* $out
''; '';
# Package name without version
pkgName = (builtins.parseDrvName name).name;
# Convert deps to attribute set # Convert deps to attribute set
attrDeps = if isAttrs deps then deps else attrDeps = if isAttrs deps then deps else
(listToAttrs (map (dep: nameValuePair dep.name dep) deps)); (listToAttrs (map (dep: nameValuePair dep.name dep) deps));

View file

@ -37,11 +37,12 @@ rec {
pkgs.callPackage ../development/web/nodejs/build-node-package.nix { pkgs.callPackage ../development/web/nodejs/build-node-package.nix {
inherit nodejs neededNatives; inherit nodejs neededNatives;
} }
) (args // { ) (args // (optionalAttrs (isList args.src) {
# Backwards compatibility # Backwards compatibility
src = if isList args.src then head args.src else args.src; src = head args.src;
pkgName = (builtins.parseDrvName args.name).name; }) // (optionalAttrs (attrByPath ["passthru" "names"] null args != null) {
}); pkgName = head args.passthru.names;
}));
override = overrides.${args.name} or overrides.${pkg.pkgName} or {}; override = overrides.${args.name} or overrides.${pkg.pkgName} or {};