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

View File

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