8
2

More than 1 year has passed since last update.

brew install graphviz で graphviz をインストールできない

Last updated at Posted at 2022-03-29

環境

macOS Mojave (バージョン 10.14.6)

経緯

VSCode に PlantUML というプラグインを入れて UML を書いてみようと思ったのですが、その際 Graphviz が必要ということで、 Homebrew で Graphviz をインストールしようとしたときの備忘録です。

まずはインストールしてみます。

$ brew install graphviz

... (中略) ...

==> Cloning https://svn.code.sf.net/p/netpbm/code/stable
==> Checking out 4274
svn: E170013: Unable to connect to a repository at URL 'https://svn.code.sf.net/p/netpbm/code/stable'
svn: E230001: Server SSL certificate verification failed: certificate has expired
Error: graphviz: Failed to download resource "netpbm"
Failure while executing; `svn checkout https://svn.code.sf.net/p/netpbm/code/stable /Users/xxxx/Library/Caches/Homebrew/netpbm--svn --quiet -r 4274` exited with 1. Here's the output:
svn: E170013: Unable to connect to a repository at URL 'https://svn.code.sf.net/p/netpbm/code/stable'
svn: E230001: Server SSL certificate verification failed: certificate has expired

エラーでインストールを完了できませんでした。
いったん現状把握のため、graphviz をインストールする際の情報を確認してみます。

$ brew info graphviz

graphviz: stable 3.0.0, HEAD
Graph visualization software from AT&T and Bell Labs
https://www.graphviz.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/graphviz.rb
License: EPL-1.0
==> Dependencies
Build: autoconf ✔, automake ✔, bison ✘, pkg-config ✔
Required: gd ✘, gts ✘, libpng ✔, librsvg ✘, libtool ✘, pango ✘
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 84,442 (30 days), 189,244 (90 days), 966,469 (365 days)
install-on-request: 75,643 (30 days), 169,914 (90 days), 841,762 (365 days)
build-error: 23 (30 days)

bison gd gts librsvg libtool pango にバツ印がついているのが見えます。依存関係にあるパッケージが無かったりバージョンが足りなかったりするようです。
それぞれアップグレードしてみます。

$ brew upgrade bison gd gts librsvg libtool pango

パッケージ数が多いので、時間はかかりますが完了しました。
もう一度、情報収集をしてみます。

$ brew info graphviz                             
graphviz: stable 3.0.0, HEAD
Graph visualization software from AT&T and Bell Labs
https://www.graphviz.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/graphviz.rb
License: EPL-1.0
==> Dependencies
Build: autoconf ✔, automake ✔, bison ✔, pkg-config ✔
Required: gd ✔, gts ✘, libpng ✔, librsvg ✘, libtool ✔, pango ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 84,442 (30 days), 189,244 (90 days), 966,469 (365 days)
install-on-request: 75,643 (30 days), 169,914 (90 days), 841,762 (365 days)
build-error: 23 (30 days)

まだ gtslibrsvg にバツが付いています。
残りはひとつずつアップグレードしてみましょう。

$ brew upgrade librsvg
$ brew upgrade gts

... (中略) ...

Error: librsvg not installed
Error: gts not installed

怒られてしまいました。そもそもインストールされていなかったみたいなので、インストールからやってみます。

$ brew install librsvg

... (中略) ...

==> Installing librsvg
==> ./configure --prefix=/usr/local/Cellar/librsvg/2.52.8 --disable-Bsymbolic --
==> make install gdk_pixbuf_binarydir=/usr/local/Cellar/librsvg/2.52.8/lib/gdk-p
==> /usr/local/opt/gdk-pixbuf/bin/gdk-pixbuf-query-loaders --update-cache
🍺  /usr/local/Cellar/librsvg/2.52.8: 53 files, 55.5MB, built in 7 minutes 59 seconds
==> Running `brew cleanup librsvg`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

これもかなり時間がかかりましたが、完了したので再度情報収集。

$ brew info graphviz

graphviz: stable 3.0.0, HEAD
Graph visualization software from AT&T and Bell Labs
https://www.graphviz.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/graphviz.rb
License: EPL-1.0
==> Dependencies
Build: autoconf ✔, automake ✔, bison ✔, pkg-config ✔
Required: gd ✔, gts ✘, libpng ✔, librsvg ✔, libtool ✔, pango ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 86,957 (30 days), 190,837 (90 days), 967,671 (365 days)
install-on-request: 77,989 (30 days), 171,431 (90 days), 843,097 (365 days)
build-error: 23 (30 days)

バツ印が gts だけになりました。gtsもインストールしようとしてできなかったので確認してみると。

$ brew info gts
  
gts: stable 0.7.6 (bottled)
GNU triangulated surface library
https://gts.sourceforge.io/
Conflicts with:
  pcb (because both install a `gts.h` header)
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gts.rb
License: LGPL-2.0-or-later
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔, pkg-config ✔
Required: gettext ✔, glib ✔, netpbm ✘
==> Analytics
install: 23,760 (30 days), 68,480 (90 days), 277,079 (365 days)
install-on-request: 364 (30 days), 1,162 (90 days), 5,503 (365 days)
build-error: 0 (30 days)

gts のインストールに必要な netpbm が入っていないようだったので、こちらもインストールしていきます。

$ brew install netpbm

... (中略) ...

$ brew info gts      
gts: stable 0.7.6 (bottled)
GNU triangulated surface library
https://gts.sourceforge.io/
Conflicts with:
  pcb (because both install a `gts.h` header)
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gts.rb
License: LGPL-2.0-or-later
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔, pkg-config ✔
Required: gettext ✔, glib ✔, netpbm ✔

netpbm もインストールできました。
ここまで来れば、gts を個別にインストールしなくても依存関係の補完で勝手にインストールしてくれるだろうということで、再度 graphviz をインストールしてみます。

$ brew install graphviz

... (中略) ...

==> Installing dependencies for graphviz: gts
==> Installing graphviz dependency: gts
==> Pouring gts--0.7.6_2.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/gts/0.7.6_2: 27 files, 1.1MB
==> Installing graphviz
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/graphviz/3.0.0 --disable-php --disabl
==> make
==> make install
🍺  /usr/local/Cellar/graphviz/3.0.0: 292 files, 5.6MB, built in 8 minutes 57 seconds
==> Running `brew cleanup graphviz`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

brew list でインストール済みの一覧を確認してからやれば良かったなと反省しつつ。

ともあれ brew install graphviz で graphviz をインストールできました。
(VSCode で PlantUML も使用できました。)

参考URL:

Graphviz
Homebrew でパッケージがインストールできない場合
【UML】VSCode + PlantUMLでUMLを書く

8
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
2