stdenv: pURL review suggestions - replace merge
This commit is contained in:
committed by
d068328
parent
bacccc39a9
commit
028af7c17d
@@ -187,13 +187,16 @@ lib.makeOverridable (
|
||||
|
||||
inherit preferLocalBuild allowedRequisites;
|
||||
|
||||
meta = lib.recursiveUpdate {
|
||||
identifiers.purlParts = {
|
||||
type = "generic";
|
||||
# https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/types-doc/generic-definition.md
|
||||
spec = "${name}?vcs_url=${url}@${(lib.revOrTag rev tag)}";
|
||||
};
|
||||
} meta;
|
||||
meta = meta // {
|
||||
identifiers = {
|
||||
purlParts = {
|
||||
type = "generic";
|
||||
# https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/types-doc/generic-definition.md
|
||||
spec = "${name}?vcs_url=${url}@${(lib.revOrTag rev tag)}";
|
||||
};
|
||||
}
|
||||
// meta.identifiers or { };
|
||||
};
|
||||
|
||||
passthru = {
|
||||
gitRepoUrl = url;
|
||||
|
||||
@@ -42,28 +42,31 @@ lib.makeOverridable (
|
||||
builtins.unsafeGetAttrPos "rev" args
|
||||
);
|
||||
baseUrl = "https://${githubBase}/${owner}/${repo}";
|
||||
newMeta = lib.recursiveUpdate (
|
||||
{
|
||||
newMeta =
|
||||
meta
|
||||
// {
|
||||
homepage = meta.homepage or baseUrl;
|
||||
identifiers.purlParts =
|
||||
if githubBase == "github.com" then
|
||||
{
|
||||
type = "github";
|
||||
# https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/types-doc/github-definition.md
|
||||
spec = "${owner}/${repo}@${(lib.revOrTag rev tag)}";
|
||||
}
|
||||
else
|
||||
{
|
||||
type = "generic";
|
||||
# https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/types-doc/generic-definition.md
|
||||
spec = "${repo}?vcs_url=https://${githubBase}/${owner}/${repo}@${(lib.revOrTag rev tag)}";
|
||||
};
|
||||
identifiers = {
|
||||
purlParts =
|
||||
if githubBase == "github.com" then
|
||||
{
|
||||
type = "github";
|
||||
# https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/types-doc/github-definition.md
|
||||
spec = "${owner}/${repo}@${(lib.revOrTag rev tag)}";
|
||||
}
|
||||
else
|
||||
{
|
||||
type = "generic";
|
||||
# https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/types-doc/generic-definition.md
|
||||
spec = "${repo}?vcs_url=https://${githubBase}/${owner}/${repo}@${(lib.revOrTag rev tag)}";
|
||||
};
|
||||
}
|
||||
// meta.identifiers or { };
|
||||
}
|
||||
// lib.optionalAttrs (position != null) {
|
||||
# to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
|
||||
position = "${position.file}:${toString position.line}";
|
||||
}
|
||||
) meta;
|
||||
};
|
||||
|
||||
passthruAttrs = removeAttrs args [
|
||||
"owner"
|
||||
|
||||
Reference in New Issue
Block a user