Handle non-github git recipes

Used by ob-clojure-literate.

Noticed through upcoming test coverage improvement.
This commit is contained in:
Marien Zwart 2024-05-26 13:38:46 +10:00
parent aa0eb06567
commit a0bdac47f7
No known key found for this signature in database

View file

@ -229,10 +229,16 @@ let
url =
if (p.recipe.host or "") == "github" && p ? recipe.repo
then "https://github.com/${p.recipe.repo}"
else if (p.recipe.type or "") == "git"
&& p ? recipe.repo
&& (p.recipe.host or null) == null
then p.recipe.repo
else epkg.src.gitRepoUrl
or extraUrls.${name}
or (if isElpa then "https://github.com/emacs-straight/${name}"
else (throw "${name}: cannot derive url from recipe ${p.recipe or "<missing>"}"));
else (let
recipe = lib.generators.toPretty {} (p.recipe or "missing");
in throw "${name}: cannot derive url from recipe ${recipe}"));
# Use builtins.fetchGit instead of nixpkgs's fetchFromGitHub because
# fetchGit allows fetching a specific git commit without a hash.
fetchGitArgs = {