2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, cimg, imagemagick }:
|
2018-06-27 20:22:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pHash";
|
2022-04-08 21:34:30 +00:00
|
|
|
version = "0.9.6";
|
2018-06-27 20:22:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ cimg ];
|
|
|
|
|
|
|
|
# CImg.h calls to external binary `convert` from the `imagemagick` package
|
|
|
|
# at runtime
|
|
|
|
propagatedBuildInputs = [ imagemagick ];
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2018-06-27 20:22:52 +00:00
|
|
|
|
|
|
|
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;
|
2022-04-08 21:34:30 +00:00
|
|
|
sha256 = "sha256-frISiZ89ei7XfI5F2nJJehfQZsk0Mlb4n91q/AiZ2vA=";
|
2018-06-27 20:22:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-06-27 20:22:52 +00:00
|
|
|
description = "Compute the perceptual hash of an image";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = [maintainers.imalsogreg];
|
|
|
|
platforms = platforms.all;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.phash.org";
|
2018-06-27 20:22:52 +00:00
|
|
|
downloadPage = "https://github.com/clearscene/pHash";
|
|
|
|
};
|
|
|
|
}
|