1{ lib, stdenv, makeWrapper, buildEnv
2, breezy, coreutils, cvs, findutils, gawk, git, git-lfs, gnused, mercurial, nix, subversion
3}:
4
5let mkPrefetchScript = tool: src: deps:
6 stdenv.mkDerivation {
7 name = "nix-prefetch-${tool}";
8
9 nativeBuildInputs = [ makeWrapper ];
10
11 dontUnpack = true;
12
13 installPhase = ''
14 install -vD ${src} $out/bin/$name;
15 wrapProgram $out/bin/$name \
16 --prefix PATH : ${lib.makeBinPath (deps ++ [ gnused nix ])} \
17 --set HOME /homeless-shelter
18 '';
19
20 preferLocalBuild = true;
21
22 meta = with lib; {
23 description = "Script used to obtain source hashes for fetch${tool}";
24 maintainers = with maintainers; [ bennofs ];
25 platforms = platforms.unix;
26 };
27 };
28in rec {
29 nix-prefetch-bzr = mkPrefetchScript "bzr" ../../../build-support/fetchbzr/nix-prefetch-bzr [ breezy ];
30 nix-prefetch-cvs = mkPrefetchScript "cvs" ../../../build-support/fetchcvs/nix-prefetch-cvs [ cvs ];
31 nix-prefetch-git = mkPrefetchScript "git" ../../../build-support/fetchgit/nix-prefetch-git [ coreutils findutils gawk git git-lfs ];
32 nix-prefetch-hg = mkPrefetchScript "hg" ../../../build-support/fetchhg/nix-prefetch-hg [ mercurial ];
33 nix-prefetch-svn = mkPrefetchScript "svn" ../../../build-support/fetchsvn/nix-prefetch-svn [ subversion ];
34
35 nix-prefetch-scripts = buildEnv {
36 name = "nix-prefetch-scripts";
37
38 paths = [ nix-prefetch-bzr nix-prefetch-cvs nix-prefetch-git nix-prefetch-hg nix-prefetch-svn ];
39
40 meta = with lib; {
41 description = "Collection of all the nix-prefetch-* scripts which may be used to obtain source hashes";
42 maintainers = with maintainers; [ bennofs ];
43 platforms = platforms.unix;
44 };
45 };
46}