Opened 14 years ago

Closed 13 years ago

#25844 closed defect (fixed)

p5-perlmagick: use ImageMagick sources

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: l2g@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: astricker@…, adfernandes (Andrew Fernandes)
Port: p5-perlmagick

Description

p5-perlmagick was recently updated to version 6.59 but it was pointed out that this corresponds to ImageMagick version 6.5.9-1, which is several versions behind ImageMagick's version already. The ImageMagick source code contains the same source as p5-perlmagick, and this has puzzled me; if ImageMagick contains always-up-to-date source code, why does the separate p5-perlmagick distribution exist at all? In the absence of an answer to that question, I suggest p5-perlmagick switch to using the source contained in the ImageMagick distfile. This will ensure p5-perlmagick and ImageMagick can always be updated to the same version and be kept compatible with one another. If this is done, I would like to co-maintain p5-perlmagick with you, so that when I update ImageMagick to a new version, I can update p5-perlmagick as well.

I tried to do this once but got stuck because the version of the source included with ImageMagick does not come pre-configured like the p5-perlmagick version does. I had trouble figuring out what all to change in Makefile.PL.in to make it into a usable Makefile.PL that matched the currently-installed ImageMagick. I can look back at what I did and see if I can attach something useful here.

Attachments (5)

p5-perlmagick-old.diff (2.0 KB) - added by ryandesign (Ryan Carsten Schmidt) 14 years ago.
my old outdated diff
p5-perlmagick-from-imagemagick.patch (2.8 KB) - added by astricker@… 14 years ago.
Patch based on Ryan's p5-perlmagick-old.diff that works with current ImageMagick version
p5-perlmagick-update-to-6.7.0.patch (2.7 KB) - added by madcityzen@… 13 years ago.
Update p5-perlmagick to 6.7.0-0, diff from current version of p5-perlmagick Portfile
Portfile (1.9 KB) - added by Patrick.Cichowski@… 13 years ago.
updated Portfile - for the new Revision 3 of p5-perlmagick
Portfile-v672.patch (2.7 KB) - added by adfernandes (Andrew Fernandes) 13 years ago.
patch to upgrade to 6.72 from current portfile

Download all attachments as: .zip

Change History (18)

comment:1 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to astricker@…

comment:2 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

I had removed ImageMagick's +perl variant in r70035, instead intending for users to use p5-perlmagick, but brought it back in r70051 after it was suggested that we should wait until p5-perlmagick's version matches (and can continue in the future to match) ImageMagick's.

comment:3 Changed 14 years ago by astricker@…

Good catch! I didn't see the +perl variant of ImageMagick, but this seems to be the best solution. IMO there is no need to use the CPAN module at all. The drawback is that it's not really obvious that PerlMagick is available through this variant (compared with the stand-alone package p5-perlmagick) and I don't know if it's possible to define a dependency to a variant (e.g. something like port:imagemagick+perl).

For backwards compatibility I'll like to see a p5-perlmagick that is some kind of meta package containing no source but a dependency to the +perl variant of ImageMagick. Although I don't know if this is possible. I tried to change the p5-perlmagick to use the ImageMagick source. Haven't had success so far and the Portfile is getting messy, as several build steps needs massaging.

My current approach is

  1. Fetch the same ImageMagick archive like the imagemagick port
  2. Only extract the PerlMagick directory
  3. go ahead as before with the PerlMagick directory content (reinplace INC libs, build and install)

comment:4 in reply to:  3 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to astricker@…:

Good catch! I didn't see the +perl variant of ImageMagick, but this seems to be the best solution. IMO there is no need to use the CPAN module at all. The drawback is that it's not really obvious that PerlMagick is available through this variant (compared with the stand-alone package p5-perlmagick) and I don't know if it's possible to define a dependency to a variant (e.g. something like port:imagemagick+perl).

For backwards compatibility I'll like to see a p5-perlmagick that is some kind of meta package containing no source but a dependency to the +perl variant of ImageMagick. Although I don't know if this is possible.

No, it's not possible to declare a dependency on a variant; see #126. And I don't want to deprecate the p5-perlmagick portfile in favor of ImageMagick's +perl variant. I want the opposite: to deprecate ImageMagick's +perl variant in favor of the p5-perlmagick port. Separate ports are better than variants, both because of #126 and for other reasons. See my answer to Eric's mailing list post.

I tried to change the p5-perlmagick to use the ImageMagick source. Haven't had success so far and the Portfile is getting messy, as several build steps needs massaging.

That's what I found too.

My current approach is

  1. Fetch the same ImageMagick archive like the imagemagick port
  2. Only extract the PerlMagick directory
  3. go ahead as before with the PerlMagick directory content (reinplace INC libs, build and install)

I think that was my initial approach as well. But then I thought the included Makefile.PL should be deleted and regenerated from Makefile.PL.in using values relating to the currently-installed ImageMagick, but due to the number of things that would need to be replaced in Makefile.PL.in to make the new Makefile.PL, I thought about running ImageMagick's regular configure script to hopefully fill those values in. But then it became a problem of knowing which ImageMagick features to enable in this configure run; no matter what I selected it wouldn't match the user's ImageMagick port, given all the possible variants that could be selected there. Then I thought maybe I would have to reinplace output from MagickConfig into Makefile.PL to get the current values. Then I got discouraged and stopped working on it. Attached is the patch I had put together so far, which of course is now out of date w.r.t. what's in the p5-perlmagick port. It builds, but I'm not sure if what it builds is correct. Certainly it does not include improvements already in p5-perlmagick, such as for non-default-build_arch and universal builds.

Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: p5-perlmagick-old.diff added

my old outdated diff

Changed 14 years ago by astricker@…

Patch based on Ryan's p5-perlmagick-old.diff that works with current ImageMagick version

comment:5 Changed 14 years ago by astricker@…

I've attached a patch that updates your outdated diff to work with current ImageMagick version.

It didn't start a configuration run yet, but at least is an improvement to the CPAN version in use today.

comment:6 Changed 14 years ago by aalorbe@…

Had the following error after updating to latest XCode (3.2.3) and MacPorts (v 1.9.1):

:info:build sh: line 0: cd: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_perl_p5-perlmagick/work/PerlMagick-6.59: No such file or directory
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_perl_p5-perlmagick/work/PerlMagick-6.59" && /usr/bin/make -j4 all " returned error 1
:error:build Target org.macports.build returned: shell command failed

The p5-perlmagick-from-imagemagick.path file above allowed me to install the package. Thank you!!

As root...
cd /opt/local/var/macports/sources/rsync.macports.org/release/ports/perl/p5-perlmagick
patch Portfile  /tmp/p5-perlmagick-from-imagemagick.patch 
port install p5-perlmagick 

Changed 13 years ago by madcityzen@…

Update p5-perlmagick to 6.7.0-0, diff from current version of p5-perlmagick Portfile

comment:7 Changed 13 years ago by madcityzen@…

I've taken the p5-perlmagick-from-imagemagick.patch and updated it for ImageMagick 6.7.0-0 and attached a patch against the latest p5-perlmagick Portfile.

comment:8 Changed 13 years ago by l2g@…

Owner: changed from astricker@… to l2g@…
Status: newassigned
Version: 1.9.1

comment:9 Changed 13 years ago by jmroot (Joshua Root)

Cc: astricker@… added

Changed 13 years ago by Patrick.Cichowski@…

Attachment: Portfile added

updated Portfile - for the new Revision 3 of p5-perlmagick

comment:10 Changed 13 years ago by Patrick.Cichowski@…

I have used the p5-perlmagick-update-to-6.7.0.patch a few weeks ago (at the Beginning of July) and all worked fine. But today this patch doesn't work anymore, cause there is a new Revision of the p5-perlmagick Portfile (since 15th August). So now there are a few new commands in the Portfile, so that you get error-messages, if you want to patch it.

I'm not very good in creating patchfiles, so i have changed the Portfile manually by myself.

I have attached my Portfile, so that someone could make a new patchfile and in the meantime if someone need to install p5-perlmagick, you only have to copy the attached Portfile to

/opt/local/var/macports/sources/rsync.macports.org/release/ports/perl/p5-perlmagick

and then install p5-perlmagick with sudo port install p5-perlmagick

I hope that helps everyone who need to install p5-perlmagick.

comment:11 Changed 13 years ago by adfernandes (Andrew Fernandes)

Patch to current attached, updated to 6.72.

Changed 13 years ago by adfernandes (Andrew Fernandes)

Attachment: Portfile-v672.patch added

patch to upgrade to 6.72 from current portfile

comment:12 Changed 13 years ago by adfernandes (Andrew Fernandes)

Cc: adfernandes@… added

Cc Me!

comment:13 Changed 13 years ago by adfernandes (Andrew Fernandes)

Resolution: fixed
Status: assignedclosed

Fixed in r84084; maintainer timeout.

Note: See TracTickets for help on using tickets.