2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, makeWrapper, buildEnv,
|
2020-05-29 06:06:01 +00:00
|
|
|
breezy, coreutils, cvs, findutils, gawk, git, gnused, mercurial, nix, subversion
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let mkPrefetchScript = tool: src: deps:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "nix-prefetch-${tool}";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -vD ${src} $out/bin/$name;
|
|
|
|
wrapProgram $out/bin/$name \
|
2021-01-15 22:18:51 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath (deps ++ [ gnused nix ])} \
|
2020-04-24 23:36:52 +00:00
|
|
|
--set HOME /homeless-shelter
|
|
|
|
'';
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Script used to obtain source hashes for fetch${tool}";
|
|
|
|
maintainers = with maintainers; [ bennofs ];
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in rec {
|
2020-05-29 06:06:01 +00:00
|
|
|
nix-prefetch-bzr = mkPrefetchScript "bzr" ../../../build-support/fetchbzr/nix-prefetch-bzr [ breezy ];
|
2020-04-24 23:36:52 +00:00
|
|
|
nix-prefetch-cvs = mkPrefetchScript "cvs" ../../../build-support/fetchcvs/nix-prefetch-cvs [ cvs ];
|
|
|
|
nix-prefetch-git = mkPrefetchScript "git" ../../../build-support/fetchgit/nix-prefetch-git [ coreutils findutils gawk git ];
|
|
|
|
nix-prefetch-hg = mkPrefetchScript "hg" ../../../build-support/fetchhg/nix-prefetch-hg [ mercurial ];
|
|
|
|
nix-prefetch-svn = mkPrefetchScript "svn" ../../../build-support/fetchsvn/nix-prefetch-svn [ subversion ];
|
|
|
|
|
|
|
|
nix-prefetch-scripts = buildEnv {
|
|
|
|
name = "nix-prefetch-scripts";
|
|
|
|
|
|
|
|
paths = [ nix-prefetch-bzr nix-prefetch-cvs nix-prefetch-git nix-prefetch-hg nix-prefetch-svn ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Collection of all the nix-prefetch-* scripts which may be used to obtain source hashes";
|
|
|
|
maintainers = with maintainers; [ bennofs ];
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|