Skip to content

Commit 5fa4de5

Browse files
committed
Add Homebrew formula and update build script
Add Formula/perspective.rb for the Perspective CLI (macOS ARM64): metadata, dependency on macOS/arm64, install of the perspective binary and optional mlx.metallib, and a basic help test. Update build.sh to patch the formula's release URL and sha256 during distribution and print copy instructions for the homebrew tap.
1 parent e9a5933 commit 5fa4de5

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

Formula/perspective.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Perspective < Formula
2+
desc "Swift CLI for Apple Foundation Models and MLX models"
3+
homepage "https://github.com/techopolis/PerspectiveCLI"
4+
url "https://github.com/techopolis/PerspectiveCLI/releases/download/0.13.0/perspective-cli-0.13.0-macos-arm64.tar.gz"
5+
sha256 "67e3237d1449a035bd880a47f6c90e3d51e9af37bb6f8a2958df66dcc1bacd3c"
6+
license "MIT"
7+
8+
depends_on arch: :arm64
9+
depends_on :macos
10+
11+
def install
12+
bin.install "perspective"
13+
lib.install "mlx.metallib" if File.exist?("mlx.metallib")
14+
end
15+
16+
test do
17+
assert_match "perspective", shell_output("#{bin}/perspective --help 2>&1", 1)
18+
end
19+
end

build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,21 @@ if $DIST; then
130130
echo ""
131131
echo "Or one-liner (after publishing the release):"
132132
echo " curl -fsSL https://raw.githubusercontent.com/techopolis/PerspectiveCLI/main/scripts/remote-install.sh | bash"
133+
134+
# ── Update Homebrew formula ───────────────────────────────────────
135+
FORMULA="$PROJECT_DIR/Formula/perspective.rb"
136+
if [ -f "$FORMULA" ]; then
137+
sed -i '' "s|url \".*\"|url \"https://github.com/techopolis/PerspectiveCLI/releases/download/${VERSION}/perspective-cli-${VERSION}-macos-arm64.tar.gz\"|" "$FORMULA"
138+
sed -i '' "s|sha256 \".*\"|sha256 \"${SHA}\"|" "$FORMULA"
139+
echo ""
140+
echo "Homebrew formula updated:"
141+
echo " $FORMULA"
142+
echo " version: $VERSION"
143+
echo " sha256: $SHA"
144+
echo ""
145+
echo "Copy to your homebrew-tap repo:"
146+
echo " cp $FORMULA /path/to/homebrew-tap/Formula/"
147+
fi
133148
fi
134149

135150
echo "Build complete."

0 commit comments

Comments
 (0)