diff options
author | Felix Buehler <account@buehler.rocks> | 2021-12-01 16:12:31 +0100 |
---|---|---|
committer | Felix Buehler <account@buehler.rocks> | 2022-01-29 10:52:23 +0100 |
commit | f328da45aeb06f84cd587c7bfc57bda1236fc935 (patch) | |
tree | b19a14ed586491b69ab322e9c87ca13f26b89791 /pkgs/development/perl-modules | |
parent | 84726d052e8512cd7697c6cac3c25d044b116af1 (diff) |
findimagedupes: init at 2.19.1
Diffstat (limited to 'pkgs/development/perl-modules')
-rw-r--r-- | pkgs/development/perl-modules/findimagedupes/default.nix | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/development/perl-modules/findimagedupes/default.nix b/pkgs/development/perl-modules/findimagedupes/default.nix new file mode 100644 index 0000000000000..19a80434be1e9 --- /dev/null +++ b/pkgs/development/perl-modules/findimagedupes/default.nix @@ -0,0 +1,70 @@ +{ lib, stdenv, fetchurl, makeWrapper, perl, perlPackages, installShellFiles }: + +stdenv.mkDerivation rec { + pname = "findimagedupes"; + version = "2.19.1"; + + # fetching this from GitHub does not contain the correct version number + src = fetchurl { + url = "http://www.jhnc.org/findimagedupes/findimagedupes-${version}.tar.gz"; + sha256 = "sha256-5NBPoXNZays5wzpQYar4uZZb0P/zB7fdecE+SjkJjcI="; + }; + + # Work around the "unpacker appears to have produced no directories" + setSourceRoot = "sourceRoot=$(pwd)"; + + nativeBuildInputs = [ makeWrapper installShellFiles ]; + + buildInputs = [ perl ] ++ (with perlPackages; [ + DBFile + FileMimeInfo + FileBaseDir + #GraphicsMagick + ImageMagick + Inline + InlineC + ParseRecDescent + ]); + + # use /tmp as a storage + # replace GraphicsMagick with ImageMagick, because perl bindings are not yet available + postPatch = '' + substituteInPlace findimagedupes \ + --replace "DIRECTORY => '/usr/local/lib/findimagedupes';" "DIRECTORY => '/tmp';" \ + --replace "Graphics::Magick" "Image::Magick" + ''; + + buildPhase = " + runHook preBuild + ${perl}/bin/pod2man findimagedupes > findimagedupes.1 + runHook postBuild + "; + + installPhase = '' + runHook preInstall + install -D -m 755 findimagedupes $out/bin/findimagedupes + installManPage findimagedupes.1 + runHook postInstall + ''; + + postFixup = '' + wrapProgram "$out/bin/findimagedupes" \ + --prefix PERL5LIB : "${with perlPackages; makePerlPath [ + DBFile + FileMimeInfo + FileBaseDir + #GraphicsMagick + ImageMagick + Inline + InlineC + ParseRecDescent + ]}" + ''; + + meta = with lib; { + homepage = "http://www.jhnc.org/findimagedupes/"; + description = "Finds visually similar or duplicate images"; + license = licenses.gpl3; + maintainers = with maintainers; [ stunkymonkey ]; + }; +} |