Skip to content

Commit

Permalink
findimagedupes: init at 2.19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Stunkymonkey committed May 11, 2021
1 parent 94a5246 commit 4dec0e1
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 7 deletions.
53 changes: 48 additions & 5 deletions pkgs/applications/graphics/graphicsmagick/default.nix
@@ -1,6 +1,22 @@
{ lib, stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
, libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz, libX11
, libwebp, quantumdepth ? 8, fixDarwinDylibNames }:
{ lib
, stdenv
, fetchurl
, bzip2
, freetype
, graphviz
, ghostscript
, libjpeg
, libpng
, libtiff
, libxml2
, zlib
, libtool
, xz
, libX11
, libwebp
, quantumdepth ? 8
, fixDarwinDylibNames
}:

stdenv.mkDerivation rec {
pname = "graphicsmagick";
Expand All @@ -15,23 +31,50 @@ stdenv.mkDerivation rec {
./disable-popen.patch
];

outputs = [ "out" "dev" ];

enableParallelBuilding = true;

configureFlags = [
"--enable-shared"
"--with-frozenpaths"
"--with-modules"
"--with-perl"
"--with-quantum-depth=${toString quantumdepth}"
"--with-gslib=yes"

This comment has been minimized.

Copy link
@dschrempf

dschrempf May 15, 2021

The ghost script flag is not anymore supported and should be removed.

See release notes of 1.3.31 (November 17, 2018).

This comment has been minimized.

Copy link
@Stunkymonkey

Stunkymonkey May 15, 2021

Author Owner

i did not add this. It was already there before.. but i also think we do not need it.

"--with-threads"

This comment has been minimized.

Copy link
@dschrempf

dschrempf May 15, 2021

I think we don't need this flag, it is the default. See http://www.graphicsmagick.org/INSTALL-unix.html

This comment has been minimized.

Copy link
@Stunkymonkey

Stunkymonkey May 15, 2021

Author Owner

i totaly agree

];

buildInputs =
[ bzip2 freetype ghostscript graphviz libjpeg libpng libtiff libX11 libxml2
zlib libtool libwebp
[
bzip2
freetype
ghostscript
graphviz
libjpeg
libpng
libtiff
libX11
libxml2
zlib
libtool
libwebp
];

nativeBuildInputs = [ xz ]
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;

postInstall = ''
sed -i 's/-ltiff.*'\'/\'/ $out/bin/*
moveToOutput "PerlMagick" "$dev" # why not doing anything?
mv "PerlMagick" "$dev"
#moveToOutput "magick" "$dev" # why not doing anything?
#mv "magick/*" "$dev/include/GraphicsMagick/"
moveToOutput "bin/*-config" "$dev"
moveToOutput "lib/libGraphicsMagick.so.*" "$dev" # includes configure params
moveToOutput "lib/GraphicsMagick-*/config*" "$dev" # includes configure params
'';

meta = {
Expand Down
38 changes: 38 additions & 0 deletions pkgs/development/perl-modules/findimagedupes/default.nix
@@ -0,0 +1,38 @@
{ lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages, PerlGMagick, DBFile, FileMimeInfo, FileBaseDir, FileTemp, MIMEBase64, PodUsage }:

stdenv.mkDerivation rec {
pname = "findimagedupes";
version = "2.19.1";

src = fetchFromGitHub {
owner = "jhnc";
repo = "${pname}";
rev = "${version}";
sha256 = "19hchaxzzq7kwrcnm3m2zyigq38kdc9l0jp6pz6cm9hfxna58518";
};

nativeBuildInputs = with perlPackages; [ makeWrapper PodMarkdown ];

propagatedBuildInputs = with perlPackages; [ perl ];

preBuild = ''
sed -i -e "s:DIRECTORY => '/usr/local/lib/findimagedupes':DIRECTORY => '/tmp':" findimagedupes
'';

buildPhase = "
pod2man findimagedupes > findimagedupes.1
";

installPhase = ''
install -D -m 755 findimagedupes $out/bin/findimagedupes
wrapProgram $out/bin/findimagedupes --set PERL5LIB ${with perlPackages; makeFullPerlPath [ DBFile FileMimeInfo FileBaseDir FileTemp MIMEBase64 PerlGMagick PodUsage ]}
install -D -m 644 findimagedupes.1 $out/share/man/man1/findimagedupes.1
'';

meta = with lib; {
homepage = "http://www.jhnc.org/findimagedupes/";
description = "Finds visually similar or duplicate images";
license = licenses.gpl3;
maintainers = with maintainers; [ stunkymonkey dschrempf ];
};
}
32 changes: 30 additions & 2 deletions pkgs/top-level/perl-packages.nix
Expand Up @@ -8477,6 +8477,8 @@ let
buildInputs = [ TestPod ];
};

findimagedupes = callPackage ../development/perl-modules/findimagedupes { };

FindLib = buildPerlPackage {
pname = "Find-Lib";
version = "1.04";
Expand Down Expand Up @@ -16969,8 +16971,8 @@ let
};
};

PerlMagick = buildPerlPackage rec {
pname = "PerlMagick";
PerlIMagick = buildPerlPackage rec {
pname = "PerlIMagick";
version = "7.0.10";
src = fetchurl {
url = "mirror://cpan/authors/id/J/JC/JCRISTY/PerlMagick-${version}.tar.gz";
Expand All @@ -16988,6 +16990,31 @@ let
'';
};

PerlGMagick = buildPerlPackage {
pname = "PerlGMagick";
version = "6.89-1";
unpackPhase = "true";
buildInputs = [ pkgs.graphicsmagick ];
preConfigure =
''
# move is not allowed, so copy instead
cp -r ${pkgs.graphicsmagick.dev}/PerlMagick/* .
# by far the ugliest part
chmod 744 demo
chmod -R 744 t

sed -i -e "s|my \$magick_CPPFLAGS='|my \$magick_CPPFLAGS='-I${pkgs.graphicsmagick.dev}/include/GraphicsMagick |" Makefile.PL

echo "########"
ls ${pkgs.graphicsmagick.dev}/include/GraphicsMagick/magick

# things from arch-linux
#sed -i -e "s:'LDDLFLAGS' => \"\(.*\)\":'LDDLFLAGS' => \"-L$dev/lib \1\":" Makefile.PL
#perl Makefile.PL INSTALLDIRS=vendor PREFIX=/usr DESTDIR="$out"
#sed -i -e "s/LDLOADLIBS =/LDLOADLIBS = -lGraphicsMagick/" Makefile
'';
};

PerlTidy = buildPerlPackage rec {
pname = "Perl-Tidy";
version = "20201207";
Expand Down Expand Up @@ -24151,6 +24178,7 @@ let
NetSMTP = self.libnet;
OLEStorageLight = self.OLEStorage_Lite; # For backwards compatibility. Please use OLEStorage_Lite instead.
ParseCPANMeta = self.CPANMeta;
PerlMagick = self.PerlIMagick;
TestMoose = self.Moose;
TestMore = self.TestSimple;
TestTester = self.TestSimple;
Expand Down

0 comments on commit 4dec0e1

Please sign in to comment.