From f3973017dce6332ff5bdb3716dbba3c668517a06 Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:35:24 -0500 Subject: [PATCH] perlPackages.ImageMagick: use same version as main imagemagick package A recent update to ImageMagick fixed handling of Macintosh PICT files, and updated the PerlMagick test files to match. The PerlMagick package here was still using an old version, however, so its checkPhase was failing. This change makes it use the `version` and `src` of imagemagick. The new `preConfigure` command runs ImageMagick's top-level `./configure` to create `Makefile.PL` from `Makefile.PL.in`, then does `make perl-quantum-sources` to generate the appropriate module for the ImageMagick configuration being used (Q16HDRI for now). The old `sed` command for include paths seems to no longer be necessary. Fixes #371857. Co-authored-by: Michal Sojka --- pkgs/top-level/perl-packages.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 94923ff13f683..2cf8e0f3a55c6 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -20764,15 +20764,16 @@ with self; { PerlMagick = ImageMagick; # added 2021-08-02 ImageMagick = buildPerlPackage rec { pname = "Image-Magick"; - version = "7.1.1-20"; - src = fetchurl { - url = "mirror://cpan/authors/id/J/JC/JCRISTY/Image-Magick-${version}.tar.gz"; - hash = "sha256-oMAwXQBxuV2FgPHBhUi+toNFPVnRLNjZqdP2q+ki6jg="; - }; + inherit (pkgs.imagemagick) version src; + sourceRoot = "${src.name}/PerlMagick"; buildInputs = [ pkgs.imagemagick ]; preConfigure = '' - sed -i -e 's|my \$INC_magick = .*|my $INC_magick = "-I${pkgs.imagemagick.dev}/include/ImageMagick";|' Makefile.PL + pushd .. + chmod -R +rwX . + ./configure --with-perl + make perl-quantum-sources + popd ''; meta = { description = "Objected-oriented Perl interface to ImageMagick. Use it to read, manipulate, or write an image or image sequence from within a Perl script";