summary refs log tree commit diff
path: root/pkgs/development/libraries/phash/default.nix
blob: dbc7e0c3a59bb2822da89c2334b5f4a06d2deea6 (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
29
30
31
32
33
34
35
36
37
{ stdenv, fetchFromGitHub, pkg-config, cimg, imagemagick }:

stdenv.mkDerivation rec {
  pname = "pHash";
  version = "0.9.4";

  buildInputs = [ cimg ];

  # CImg.h calls to external binary `convert` from the `imagemagick` package
  # at runtime
  propagatedBuildInputs = [ imagemagick ];

  nativeBuildInputs = [ pkg-config ];

  configureFlags = ["--enable-video-hash=no" "--enable-audio-hash=no"];
  postInstall = ''
    cp ${cimg}/include/CImg.h $out/include/
  '';

  src = fetchFromGitHub {
    owner = "clearscene";
    repo = "pHash";
    rev = version;
    sha256 = "0y4gknfkns5sssfaj0snyx29752my20xmxajg6xggijx0myabbv0";
  };

  meta = with stdenv.lib; {
    inherit version;
    description = "Compute the perceptual hash of an image";
    license = licenses.gpl3;
    maintainers = [maintainers.imalsogreg];
    platforms = platforms.all;
    homepage = "http://www.phash.org";
    downloadPage = "https://github.com/clearscene/pHash";
    updateWalker = true;
  };
}