1 { lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, cimg, imagemagick }:
3 stdenv.mkDerivation rec {
7 buildInputs = [ cimg ];
9 # CImg.h calls to external binary `convert` from the `imagemagick` package
11 propagatedBuildInputs = [ imagemagick ];
13 nativeBuildInputs = [ pkg-config ];
15 configureFlags = ["--enable-video-hash=no" "--enable-audio-hash=no"];
17 cp ${cimg}/include/CImg.h $out/include/
20 src = fetchFromGitHub {
24 sha256 = "sha256-frISiZ89ei7XfI5F2nJJehfQZsk0Mlb4n91q/AiZ2vA=";
27 NIX_LDFLAGS = "-lfftw3_threads";
30 # proper pthread return value (https://github.com/clearscene/pHash/pull/20)
31 ./0001-proper-pthread-return-value.patch
35 description = "Compute the perceptual hash of an image";
36 license = licenses.gpl3;
37 maintainers = [maintainers.imalsogreg];
38 platforms = platforms.all;
39 homepage = "http://www.phash.org";
40 downloadPage = "https://github.com/clearscene/pHash";