Installing our beloved
Imager on macOS Sonoma with support for PNG, JPEG and GIF involves some pain. Here are the results of my struggle so others won't have to. Do this after installing Imager (requires
Homebrew):
brew install pkg-config
brew install libpng
pkg-config --cflags libpng
cpan Imager::File::PNG
brew install jpeg
pkg-config --cflags libjpeg
cpan Imager::File::JPEG
brew install giflib
cpan Imager::File::GIF
GIF: Test code failed: Can't link/include 'gif_lib.h', 'stdio.h', 'errno.h', 'string.h', 'gif'...
! Configure failed for Imager-File-GIF-0.98. See /Users/you/.cpanm/work/1713652269.80239/build.log for details.
cd /Users/you/.cpanm/work/1713652269.80239/Imager-File-GIF-0.98
perl Makefile.PL -v --incpath=/opt/homebrew/include --libpath=/opt/homebrew/var/homebrew/linked/giflib/lib
make
make test
make install
For some reason the following didn't work with the cpan client:
o conf makepl_arg "LIBS=-L/opt/homebrew/var/homebrew/linked/giflib/lib INC=-I/opt/homebrew/include"
PS - pkg-config can't find giflib so the paths were found like this:
sudo /usr/libexec/locate.updatedb
locate giflib
/opt/homebrew/var/homebrew/linked/giflib
locate gif_lib.h
/opt/homebrew/Cellar/giflib/5.2.1/include/gif_lib.h
/opt/homebrew/include/gif_lib.h
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.