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