LoginSignup
6
3

More than 5 years have passed since last update.

brewでバージョンを指定してFormulaを入れる

Last updated at Posted at 2019-04-05

目的

brewでマイナーバージョンを指定してFormulaを入れたかった。
今回はImageMagick 6.9.9 を指定したかった。
なお brew install imagemagick@6 だと 6.9.10 がインストールされる。

方法

ImageMagick 6.9.9 のコミットIDを取得する

# homebrewがgit cloneしてくる先に移動
$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
# homebrewでは高速化のために最新コミットしかダウンロードしてきてないので、リポジトリの全コミットを落としてくる
$ git fetch --unshallow
# これでimagemagick@6のコミットログが表示されるので、6.9.9のコミットIDをメモする
$ git log imagemagick@6
# 9308e2a7e4d73f84e7ab394a9b02c50bbb064a4a

GitHubで確認する

コミットIDを下記URLに入れて、ソースコードを確認する。

https://github.com/Homebrew/homebrew-core/blob/9308e2a7e4d73f84e7ab394a9b02c50bbb064a4a/Formula/imagemagick@6.rb

rawのURLを指定する

rawのURLにコミットIDを入れる。

https://raw.githubusercontent.com/Homebrew/homebrew-core/9308e2a7e4d73f84e7ab394a9b02c50bbb064a4a/Formula/imagemagick@6.rb

インストールする

$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9308e2a7e4d73f84e7ab394a9b02c50bbb064a4a/Formula/imagemagick@6.rb

参考

brewでマイナーバージョンを指定してFormulaを入れる方法

6
3
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
6
3