2015-11-21 12:56:56 +00:00
|
|
|
{ stdenv, makeWrapper, buildEnv,
|
2018-09-03 13:23:16 +01:00
|
|
|
git, subversion, mercurial, bazaar, cvs, gnused, coreutils, nix, findutils
|
2015-11-16 10:53:29 +00:00
|
|
|
}:
|
2014-06-10 16:36:41 +01:00
|
|
|
|
2015-11-21 12:56:56 +00:00
|
|
|
let mkPrefetchScript = tool: src: deps:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "nix-prefetch-${tool}";
|
|
|
|
|
2017-12-24 21:16:26 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2015-11-21 12:56:56 +00:00
|
|
|
|
2019-06-19 16:45:34 +01:00
|
|
|
dontUnpack = true;
|
2017-08-11 10:40:08 +01:00
|
|
|
|
2015-11-21 12:56:56 +00:00
|
|
|
installPhase = ''
|
2017-08-11 10:40:08 +01:00
|
|
|
install -vD ${src} $out/bin/$name;
|
|
|
|
wrapProgram $out/bin/$name \
|
|
|
|
--prefix PATH : ${stdenv.lib.makeBinPath (deps ++ [ gnused nix ])} \
|
|
|
|
--set HOME /homeless-shelter
|
2015-11-21 12:56:56 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Script used to obtain source hashes for fetch${tool}";
|
|
|
|
maintainers = with maintainers; [ bennofs ];
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in rec {
|
2017-08-11 10:40:08 +01:00
|
|
|
nix-prefetch-bzr = mkPrefetchScript "bzr" ../../../build-support/fetchbzr/nix-prefetch-bzr [ bazaar ];
|
|
|
|
nix-prefetch-cvs = mkPrefetchScript "cvs" ../../../build-support/fetchcvs/nix-prefetch-cvs [ cvs ];
|
2018-09-03 13:23:16 +01:00
|
|
|
nix-prefetch-git = mkPrefetchScript "git" ../../../build-support/fetchgit/nix-prefetch-git [ git coreutils findutils ];
|
2017-08-11 10:40:08 +01:00
|
|
|
nix-prefetch-hg = mkPrefetchScript "hg" ../../../build-support/fetchhg/nix-prefetch-hg [ mercurial ];
|
|
|
|
nix-prefetch-svn = mkPrefetchScript "svn" ../../../build-support/fetchsvn/nix-prefetch-svn [ subversion ];
|
2015-11-21 12:56:56 +00:00
|
|
|
|
|
|
|
nix-prefetch-scripts = buildEnv {
|
|
|
|
name = "nix-prefetch-scripts";
|
|
|
|
|
2017-02-16 10:13:47 +00:00
|
|
|
paths = [ nix-prefetch-bzr nix-prefetch-cvs nix-prefetch-git nix-prefetch-hg nix-prefetch-svn ];
|
2015-11-21 12:56:56 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Collection of all the nix-prefetch-* scripts which may be used to obtain source hashes";
|
|
|
|
maintainers = with maintainers; [ bennofs ];
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
};
|
2014-06-10 16:36:41 +01:00
|
|
|
};
|
2014-06-21 04:05:48 +01:00
|
|
|
}
|