Skip to content

Commit

Permalink
fix: cli brew
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Aug 9, 2024
1 parent 01cfea8 commit 0cb3df5
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 38 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,20 @@ jobs:
echo "Set version to: $VERSION"
- name: Create deployment package
env:
RUSTFLAGS: "-C link-arg=-Wl,-rpath,@executable_path/../lib -C link-arg=-Wl,-rpath,@loader_path/../lib"
run: |
mkdir -p screenpipe-${{ env.VERSION }}-${{ matrix.target }}/bin
mkdir -p screenpipe-${{ env.VERSION }}-${{ matrix.target }}/lib
cp target/${{ matrix.target }}/release/screenpipe screenpipe-${{ env.VERSION }}-${{ matrix.target }}/bin/
cp screenpipe-vision/lib/libscreenpipe.dylib screenpipe-${{ env.VERSION }}-${{ matrix.target }}/lib/
if [ "${{ matrix.target }}" = "x86_64-apple-darwin" ]; then
cp screenpipe-vision/lib/libscreenpipe_x86_64.dylib screenpipe-${{ env.VERSION }}-${{ matrix.target }}/lib/libscreenpipe_x86_64.dylib
elif [ "${{ matrix.target }}" = "aarch64-apple-darwin" ]; then
cp screenpipe-vision/lib/libscreenpipe_arm64.dylib screenpipe-${{ env.VERSION }}-${{ matrix.target }}/lib/libscreenpipe_arm64.dylib
else
echo "Unknown target: ${{ matrix.target }}"
exit 1
fi
tar -czf screenpipe-${{ env.VERSION }}-${{ matrix.target }}.tar.gz -C screenpipe-${{ env.VERSION }}-${{ matrix.target }} .
- name: Calculate SHA256
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resolver = "2"


[workspace.package]
version = "0.1.53"
version = "0.1.54"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/louis030195/screen-pipe"
Expand Down
3 changes: 2 additions & 1 deletion Formula/screenpipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class Screenpipe < Formula
depends_on "tesseract"

def install
bin.install "screenpipe"
bin.install Dir["bin/*"]
lib.install Dir["lib/*"]
end

test do
Expand Down
8 changes: 7 additions & 1 deletion screenpipe-server/src/bin/screenpipe-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ const DISPLAY: &str = r"
";

#[derive(Parser)]
#[command(author, version, about, long_about = None)]
#[command(
author,
version,
about,
long_about = None,
name = "screenpipe"
)]
struct Cli {
/// FPS for continuous recording
/// 1 FPS = 30 GB / month
Expand Down
17 changes: 0 additions & 17 deletions screenpipe-vision/build.rs

This file was deleted.

15 changes: 4 additions & 11 deletions screenpipe-vision/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ use log::{debug, error};
use serde_json;
use std::sync::atomic::{AtomicBool, Ordering};
use std::{
collections::{HashMap, HashSet},
collections::HashMap,
sync::Arc,
time::{Duration, Instant},
};
use strsim::levenshtein;
use tokio::sync::{mpsc::Sender, Mutex}; // Corrected import for Mutex
use tokio::sync::mpsc::Sender;
use xcap::{Monitor, Window};

#[cfg(target_os = "macos")]
Expand Down Expand Up @@ -282,13 +281,7 @@ pub async fn process_ocr_task(
});

if save_text_files_flag {
save_text_files(
frame_number,
&current_text_json,
&current_text_json,
&None,
)
.await;
save_text_files(frame_number, &current_text_json, &current_text_json, &None).await;
}

if let Err(e) = result_tx
Expand All @@ -315,4 +308,4 @@ pub async fn process_ocr_task(
frame_number, _duration
);
Ok(())
}
}
10 changes: 4 additions & 6 deletions screenpipe-vision/src/ocr.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import CoreGraphics
import Foundation
import Vision

// ! TODO long term we should use core_foundation or objc crate to be 100% rust

@_cdecl("perform_ocr")
public func performOCR(imageData: UnsafePointer<UInt8>, length: Int, width: Int, height: Int)
-> UnsafeMutablePointer<CChar>? {
Expand Down Expand Up @@ -82,13 +84,9 @@ public func performOCR(imageData: UnsafePointer<UInt8>, length: Int, width: Int,
}

// # Compile for x86_64
// swiftc -emit-library -target x86_64-apple-macosx10.15 -o libscreenpipe_x86_64.dylib screenpipe-vision/src/ocr.swift
// swiftc -emit-library -target x86_64-apple-macosx10.15 -o screenpipe-vision/lib/libscreenpipe_x86_64.dylib screenpipe-vision/src/ocr.swift

// # Compile for arm64 (aarch64)
// swiftc -emit-library -target arm64-apple-macosx11.0 -o libscreenpipe_arm64.dylib screenpipe-vision/src/ocr.swift

// # Combine into a universal binary
// lipo -create libscreenpipe_x86_64.dylib libscreenpipe_arm64.dylib -output screenpipe-vision/lib/libscreenpipe.dylib
// swiftc -emit-library -target arm64-apple-macosx11.0 -o screenpipe-vision/lib/libscreenpipe_arm64.dylib screenpipe-vision/src/ocr.swift

// rm libscreenpipe_x86_64.dylib libscreenpipe_arm64.dylib

0 comments on commit 0cb3df5

Please sign in to comment.