2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

homebrewで古いformulaを入れてみた

Posted at

概要

自作のライブラリでffmpegのライブラリをつかって動作するのを書いているんですが
ffmpegの過去のバージョンで動作テストしたくなった。
というわけで古いバージョンのffmpegをbrew経由でいれる方法を調べてみた。

こうすればできるみたい。

https://github.com/homebrew/homebrew-core
ここにいく。

過去のバージョンがほしいライブラリ update bottleで検索する。
スクリーンショット 2017-04-30 16.23.24.png

Commitsへいくとこんな感じでBrewTestBotのコミットの一覧がでてくる。
スクリーンショット 2017-04-30 16.24.16.png

仮に3.1.5が欲しいとするとコミットの内容をみにいってffmpeg.rbのViewをクリックする。
スクリーンショット 2017-04-30 16.25.54.png

ファイルの内容がでてきたらRawをクリックして生データへのアクセスを取得する。
スクリーンショット 2017-04-30 16.26.45.png

するとこのアドレスが得られる。
https://raw.githubusercontent.com/Homebrew/homebrew-core/e5178179247828dfe1bbba346ae6490b778a76fa/Formula/ffmpeg.rb

あとはコンソールで

$ brew unlink ffmpeg
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e5178179247828dfe1bbba346ae6490b778a76fa/Formula/ffmpeg.rb

とすれば、過去のバージョンのffmpegのインストールを実行することができるみたい。

インストールが完了したらbrew switchで入れ替えればOK

$ brew switch ffmpeg 3.1.5
Cleaning /usr/local/Cellar/ffmpeg/2.8
Cleaning /usr/local/Cellar/ffmpeg/2.8.6
Cleaning /usr/local/Cellar/ffmpeg/3.0.1
Cleaning /usr/local/Cellar/ffmpeg/3.0.2
Cleaning /usr/local/Cellar/ffmpeg/3.1.4
Cleaning /usr/local/Cellar/ffmpeg/3.1.5
Cleaning /usr/local/Cellar/ffmpeg/3.2.3
Cleaning /usr/local/Cellar/ffmpeg/3.2.4
Cleaning /usr/local/Cellar/ffmpeg/3.3
81 links created for /usr/local/Cellar/ffmpeg/3.1.5
2
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?