hardlink: initial version

Hardlink consolidates duplicate files in a directory hierarchy with hardlinks,
similar to "nix-store --optimise".

IHMO, this program should be run by the default builder after $out has been set
up, to remove redundancy in the generated closures.

svn path=/nixpkgs/trunk/; revision=31934
This commit is contained in:
Peter Simons 2012-01-30 11:40:20 +00:00
parent f1e16ea3c9
commit c5ecd1752c
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,37 @@
{ fetchurl, stdenv }:
let
rev = "269cc6";
src = fetchurl {
url = "http://pkgs.fedoraproject.org/gitweb/?p=hardlink.git;a=blob_plain;f=hardlink.c;hb=${rev}";
sha256 = "721c54e653772e11bf0d30fb02aa21b96b147a1b68c0acb4f05cb87e7718bc12";
name = "hardlink.c";
};
man = fetchurl {
url = "pkgs.fedoraproject.org/gitweb/?p=hardlink.git;a=blob_plain;f=hardlink.1;hb=${rev}";
sha256 = "2f7e18a0259a2ceae316592e8b18bee525eb7e83fe3bb6b881e5dafa24747f2d";
name = "hardlink.1";
};
in
stdenv.mkDerivation {
name = "hardlink-2010.1.${rev}";
phases = ["buildPhase"];
buildPhase = ''
mkdir -p $out/bin $out/share/man/man1
gcc -O2 ${src} -o $out/bin/hardlink
install -m 444 ${man} $out/share/man/man1/hardlink.1
'';
meta = {
homepage = "http://pkgs.fedoraproject.org/gitweb/?p=hardlink.git;a=summary";
description = "consolidate duplicate files via hardlinks";
license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.simons ];
};
}

View File

@ -830,6 +830,8 @@ let
pigz = callPackage ../tools/compression/pigz { }; pigz = callPackage ../tools/compression/pigz { };
hardlink = callPackage ../tools/system/hardlink { };
halibut = callPackage ../tools/typesetting/halibut { }; halibut = callPackage ../tools/typesetting/halibut { };
hddtemp = callPackage ../tools/misc/hddtemp { }; hddtemp = callPackage ../tools/misc/hddtemp { };