From f328da45aeb06f84cd587c7bfc57bda1236fc935 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Wed, 1 Dec 2021 16:12:31 +0100 Subject: [PATCH] findimagedupes: init at 2.19.1 --- .../perl-modules/findimagedupes/default.nix | 70 +++++++++++++++++++ pkgs/top-level/perl-packages.nix | 2 + 2 files changed, 72 insertions(+) create mode 100644 pkgs/development/perl-modules/findimagedupes/default.nix diff --git a/pkgs/development/perl-modules/findimagedupes/default.nix b/pkgs/development/perl-modules/findimagedupes/default.nix new file mode 100644 index 000000000000..19a80434be1e --- /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 ]; + }; +} diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index f7d291928f37..ac1c704b889c 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -8973,6 +8973,8 @@ let buildInputs = [ TestPod ]; }; + findimagedupes = callPackage ../development/perl-modules/findimagedupes { }; + FindLib = buildPerlPackage { pname = "Find-Lib"; version = "1.04";