build-support/fetchgithub: fix metadata eval for arguments without locations
Without the change metadata evaluation fails on package like `zammad.src` where no fields are defined in `.nix `files: src = fetchFromGitHub (lib.importJSON ./source.json); There evaluation fails as: $ nix-instantiate --strict --eval --expr 'with import ./. {}; zammad.src.meta' error: 23| # to indicate where derivation originates, similar to make-derivation.nix's mkDerivation 24| position = "${position.file}:${toString position.line}"; | ^ 25| }; error: value is null while a set was expected After the change evaluation succeeds as: $ nix-instantiate --strict --eval --expr 'with import ./. {}; zammad.src.meta' { homepage = "https://github.com/zammad/zammad"; }
This commit is contained in:
parent
55b9aa64c3
commit
6104083817
1 changed files with 1 additions and 1 deletions
|
@ -19,7 +19,7 @@ let
|
||||||
baseUrl = "https://${githubBase}/${owner}/${repo}";
|
baseUrl = "https://${githubBase}/${owner}/${repo}";
|
||||||
newMeta = meta // {
|
newMeta = meta // {
|
||||||
homepage = meta.homepage or baseUrl;
|
homepage = meta.homepage or baseUrl;
|
||||||
|
} // lib.optionalAttrs (position != null) {
|
||||||
# to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
|
# to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
|
||||||
position = "${position.file}:${toString position.line}";
|
position = "${position.file}:${toString position.line}";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue