LoginSignup
0
0

More than 1 year has passed since last update.

homebrew tapリポジトリを作ってみる

Posted at

macOS(またはLinux)用パッケージマネージャー — Homebrew
https://brew.sh/index_ja
を自宅鯖でも利用しているが、
homebrewにないものについて個別にビルド・インストールするのもダルくなってきた。

リポジトリを作る

homebrew tapのformulaファイルの置き場所 - 年中アイス
https://reiki4040.hatenablog.com/entry/2020/02/18/080000
を参考にリポジトリを作成する。

1

githubに homebrew-tap というリポジトリを作成する。
例:
https://github.com/tknr/homebrew-tap

2

homebrewリポジトリのテンプレートを作成する。

前提:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

実行・インストール完了後に

zhlynn/zsign: Maybe is the most quickly codesign alternative for iOS12+ in the world, cross-platform ( macOS, Linux , Windows ), more features. https://github.com/zhlynn/zsign

https://github.com/tknr/homebrew-tap
に作成する。

3

brew tap tknr/homebrew-zsign
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/tknr/homebrew-zsign/
brew create https://github.com/zhlynn/zsign/archive/master.tar.gz

zsign.rb が作成されるので

mv /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/zsign.rb .

と自分のtap領域に移動してから
zsign.rb を zsign がビルドされるように、よしなに編集する。
内容の例:
https://github.com/tknr/homebrew-tap/blob/main/zsign.rb
参考:
Homebrewで自作のプロジェクト(ライブラリ)を公開する - Qiita https://qiita.com/mountcedar/items/f10161d4e483aa8c1283

4

デバッグ出力付きでインストールしてみる

brew install -vd zsign

あかんかったら

brew untap tknr/homebrew-zsign
(zsign.rbを修正したあとで)
brew tap tknr/homebrew-zsign

5

成功したら zsign.rb を適宜テキストエディタ等にバックアップして

brew untap tknr/homebrew-zsign

と、tapを削除する

6

作成した github リポジトリ homebrew-tap 以下に
zsign.rb を、先程バックアップした内容で作成する

7

以下のコマンドで homebrew-tap 以下の zsign.rb のインストールコマンドを実行する

brew install tknr/tap/zsign

補足

https://github.com/tknr/homebrew-tap
の zsign 以外は Makefile でのビルド&インストールではないため保留。

0
0
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
0
0