Skip to content

Commit

Permalink
temporary, cargo install required
Browse files Browse the repository at this point in the history
  • Loading branch information
daeho-ro committed Nov 2, 2024
1 parent e292c6e commit 8b16800
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions Formula/s/screenpipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@ class Screenpipe < Formula
desc "Library to build personalized AI powered by what you've seen, said, or heard"
homepage "https://github.com/mediar-ai/screenpipe"
url "https://github.com/mediar-ai/screenpipe/archive/refs/tags/v0.1.98.tar.gz"
version "0.1.98"
sha256 "cb3c8039ecb60d35bacd2b9673db112f907b4a1d3d7c32f49a5e77c0274268ad"
license "MIT"

depends_on "cmake" => :build # libsamplerate-sys
depends_on "rust" => :build
depends_on "ffmpeg"
depends_on :macos

on_macos do
def install
ENV["PKG_CONFIG_PATH"] = "/usr/local/opt/ffmpeg/lib/pkgconfig:#{ENV["PKG_CONFIG_PATH"]}" if Hardware::CPU.intel?
ENV["PKG_CONFIG_ALLOW_CROSS"] = "1" if Hardware::CPU.intel?
def install
arch = Hardware::CPU.arm? ? "arm64" : "x86_64"
args = ["--release", "--features"]

target_arch = Hardware::CPU.arm? ? "aarch64-apple-darwin" : "x86_64-apple-darwin"
system "cargo", "build", "--release", "--features", "metal,pipes", "--target", target_arch
bin.install "target/#{target_arch}/release/screenpipe"
if OS.mac?
args << "metal,pipes"
args << "--target"
target = Hardware::CPU.arm? ? "aarch64-apple-darwin" : "x86_64-apple-darwin"
args << target
else
args << "mkl"
end

def caveats
<<~EOS
Bun is not available on Homebrew
To install Bun, please visit the official website:
https://bun.sh
Follow the instructions there to install Bun on your system.
EOS
end
system "cargo", "build", *args
bin.install OS.mac? ? "target/#{target}/release/screenpipe" : "target/release/screenpipe"
lib.install "screenpipe-vision/lib/libscreenpipe.dylib"
lib.install "screenpipe-vision/lib/libscreenpipe_#{arch}.dylib"
end

test do
system "#{bin}/screenpipe", "-h"
assert_match "pipe 'test' does not exist", pipe_output("#{bin}/screenpipe pipe enable test 2>&1")
end
end

0 comments on commit 8b16800

Please sign in to comment.