fetchFromGitHub: add option for custom name

This is necessary when the rev name contains a "/"
This commit is contained in:
Georges Dubus 2015-01-14 17:38:26 +01:00
parent 0ab270770b
commit c64b294970
2 changed files with 8 additions and 5 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchzip, pkgconfig, nettools, gettext, readline, openssl, python
{ stdenv, fetchFromGitHub, pkgconfig, nettools, gettext, readline, openssl, python
, ncurses ? null
, sqlite ? null, postgresql ? null, mysql ? null, libcap ? null
, zlib ? null, lzo ? null, acl ? null, ceph ? null
@ -11,8 +11,11 @@ stdenv.mkDerivation rec {
name = "bareos-${version}";
version = "14.2.2";
src = fetchzip {
url = "https://github.com/bareos/bareos/archive/Release/${version}.tar.gz";
src = fetchFromGitHub {
owner = "bareos";
repo = "bareos";
rev = "Release/${version}";
name = "${name}-src";
sha256 = "12605jibvj6kdp15s8jpzb9fw1mfm53npf8ib2jfn1r4hvhdrl4j";
};

View file

@ -358,8 +358,8 @@ let
fetchzip = import ../build-support/fetchzip { inherit lib fetchurl unzip; };
fetchFromGitHub = { owner, repo, rev, sha256 }: fetchzip {
name = "${repo}-${rev}-src";
fetchFromGitHub = { owner, repo, rev, sha256, name ? "${repo}-${rev}-src" }: fetchzip {
inherit name;
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
inherit sha256;
};