経緯
GD.pmなどが昔は普通に(brew install libgdくらいで)インストールできてたのに、一旦削除したら再インストールができなくなった。
事象
こんな感じ
$ cpanm GD
--> Working on GD
Fetching http://www.cpan.org/authors/id/R/RU/RURBAN/GD-2.66.tar.gz ... OK
==> Found dependencies: ExtUtils::PkgConfig
--> Working on ExtUtils::PkgConfig
Fetching http://www.cpan.org/authors/id/X/XA/XAOC/ExtUtils-PkgConfig-1.16.tar.gz ... OK
Configuring ExtUtils-PkgConfig-1.16 ... N/A
! Configure failed for ExtUtils-PkgConfig-1.16. See $HOME/.cpanm/work/1495687417.4068/build.log for details.
! Installing the dependencies failed: Module 'ExtUtils::PkgConfig' is not installed
! Bailing out the installation for GD-2.66.
で、依存元のExtUtils::PkgConfigをインストールしようとすると蹴られる
$ cpanm ExtUtils::PkgConfig -v
cpanm (App::cpanminus) 1.7043 on perl 5.018004 built for darwin-2level
Work directory is $HOME/.cpanm/work/1495687447.4212
You have make /usr/bin/make
You have LWP 6.26
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching ExtUtils::PkgConfig () on cpanmetadb ...
--> Working on ExtUtils::PkgConfig
Fetching http://www.cpan.org/authors/id/X/XA/XAOC/ExtUtils-PkgConfig-1.16.tar.gz ... OK
Unpacking ExtUtils-PkgConfig-1.16.tar.gz
x ExtUtils-PkgConfig-1.16/
x ExtUtils-PkgConfig-1.16/Changes
x ExtUtils-PkgConfig-1.16/lib/
x ExtUtils-PkgConfig-1.16/Makefile.PL
x ExtUtils-PkgConfig-1.16/MANIFEST
x ExtUtils-PkgConfig-1.16/MANIFEST.SKIP
x ExtUtils-PkgConfig-1.16/META.json
x ExtUtils-PkgConfig-1.16/META.yml
x ExtUtils-PkgConfig-1.16/perl-ExtUtils-PkgConfig.doap
x ExtUtils-PkgConfig-1.16/perl-ExtUtils-PkgConfig.spec.in
x ExtUtils-PkgConfig-1.16/README
x ExtUtils-PkgConfig-1.16/t/
x ExtUtils-PkgConfig-1.16/t/1.t
x ExtUtils-PkgConfig-1.16/t/2.t
x ExtUtils-PkgConfig-1.16/t/3.t
x ExtUtils-PkgConfig-1.16/t/4.t
x ExtUtils-PkgConfig-1.16/t/swallow_stderr.inc
x ExtUtils-PkgConfig-1.16/t/test_glib-2.0.pc
x ExtUtils-PkgConfig-1.16/t/test_non_numeric.pc
x ExtUtils-PkgConfig-1.16/t/test_short.pc
x ExtUtils-PkgConfig-1.16/lib/ExtUtils/
x ExtUtils-PkgConfig-1.16/lib/ExtUtils/PkgConfig.pm
Entering ExtUtils-PkgConfig-1.16
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.24)
Running Makefile.PL
Conf0iguring ExtUtils-PkgConfig-1.16 ... ***
*** ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't
*** seem to be in your PATH. Is it correctly installed?
*** PATH=$HOME/perl5/perlbrew/bin:$HOME/perl5/perlbrew/perls/perl-5.18.4/bin:/usr/local/share/npm/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
***
N/A
! Configure failed for ExtUtils-PkgConfig-1.16. See $HOME/.cpanm/work/1495687447.4212/build.log for details.
今読めばpkg-config
が$PATH
にないという意味だとわかるが、これをずっとcpanm
やlocal::lib
の設定ミスだと思って.zshenv
やらを掘り返して眺めてた。
解決策
PkgConfig Mac
でググれ
MacPorts(多分これ今非推奨)で解決してる記事が見つかり、ああ、これはHomebrewで以下同文だな〜っと察する。
$ brew install pkgconfig
$ cpanm ExtUtils::PkgConfig
$ cpanm GD
めでたしめでたし