diff --git a/doc/builders/fetchers.xml b/doc/builders/fetchers.xml
index ff3988334916..f07c310dcdf1 100644
--- a/doc/builders/fetchers.xml
+++ b/doc/builders/fetchers.xml
@@ -105,6 +105,17 @@ stdenv.mkDerivation {
+
+
+ fetchFromGitiles
+
+
+
+ This is used with Gitiles repositories. The arguments expected
+ are similar to fetchgit.
+
+
+
fetchFromBitbucket
diff --git a/pkgs/applications/misc/redis-desktop-manager/default.nix b/pkgs/applications/misc/redis-desktop-manager/default.nix
index 25f9c6ed4c7a..71d79b88f440 100644
--- a/pkgs/applications/misc/redis-desktop-manager/default.nix
+++ b/pkgs/applications/misc/redis-desktop-manager/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, lib, fetchgit, pkgconfig, libssh2
+{ stdenv, lib, fetchFromGitHub, fetchFromGitiles, pkgconfig, libssh2
, qtbase, qtdeclarative, qtgraphicaleffects, qtimageformats, qtquickcontrols
, qtsvg, qttools, qtquick1, qtcharts
, qmake
}:
let
- breakpad_lss = fetchgit {
+ breakpad_lss = fetchFromGitiles {
url = "https://chromium.googlesource.com/linux-syscall-support";
rev = "08056836f2b4a5747daff75435d10d649bed22f6";
sha256 = "1ryshs2nyxwa0kn3rlbnd5b3fhna9vqm560yviddcfgdm2jyg0hz";
@@ -17,10 +17,11 @@ stdenv.mkDerivation rec {
pname = "redis-desktop-manager";
version = "0.9.1";
- src = fetchgit {
- url = "https://github.com/uglide/RedisDesktopManager.git";
+ src = fetchFromGitHub {
+ owner = "uglide";
+ repo = "RedisDesktopManager";
fetchSubmodules = true;
- rev = "refs/tags/${version}";
+ rev = version;
sha256 = "0yd4i944d4blw8jky0nxl7sfkkj975q4d328rdcbhizwvf6dx81f";
};
diff --git a/pkgs/build-support/fetchgitiles/default.nix b/pkgs/build-support/fetchgitiles/default.nix
new file mode 100644
index 000000000000..827680992d69
--- /dev/null
+++ b/pkgs/build-support/fetchgitiles/default.nix
@@ -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; }
diff --git a/pkgs/development/python-modules/gyp/default.nix b/pkgs/development/python-modules/gyp/default.nix
index 3cd89a7d0e1e..db828eb222dd 100644
--- a/pkgs/development/python-modules/gyp/default.nix
+++ b/pkgs/development/python-modules/gyp/default.nix
@@ -1,6 +1,6 @@
{ stdenv
, buildPythonPackage
-, fetchgit
+, fetchFromGitiles
, isPy3k
}:
@@ -9,8 +9,8 @@ buildPythonPackage {
version = "2015-06-11";
disabled = isPy3k;
- src = fetchgit {
- url = "https://chromium.googlesource.com/external/gyp.git";
+ src = fetchFromGitiles {
+ url = "https://chromium.googlesource.com/external/gyp";
rev = "fdc7b812f99e48c00e9a487bd56751bbeae07043";
sha256 = "1imgxsl4mr1662vsj2mlnpvvrbz71yk00w8p85vi5bkgmc6awgiz";
};
diff --git a/pkgs/os-specific/linux/chromium-xorg-conf/default.nix b/pkgs/os-specific/linux/chromium-xorg-conf/default.nix
index 58038923890b..d9608650ed9d 100644
--- a/pkgs/os-specific/linux/chromium-xorg-conf/default.nix
+++ b/pkgs/os-specific/linux/chromium-xorg-conf/default.nix
@@ -1,6 +1,6 @@
-{fetchgit }:
+{ fetchFromGitiles }:
-fetchgit {
+fetchFromGitiles {
name = "chromium-xorg-conf";
url = "https://chromium.googlesource.com/chromiumos/platform/xorg-conf";
rev = "26fb9d57e195c7e467616b35b17e2b5d279c1514";
diff --git a/pkgs/tools/security/chaps/default.nix b/pkgs/tools/security/chaps/default.nix
index e81567c3ed87..c8ee95069682 100644
--- a/pkgs/tools/security/chaps/default.nix
+++ b/pkgs/tools/security/chaps/default.nix
@@ -1,9 +1,10 @@
-{ stdenv, fetchgit, fetchurl, trousers, leveldb, unzip, scons, pkgconfig
-, glib, dbus_cplusplus, dbus, protobuf, openssl, snappy, pam }:
+{ stdenv, fetchFromGitiles, fetchFromGitHub, fetchurl, trousers, leveldb, unzip
+, scons, pkgconfig, glib, dbus_cplusplus, dbus, protobuf, openssl, snappy, pam
+}:
let
- src_chromebase = fetchgit {
- url = "https://chromium.googlesource.com/chromium/src/base.git";
+ src_chromebase = fetchFromGitiles {
+ url = "https://chromium.googlesource.com/chromium/src/base";
rev = "2dfe404711e15e24e79799516400c61b2719d7af";
sha256 = "2bd93a3ace4b6767db2c1bd1e16f426c97b8d2133a9cb15f8372b2516cfa65c5";
};
@@ -13,7 +14,7 @@ let
sha256 = "0nq98cpnv2jsx2byp4ilam6kydcnziflkc16ikydajmp4mcvpz16";
};
- src_platform2 = fetchgit {
+ src_platform2 = fetchFromGitiles {
url = "https://chromium.googlesource.com/chromiumos/platform2";
rev = "e999e989eaa71c3db7314fc7b4e20829b2b5473b";
sha256 = "15n1bsv6r7cny7arx0hdb223xzzbk7vkxg2r7xajhl4nsj39adjh";
@@ -25,8 +26,9 @@ stdenv.mkDerivation rec {
name = "chaps-0.42-6812";
version = "0.42-6812";
- src = fetchgit {
- url = "https://github.com/google/chaps-linux";
+ src = fetchFromGitHub {
+ owner = "google";
+ repo = "chaps-linux";
rev = "989aadc45cdb216ca35b0c97d13fc691576fa1d7";
sha256 = "0chk6pnn365d5kcz6vfqx1d0383ksk97icc0lzg0vvb0kvyj0ff1";
};
diff --git a/pkgs/tools/system/minijail/default.nix b/pkgs/tools/system/minijail/default.nix
index af9e06e9d1a5..9debd9a33d83 100644
--- a/pkgs/tools/system/minijail/default.nix
+++ b/pkgs/tools/system/minijail/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchgit, libcap }:
+{ stdenv, fetchFromGitiles, libcap }:
stdenv.mkDerivation rec {
pname = "minijail";
version = "android-10.0.0_r9";
- src = fetchgit {
+ src = fetchFromGitiles {
url = "https://android.googlesource.com/platform/external/minijail";
rev = version;
sha256 = "0gcfsyim1krrddcklydqfxl8mamaxgail2xl5qp9yclq60km8f22";
diff --git a/pkgs/tools/system/vboot_reference/default.nix b/pkgs/tools/system/vboot_reference/default.nix
index 0bf8a7e85dce..bce6d0c4185f 100644
--- a/pkgs/tools/system/vboot_reference/default.nix
+++ b/pkgs/tools/system/vboot_reference/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, pkgconfig, libuuid, openssl, libyaml, lzma }:
+{ stdenv, fetchFromGitiles, pkgconfig, libuuid, openssl, libyaml, lzma }:
stdenv.mkDerivation rec {
version = "20180311";
@@ -6,8 +6,8 @@ stdenv.mkDerivation rec {
pname = "vboot_reference";
- src = fetchgit {
- url = https://chromium.googlesource.com/chromiumos/platform/vboot_reference;
+ src = fetchFromGitiles {
+ url = "https://chromium.googlesource.com/chromiumos/platform/vboot_reference";
rev = checkout;
sha256 = "1zja4ma6flch08h5j2l1hqnxmw2xwylidnddxxd5y2x05dai9ddj";
};
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 32770a4d868c..e11f942c6fb3 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -360,6 +360,8 @@ in
fetchFromGitLab = callPackage ../build-support/fetchgitlab {};
+ fetchFromGitiles = callPackage ../build-support/fetchgitiles {};
+
fetchFromRepoOrCz = callPackage ../build-support/fetchrepoorcz {};
fetchNuGet = callPackage ../build-support/fetchnuget { };