fetchFromGitiles: init

This has the same motivation as fetchFromGitHub/fetchFromGitLab --
it's cheaper to download a tarball of a single revision than it is to
download a whole history.

I could have gone with domain/group/repo, like fetchFromGitLab, but it
would have made implementation more difficult, and this syntax means
it's a drop-in replacement for fetchgit, so I decided it wasn't worth
it.
This commit is contained in:
Alyssa Ross 2019-11-24 19:58:19 +00:00
parent a8508f7266
commit fe16f7d7f9
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0
3 changed files with 23 additions and 0 deletions

View File

@ -105,6 +105,17 @@ stdenv.mkDerivation {
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<literal>fetchFromGitiles</literal>
</term>
<listitem>
<para>
This is used with Gitiles repositories. The arguments expected
are similar to fetchgit.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<literal>fetchFromBitbucket</literal> <literal>fetchFromBitbucket</literal>

View File

@ -0,0 +1,10 @@
{ fetchzip, lib }:
{ url, rev, name ? "source", ... } @ args:
fetchzip ({
inherit name;
url = "${url}/+archive/${rev}.tar.gz";
stripRoot = false;
meta.homepage = url;
} // removeAttrs args [ "url" "rev" ]) // { inherit rev; }

View File

@ -358,6 +358,8 @@ in
fetchFromGitLab = callPackage ../build-support/fetchgitlab {}; fetchFromGitLab = callPackage ../build-support/fetchgitlab {};
fetchFromGitiles = callPackage ../build-support/fetchgitiles {};
fetchFromRepoOrCz = callPackage ../build-support/fetchrepoorcz {}; fetchFromRepoOrCz = callPackage ../build-support/fetchrepoorcz {};
fetchNuGet = callPackage ../build-support/fetchnuget { }; fetchNuGet = callPackage ../build-support/fetchnuget { };