summary refs log tree commit diff
path: root/pkgs/tools/security/ssdeep/default.nix
blob: 4f2cf551816b333f9e5cb0bfe18413c2208b1705 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ stdenv, fetchurl, patchelf }:

stdenv.mkDerivation rec {
  name    = "ssdeep-${version}";
  version = "2.13";

  src = fetchurl {
    url    = "mirror://sourceforge/ssdeep/${name}.tar.gz";
    sha256 = "1igqy0j7jrklb8fdlrm6ald4cyl1fda5ipfl8crzyl6bax2ajk3f";
  };

  buildInputs = stdenv.lib.optional (!stdenv.isDarwin) [ patchelf ];

  # For some reason (probably a build system bug), the binary isn't
  # properly linked to $out/lib to find libfuzzy.so
  postFixup = stdenv.lib.optionalString (!stdenv.isDarwin) ''
    rp=$(patchelf --print-rpath $out/bin/ssdeep)
    patchelf --set-rpath $rp:$out/lib $out/bin/ssdeep
  '';

  meta = {
    description = "A program for calculating fuzzy hashes";
    homepage    = "http://www.ssdeep.sf.net";
    license     = stdenv.lib.licenses.gpl2;
    platforms   = stdenv.lib.platforms.unix;
    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
  };
}