From c6bd4d29732b948c1f54d668e1ff177465c505fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Tue, 10 Jun 2014 17:36:41 +0200 Subject: [PATCH] nix-prefetch-scripts: new expression --- .../nix-prefetch-tools/default.nix | 28 ---------------- .../nix-prefetch-scripts/default.nix | 33 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 34 insertions(+), 29 deletions(-) delete mode 100644 pkgs/build-support/nix-prefetch-tools/default.nix create mode 100644 pkgs/tools/package-management/nix-prefetch-scripts/default.nix diff --git a/pkgs/build-support/nix-prefetch-tools/default.nix b/pkgs/build-support/nix-prefetch-tools/default.nix deleted file mode 100644 index de47b23925f0..000000000000 --- a/pkgs/build-support/nix-prefetch-tools/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{stdenv}: -stdenv.mkDerivation { - name = "nix-prefetch-tools"; - src = ""; - srcRoot="."; - prePhases = "undefUnpack"; - undefUnpack = '' - unpackPhase () { :; }; - ''; - installPhase = '' - mkdir -p $out/bin - cp ${../fetchbzr/nix-prefetch-bzr} $out/bin - cp ${../fetchcvs/nix-prefetch-cvs} $out/bin - cp ${../fetchgit/nix-prefetch-git} $out/bin - cp ${../fetchhg/nix-prefetch-hg} $out/bin - cp ${../fetchsvn/nix-prefetch-svn} $out/bin - chmod a+x $out/bin/* - ''; - meta = { - description = '' - A package to include all the NixPkgs prefetchers - ''; - maintainers = with stdenv.lib.maintainers; [raskin]; - platforms = with stdenv.lib.platforms; unix; - # Quicker to build than to download, I hope - hydraPlatforms = []; - }; -} diff --git a/pkgs/tools/package-management/nix-prefetch-scripts/default.nix b/pkgs/tools/package-management/nix-prefetch-scripts/default.nix new file mode 100644 index 000000000000..d7210b2f616b --- /dev/null +++ b/pkgs/tools/package-management/nix-prefetch-scripts/default.nix @@ -0,0 +1,33 @@ +{ stdenv, makeWrapper, git, subversion, mercurial, bazaar, cvs }: + +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; + local exe=$3/bin; + cp $src $out/bin/$name; + wrapProgram $out/bin/$name --suffix PATH : "$exe" + } + + 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} + ''; + + 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 = []; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3478e3a7cde0..32c60e534ab3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10894,7 +10894,7 @@ let nixops = callPackage ../tools/package-management/nixops { }; - nix-prefetch-tools = callPackage ../build-support/nix-prefetch-tools {}; + nix-prefetch-scripts = callPackage ../tools/package-management/nix-prefetch-scripts { }; nix-repl = callPackage ../tools/package-management/nix-repl { };