mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +00:00
The Savannah administrators do not want package maintainers to use cgit snapshots due to putting strain on the servers and have disabled cgit snapshots for most if not all of their repositories. See: https://lists.gnu.org/archive/html/savannah-hackers/2025-12/msg00014.html Co-authored-by: Philip Taron <philip.taron@gmail.com> Co-authored-by: LIN, Jian <me@linj.tech>
39 lines
961 B
Nix
39 lines
961 B
Nix
{
|
|
lib,
|
|
repoRevToNameMaybe,
|
|
fetchzip,
|
|
}:
|
|
|
|
lib.makeOverridable (
|
|
# cgit example, snapshot support is optional in cgit
|
|
{
|
|
repo,
|
|
rev,
|
|
name ? repoRevToNameMaybe repo rev "savannah",
|
|
... # For hash agility
|
|
}@args:
|
|
let
|
|
result =
|
|
fetchzip (
|
|
{
|
|
inherit name;
|
|
url =
|
|
let
|
|
repo' = lib.last (lib.strings.splitString "/" repo); # support repo like emacs/elpa
|
|
in
|
|
"https://cgit.git.savannah.gnu.org/cgit/${repo}.git/snapshot/${repo'}-${rev}.tar.gz";
|
|
meta.homepage = "https://cgit.git.savannah.gnu.org/cgit/${repo}.git/";
|
|
passthru.gitRepoUrl = "https://cgit.git.savannah.gnu.org/git/${repo}.git";
|
|
}
|
|
// removeAttrs args [
|
|
"repo"
|
|
"rev"
|
|
]
|
|
)
|
|
// {
|
|
inherit rev;
|
|
};
|
|
in
|
|
lib.warnOnInstantiate "`fetchFromSavannah` is deprecated and will be removed in a future release." result
|
|
)
|