summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorGeorges Dubus <georges.dubus@compiletoi.net>2015-01-14 17:38:26 +0100
committerGeorges Dubus <georges.dubus@compiletoi.net>2015-01-14 17:38:47 +0100
commitc64b29497040db23bd9cce7d0b0c76a241853a0f (patch)
treee029b6238b01beee4df07ffa158f40475c0b6446 /pkgs
parent0ab270770bceb681836767d8b09216afb0423b30 (diff)
downloadnixlib-c64b29497040db23bd9cce7d0b0c76a241853a0f.tar
nixlib-c64b29497040db23bd9cce7d0b0c76a241853a0f.tar.gz
nixlib-c64b29497040db23bd9cce7d0b0c76a241853a0f.tar.bz2
nixlib-c64b29497040db23bd9cce7d0b0c76a241853a0f.tar.lz
nixlib-c64b29497040db23bd9cce7d0b0c76a241853a0f.tar.xz
nixlib-c64b29497040db23bd9cce7d0b0c76a241853a0f.tar.zst
nixlib-c64b29497040db23bd9cce7d0b0c76a241853a0f.zip
fetchFromGitHub: add option for custom name
This is necessary when the rev name contains a "/"
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/backup/bareos/default.nix9
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/tools/backup/bareos/default.nix b/pkgs/tools/backup/bareos/default.nix
index 24dfa795f1dd..87c04954f6bf 100644
--- a/pkgs/tools/backup/bareos/default.nix
+++ b/pkgs/tools/backup/bareos/default.nix
@@ -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";
   };
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 45a4abd383c7..14160f9b82e7 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -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;
   };