Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetcher improvements #59858

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pkgs/applications/audio/a2jmidid/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, makeWrapper, pkgconfig, alsaLib, dbus, libjack2
{ stdenv, fetchFromRepoOrCz, fetchpatch, makeWrapper, pkgconfig, alsaLib, dbus, libjack2
, wafHook
, python2Packages}:

Expand All @@ -8,9 +8,10 @@ in stdenv.mkDerivation rec {
name = "a2jmidid-${version}";
version = "8";

src = fetchurl {
url = "https://repo.or.cz/a2jmidid.git/snapshot/7383d268c4bfe85df9f10df6351677659211d1ca.tar.gz";
sha256 = "06dgf5655znbvrd7fhrv8msv6zw8vk0hjqglcqkh90960mnnmwz7";
src = fetchFromRepoOrCz {
repo = "a2jmidid";
rev = "7383d268c4bfe85df9f10df6351677659211d1ca";
sha256 = "0j22la0zjixcw55x8ccfpabnv1ljl487s0b9yaj4ykrv1731wr5y";
};

nativeBuildInputs = [ pkgconfig makeWrapper wafHook ];
Expand Down
7 changes: 3 additions & 4 deletions pkgs/applications/misc/llpp/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, substituteAll, makeWrapper, fetchgit, ocaml, mupdf, libX11,
{ stdenv, lib, substituteAll, makeWrapper, fetchFromRepoOrCz, ocaml, mupdf, libX11,
libGLU_combined, freetype, xclip, inotify-tools, procps }:

assert lib.versionAtLeast (lib.getVersion ocaml) "4.07";
Expand All @@ -7,11 +7,10 @@ stdenv.mkDerivation rec {
name = "llpp-${version}";
version = "30";

src = fetchgit {
url = "git://repo.or.cz/llpp.git";
src = fetchFromRepoOrCz {
repo = "llpp";
rev = "v${version}";
sha256 = "0iilpzf12hs0zky58j55l4y5dvzv7fc53nsrg324n9vka92mppvd";
fetchSubmodules = false;
};

patches = (substituteAll {
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/networking/browsers/conkeror/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{ stdenv, fetchgit, unzip, firefox-esr, makeWrapper }:
{ stdenv, fetchFromRepoOrCz, unzip, firefox-esr, makeWrapper }:

stdenv.mkDerivation rec {
pkgname = "conkeror";
version = "1.0.4";
name = "${pkgname}-${version}";

src = fetchgit {
url = git://repo.or.cz/conkeror.git;
rev = "refs/tags/${version}";
src = fetchFromRepoOrCz {
repo = "conkeror";
rev = version;
sha256 = "10c57wqybp9kcjpkb01wxq0h3vafcdb1g5kb4k8sb2zajg59afv8";
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{stdenv, fetchgit, mercurial, makeWrapper, subversion}:
{stdenv, fetchFromRepoOrCz, mercurial, makeWrapper, subversion}:

with stdenv.lib;
stdenv.mkDerivation {
name = "fast-export";

src = fetchgit {
url = git://repo.or.cz/fast-export.git;
src = fetchFromRepoOrCz {
repo = "fast-export";
rev = "d202200fd9daa75cdb37d4cf067d4ca00e269535";
sha256 = "0m4llsg9rx4sza1kf39kxsdvhi6y87a18wm5k19c5r2h3vpylwcc";
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{ fetchgit, stdenv, perl }:
{ fetchFromRepoOrCz, stdenv, perl }:

stdenv.mkDerivation {
name = "git2cl-20080827";

src = fetchgit {
url = "git://repo.or.cz/git2cl.git";
src = fetchFromRepoOrCz {
repo = "git2cl";
rev = "8373c9f74993e218a08819cbcdbab3f3564bbeba";
sha256 = "b0d39379640c8a12821442431e2121f7908ce1cc88ec8ec6bede218ea8c21f2f";
sha256 = "0bqzqal8w8fypv38xv48rkhqr47p44hiwhs22j1152hcciwr7lxh";
};

buildInputs = [ perl ];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ stdenv, fetchgit, pkgconfig, libX11, libXpm, libXext, alsaLib }:
{ stdenv, fetchFromRepoOrCz, pkgconfig, libX11, libXpm, libXext, alsaLib }:

stdenv.mkDerivation {
name = "alsamixer.app-0.2.1";
src = fetchgit {
url = git://repo.or.cz/dockapps.git;
src = fetchFromRepoOrCz {
repo = "dockapps";
rev = "38c74350b02f35824554ce0c4f0f251d71762040";
sha256 = "0g9cwhlqg065fbhav4g4n16a4cqkk9jykl3y0zwbn5whhacfqyhl";
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchbitbucket/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ fetchzip }:

{ owner, repo, rev, name ? "source"
{ owner, repo, rev, name ? "${repo}-${builtins.substring 0 10 rev}"
, ... # For hash agility
}@args: fetchzip ({
inherit name;
Expand Down
6 changes: 2 additions & 4 deletions pkgs/build-support/fetchbzr/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{ stdenvNoCC, bazaar }:
{ url, rev, sha256 }:
{ url, rev, sha256, name ? "bzr-export" }:

stdenvNoCC.mkDerivation {
name = "bzr-export";

builder = ./builder.sh;
nativeBuildInputs = [ bazaar ];

outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;

inherit url rev;
inherit url rev name;
}
7 changes: 4 additions & 3 deletions pkgs/build-support/fetchcvs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

{stdenvNoCC, cvs, openssh}:

{cvsRoot, module, tag ? null, date ? null, sha256}:
{cvsRoot, module, tag ? null, date ? null, sha256
, name ? "${module}-${if tag != null then tag else if date != null then date else "NOW"}"
}:

stdenvNoCC.mkDerivation {
name = "cvs-export";
builder = ./builder.sh;
nativeBuildInputs = [cvs openssh];

outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;

inherit cvsRoot module sha256 tag date;
inherit cvsRoot module sha256 tag date name;
}
7 changes: 3 additions & 4 deletions pkgs/build-support/fetchdarcs/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{stdenvNoCC, darcs, cacert}:
{stdenvNoCC, lib, darcs, cacert}:

{url, rev ? null, context ? null, md5 ? "", sha256 ? ""}:
{url, rev ? null, context ? null, md5 ? "", sha256 ? "", name ? "${baseNameOf url}" + (lib.optional (rev != null) "-${rev}")}:

if md5 != "" then
throw "fetchdarcs does not support md5 anymore, please use sha256"
else
stdenvNoCC.mkDerivation {
name = "fetchdarcs";
builder = ./builder.sh;
nativeBuildInputs = [cacert darcs];

outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;

inherit url rev context;
inherit url rev context name;
}
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchgithub/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, fetchgit, fetchzip }:

{ owner, repo, rev, name ? "source"
{ owner, repo, rev, name ? "${repo}-${builtins.substring 0 10 rev}"
, fetchSubmodules ? false, private ? false
, githubBase ? "github.com", varPrefix ? null
, ... # For hash agility
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchgitlab/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ fetchzip, lib }:

# gitlab example
{ owner, repo, rev, domain ? "gitlab.com", name ? "source", group ? null
{ owner, repo, rev, domain ? "gitlab.com", name ? "${repo}-${builtins.substring 0 10 rev}", group ? null
, ... # For hash agility
}@args: fetchzip ({
inherit name;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchgitlocal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let

gitHash = builtins.readFile gitHashFile; # cache against git hash

nixPath = runCommand "put-in-nix" {
nixPath = runCommand "${baseNameOf srcStr}" {
nativeBuildInputs = [ git ];
preferLocalBuild = true;
} ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchrepoorcz/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ fetchzip }:

# gitweb example, snapshot support is optional in gitweb
{ repo, rev, name ? "source"
{ repo, rev, name ? "${repo}-${builtins.substring 0 10 rev}"
, ... # For hash agility
}@args: fetchzip ({
inherit name;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchsavannah/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ fetchzip }:

# cgit example, snapshot support is optional in cgit
{ repo, rev, name ? "source"
{ repo, rev, name ? "repo-${builtins.substring 0 10 rev}"
, ... # For hash agility
}@args: fetchzip ({
inherit name;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/build-support/fetchsvnrevision/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
runCommand: subversion: repository:
import (runCommand "head-revision"
import (runCommand "${baseNameOf repository}-head-revision"
{ buildInputs = [ subversion ];
dummy = builtins.currentTime;
}
''
rev=$(echo p | svn ls -v --depth empty ${repository} |awk '{ print $1 }')
echo "[ \"$rev\" ]" > $out
echo Latest revision is $rev
'')
'')
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchsvnssh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if md5 != "" then
throw "fetchsvnssh does not support md5 anymore, please use sha256"
else
stdenvNoCC.mkDerivation {
name = "svn-export-ssh";
name = "svn-export-${baseNameOf url}";
builder = ./builder.sh;
nativeBuildInputs = [subversion expect];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchzip/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
stripRoot ? true
, url
, extraPostFetch ? ""
, name ? "source"
, name ? baseNameOf url
, ... } @ args:

(fetchurl ({
Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/libraries/libtar/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{ stdenv, fetchgit, fetchpatch, autoreconfHook }:
{ stdenv, fetchFromRepoOrCz, fetchpatch, autoreconfHook }:

stdenv.mkDerivation rec {
version = "1.2.20";
name = "libtar-${version}";

# Maintenance repo for libtar (Arch Linux uses this)
src = fetchgit {
url = "git://repo.or.cz/libtar.git";
rev = "refs/tags/v${version}";
src = fetchFromRepoOrCz {
repo = "libtar";
rev = "v${version}";
sha256 = "1pjsqnqjaqgkzf1j8m6y5h76bwprffsjjj6gk8rh2fjsha14rqn9";
};

Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/tools/analysis/smatch/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchgit, sqlite, pkgconfig, perl
{ stdenv, fetchFromRepoOrCz, sqlite, pkgconfig, perl
, buildllvmsparse ? true
, buildc2xml ? true
, llvm ? null, libxml2 ? null
Expand All @@ -10,8 +10,8 @@ assert buildc2xml -> libxml2 != null;
stdenv.mkDerivation {
name = "smatch-20120924";

src = fetchgit {
url = git://repo.or.cz/smatch.git;
src = fetchFromRepoOrCz {
repo = "smatch";
rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9";
sha256 = "0r43qi6vryqg450fj73yjwbb7gzcgx64rhrhb3r1m6a252srijiy";
};
Expand Down