From 56eb0160f717b5dc928d10bf6be0eaddb559ba15 Mon Sep 17 00:00:00 2001 From: Louis Beaumont Date: Thu, 1 Aug 2024 14:11:37 +0200 Subject: [PATCH] fix ci --- .../apps/screenpipe-app-tauri/package.json | 1 - .../screenpipe-app-tauri/scripts/pre_build.js | 47 +++++-------------- .../screenpipe-app-tauri/src-tauri/Cargo.toml | 4 +- .../screenpipe-app-tauri/src-tauri/Info.plist | 8 ---- .../src-tauri/tauri.conf.json | 1 - 5 files changed, 15 insertions(+), 46 deletions(-) diff --git a/examples/apps/screenpipe-app-tauri/package.json b/examples/apps/screenpipe-app-tauri/package.json index 38e3b51f..7a1f138b 100644 --- a/examples/apps/screenpipe-app-tauri/package.json +++ b/examples/apps/screenpipe-app-tauri/package.json @@ -1,6 +1,5 @@ { "name": "screenpipe-app", - "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", diff --git a/examples/apps/screenpipe-app-tauri/scripts/pre_build.js b/examples/apps/screenpipe-app-tauri/scripts/pre_build.js index 4b78f8e8..b0b816ca 100644 --- a/examples/apps/screenpipe-app-tauri/scripts/pre_build.js +++ b/examples/apps/screenpipe-app-tauri/scripts/pre_build.js @@ -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...'); @@ -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 diff --git a/examples/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/examples/apps/screenpipe-app-tauri/src-tauri/Cargo.toml index e9411fa9..892af156 100644 --- a/examples/apps/screenpipe-app-tauri/src-tauri/Cargo.toml +++ b/examples/apps/screenpipe-app-tauri/src-tauri/Cargo.toml @@ -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 = "" diff --git a/examples/apps/screenpipe-app-tauri/src-tauri/Info.plist b/examples/apps/screenpipe-app-tauri/src-tauri/Info.plist index 43dde827..6aabf515 100644 --- a/examples/apps/screenpipe-app-tauri/src-tauri/Info.plist +++ b/examples/apps/screenpipe-app-tauri/src-tauri/Info.plist @@ -2,14 +2,6 @@ - CFBundleName - ScreenPipe - CFBundleIdentifier - com.screenpi.pe - CFBundleVersion - 0.1.0 - CFBundleShortVersionString - 0.1 NSMicrophoneUsageDescription This app requires microphone access to record audio. NSScreenCaptureUsageDescription diff --git a/examples/apps/screenpipe-app-tauri/src-tauri/tauri.conf.json b/examples/apps/screenpipe-app-tauri/src-tauri/tauri.conf.json index e3ee4954..b4a2815b 100644 --- a/examples/apps/screenpipe-app-tauri/src-tauri/tauri.conf.json +++ b/examples/apps/screenpipe-app-tauri/src-tauri/tauri.conf.json @@ -58,7 +58,6 @@ ] }, "productName": "screenpipe", - "version": "0.1.2", "identifier": "com.screenpi.pe", "plugins": { "fs": {