2014-06-21 05:05:48 +02:00
|
|
|
{ stdenv, makeWrapper, git, subversion, mercurial, bazaar, cvs, unzip, curl }:
|
2014-06-10 17:36:41 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "nix-prefetch-scripts";
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
phases = [ "installPhase" "fixupPhase" ];
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
function copyScript {
|
|
|
|
local name=nix-prefetch-$1;
|
|
|
|
local src=$2;
|
|
|
|
cp $src $out/bin/$name;
|
2014-06-21 05:05:48 +02:00
|
|
|
for dep in ''${@:3}; do
|
|
|
|
local exe=$dep/bin;
|
|
|
|
local wrapArgs="$wrapArgs --suffix PATH : $exe"
|
|
|
|
done
|
|
|
|
wrapProgram $out/bin/$name $wrapArgs
|
2014-06-10 17:36:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
copyScript "hg" ${../../../build-support/fetchhg/nix-prefetch-hg} ${mercurial}
|
|
|
|
copyScript "git" ${../../../build-support/fetchgit/nix-prefetch-git} ${git}
|
|
|
|
copyScript "svn" ${../../../build-support/fetchsvn/nix-prefetch-svn} ${subversion}
|
|
|
|
copyScript "bzr" ${../../../build-support/fetchbzr/nix-prefetch-bzr} ${bazaar}
|
|
|
|
copyScript "cvs" ${../../../build-support/fetchcvs/nix-prefetch-cvs} ${cvs}
|
2014-06-21 05:05:48 +02:00
|
|
|
copyScript "zip" ${./nix-prefetch-zip} ${unzip} ${curl}
|
2014-06-10 17:36:41 +02: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 = with stdenv.lib.platforms; unix;
|
|
|
|
# Quicker to build than to download, I hope
|
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
2014-06-21 05:05:48 +02:00
|
|
|
}
|