forked from mirrors/nixpkgs
fetchFromGitHub: Always add meta.homepage to the derivation
The attribute meta.homepage was only added if "fetchFromGitHub = false" which might be unexpected. Now, it will be set unconditionally.
This commit is contained in:
parent
f27feb5481
commit
49d64a9d53
|
@ -198,7 +198,7 @@ with pkgs;
|
||||||
baseUrl = "https://${githubBase}/${owner}/${repo}";
|
baseUrl = "https://${githubBase}/${owner}/${repo}";
|
||||||
passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "private" "githubBase" "varPrefix" ];
|
passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "private" "githubBase" "varPrefix" ];
|
||||||
varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
|
varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
|
||||||
in if fetchSubmodules then
|
in (if fetchSubmodules then
|
||||||
fetchgit ({
|
fetchgit ({
|
||||||
inherit name rev fetchSubmodules;
|
inherit name rev fetchSubmodules;
|
||||||
url = "${baseUrl}.git";
|
url = "${baseUrl}.git";
|
||||||
|
@ -209,7 +209,6 @@ with pkgs;
|
||||||
fetchzip ({
|
fetchzip ({
|
||||||
inherit name;
|
inherit name;
|
||||||
url = "${baseUrl}/archive/${rev}.tar.gz";
|
url = "${baseUrl}/archive/${rev}.tar.gz";
|
||||||
meta.homepage = "${baseUrl}/";
|
|
||||||
} // lib.optionalAttrs private {
|
} // lib.optionalAttrs private {
|
||||||
netrcPhase = ''
|
netrcPhase = ''
|
||||||
if [ -z "''$${varBase}USERNAME" -o -z "''$${varBase}PASSWORD" ]; then
|
if [ -z "''$${varBase}USERNAME" -o -z "''$${varBase}PASSWORD" ]; then
|
||||||
|
@ -223,7 +222,8 @@ with pkgs;
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ];
|
netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ];
|
||||||
} // passthruAttrs) // { inherit rev; };
|
} // passthruAttrs) // { inherit rev; })
|
||||||
|
// { meta.homepage = baseUrl; };
|
||||||
|
|
||||||
fetchFromBitbucket = {
|
fetchFromBitbucket = {
|
||||||
owner, repo, rev, name ? gitRepoToName repo rev,
|
owner, repo, rev, name ? gitRepoToName repo rev,
|
||||||
|
|
Loading…
Reference in a new issue