Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Aug 1, 2024
1 parent c6b82e5 commit 56eb016
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 46 deletions.
1 change: 0 additions & 1 deletion examples/apps/screenpipe-app-tauri/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "screenpipe-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
47 changes: 13 additions & 34 deletions examples/apps/screenpipe-app-tauri/scripts/pre_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,27 +194,21 @@ if (platform == 'windows') {
/* ########## macOS ########## */
if (platform == 'macos') {
const nativeArch = os.arch();
console.log("native arch:", nativeArch);
const architectures = ['arm64', 'x86_64'];
// Additional steps for x86_64 build on ARM Mac
if (nativeArch === 'arm64') {
console.log('\nTo build for x86_64 on your ARM Mac:');
console.log('1. Install Rosetta 2 if not already installed:');
console.log(' softwareupdate --install-rosetta');
console.log('2. Set up an x86_64 Homebrew environment:');
console.log(' arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"');
// console.log('3. When building, use this command:');
// console.log(' arch -x86_64 bunx tauri build -- --target x86_64-apple-darwin');
}

// shouldnt work on intel mac

for (const arch of architectures) {
const tesseractBinary = `./tesseract-${arch}-apple-darwin`;
if (!(await fs.exists(tesseractBinary))) {
console.log(`Setting up Tesseract for ${arch}...`);

if (arch === 'arm64' || (arch === 'x86_64' && nativeArch === 'x64')) {
// Native architecture or x86_64 on Intel Mac
if (arch === 'arm64') {
// Native architecture
await $`brew install tesseract`;
await $`cp $(brew --prefix)/bin/tesseract ${tesseractBinary}`;
await $`cp /usr/local/bin/tesseract ${tesseractBinary}`;
await $`cp $(brew --prefix)/bin/tesseract /tmp/tesseract`;
await $`cp /tmp/tesseract ${tesseractBinary}`;
} else if (arch === 'x86_64' && nativeArch === 'arm64') {
// x86_64 on ARM Mac
console.log('Installing x86_64 version using Rosetta 2...');
Expand Down Expand Up @@ -247,30 +241,15 @@ if (platform == 'macos') {
'../../../../target/aarch64-apple-darwin/release/screenpipe',
'../../../../target/x86_64-apple-darwin/release/screenpipe',
];
let found = false;
for (const path of potentialPaths) { // TODO intel mac
try {
// if "x86_64" in path name copy to
if (path.includes('x86_64')) {
await $`cp ${path} ./screenpipe-x86_64-apple-darwin`
} else { // otherwise likely aarch64 (nobody uses a intel mac for dev right?)
await $`cp ${path} ./screenpipe-aarch64-apple-darwin`
console.log(`Successfully copied screenpipe from ${path}`);
found = true;
break;
} catch (error) {
console.warn(`Failed to copy from ${path}: ${error.message}`);
}
console.log(`Successfully copied screenpipe from ${path}`);
}
if (!found) {
console.error("Failed to find screenpipe");
console.error("Here's how you can build screenpipe's CLI for Intel or Silicon:");
console.error("place yourself in the root directory of screenpipe");
console.error("export PKG_CONFIG_PATH=\"/usr/local/opt/ffmpeg/lib/pkgconfig:$PKG_CONFIG_PATH\"");
console.error("export PKG_CONFIG_ALLOW_CROSS=1");
console.error("cargo build --release --metal --target aarch64-apple-darwin");
console.error("or for x86_64:");
console.error("cargo build --release --metal --target x86_64-apple-darwin");
process.exit(1);
}
// await $`cp /opt/homebrew/bin/tesseract /tmp/tesseract`
// await $`mv /tmp/tesseract ./tesseract-aarch64-apple-darwin` // TODO intel
}

// Nvidia
Expand Down
4 changes: 2 additions & 2 deletions examples/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "screenpipe-app"
version = "0.1.0"
description = "A Tauri App"
version = "0.1.2"
description = ""
authors = ["you"]
license = ""
repository = ""
Expand Down
8 changes: 0 additions & 8 deletions examples/apps/screenpipe-app-tauri/src-tauri/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>ScreenPipe</string>
<key>CFBundleIdentifier</key>
<string>com.screenpi.pe</string>
<key>CFBundleVersion</key>
<string>0.1.0</string>
<key>CFBundleShortVersionString</key>
<string>0.1</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app requires microphone access to record audio.</string>
<key>NSScreenCaptureUsageDescription</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
]
},
"productName": "screenpipe",
"version": "0.1.2",
"identifier": "com.screenpi.pe",
"plugins": {
"fs": {
Expand Down

0 comments on commit 56eb016

Please sign in to comment.