Add fetchurl_gnome wrapper

It just creates correct mirror://gnome/sources/... URL.

svn path=/nixpkgs/trunk/; revision=29377
This commit is contained in:
Yury G. Kudryashov 2011-09-20 06:21:46 +00:00
parent c67fde4a47
commit c130be537b
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,17 @@
{ fetchurl }:
{ project, major, minor, patchlevel, extension ? "bz2", sha256 }:
let
baseVersion = "${major}.${minor}";
version = baseVersion + (if patchlevel != null then ".${patchlevel}" else "");
name = "${project}-${version}";
in
(fetchurl {
url = "mirror://gnome/sources/${project}/${baseVersion}/${name}.tar.${extension}";
inherit sha256;
}) // {
inherit major minor patchlevel baseVersion version;
pkgname = name;
}

View File

@ -289,6 +289,9 @@ let
inherit curl stdenv;
};
# A wrapper around fetchurl that generates miror://gnome URLs automatically
fetchurl_gnome = callPackage ../build-support/fetchurl/gnome.nix { };
# fetchurlBoot is used for curl and its dependencies in order to
# prevent a cyclic dependency (curl depends on curl.tar.bz2,
# curl.tar.bz2 depends on fetchurl, fetchurl depends on curl). It